Reconcile proven completed inputs without replay and hide internal fact notices
This commit is contained in:
@@ -8,6 +8,19 @@ def row(mid,text,source='human',origin='session_history',**extra):
|
||||
|
||||
|
||||
class ConversationTests(unittest.TestCase):
|
||||
def test_only_proven_complete_fact_notice_input_is_hidden(self):
|
||||
from agent_control.notices import fact_answer_notice
|
||||
notice={'notification_id':'a'*32,'decision':{'id':'choice','title':'Plan'},
|
||||
'event':{'kind':'fact_answered','request_id':'fact','answer':'Verified'}}
|
||||
body=fact_answer_notice(notice)
|
||||
rows=[row('input',body),row('reply','咨询解释','agent'),
|
||||
row('quote',body,origin='coordination'),row('near',body+'\n用户引用'),
|
||||
row('fake',body.replace('Verified','Changed'))]
|
||||
links=[dict(message_id='input',turn_id='t',phase='input'),
|
||||
dict(message_id='reply',turn_id='t',phase='final_answer')]
|
||||
self.assertEqual([r['id'] for r in project(rows,links,{body})],['reply','quote','near','fake'])
|
||||
self.assertEqual(project([row('unproven',body)],[])[0]['text'],body)
|
||||
|
||||
def test_real_user_body_is_never_keyword_filtered(self):
|
||||
text='请讨论验收测试。\n[web-message-id:quoted]\n{"status":"failed"}\n<in-app-browser-context>引用</in-app-browser-context>'
|
||||
rows=[row('user',text,origin='coordination')]
|
||||
|
||||
Reference in New Issue
Block a user