test(assistant): provide an authorized source for request identity fixture
This commit is contained in:
1 parent
83606af1c4
commit
a312dd098e
1 file changed
+1
-1
@@ -35,7 +35,7 @@ test('restart persists interruption and marks unfinished actions needs_review wi
|
||||
const reopened=new AssistantStore(dir);try{reopened.recover();reopened.recover();const saved=reopened.conversation(c.id,'alice');assert.equal(saved.turns[0].status,'interrupted');assert.equal(saved.turns[0].actions[0].status,'needs_review');assert.equal(reopened.events(c.id,'alice',{}).events.filter(e=>e.kind==='interrupted').length,1);assert.ok(reopened.events(c.id,'alice',{}).events.some(e=>e.kind==='action_result'&&e.data.status==='needs_review'));}finally{reopened.close();}
|
||||
});
|
||||
test('request identities deduplicate pending and completed work before busy or quota checks',async t=>{
|
||||
let release,calls=0,input;const {store,service,dir}=fixture(t,{chat:async value=>{calls++;input=value;value.onEvent?.({kind:'model',data:{phase:'step_start',step:1,secret:'PRIVATE_INTERNAL'}});return new Promise((resolve,reject)=>{release=resolve;value.signal.addEventListener('abort',()=>reject(value.signal.reason),{once:true});});}});enable(store);const c=store.create('alice');
|
||||
let release,calls=0,input;const {store,service,dir}=fixture(t,{chat:async value=>{calls++;input=value;value.onEvent?.({kind:'model',data:{phase:'step_start',step:1,secret:'PRIVATE_INTERNAL'}});return new Promise((resolve,reject)=>{release=resolve;value.signal.addEventListener('abort',()=>reject(value.signal.reason),{once:true});});}});service.deps.workspace={snapshot:()=>({connections:[{id:'source-1',owner:'alice',name:'Fixture BPM',status:'connected'}],exceptions:[]})};enable(store);const c=store.create('alice');
|
||||
const turn=service.send(c.id,principal,'diagnose',{requestId:'request-1',diagnostic:{command:'bpm',targetId:'source-1'}});
|
||||
assert.equal(service.send(c.id,principal,'diagnose',{requestId:'request-1',diagnostic:{command:'bpm',targetId:'source-1'}}).id,turn.id);
|
||||
assert.throws(()=>service.send(c.id,principal,'changed',{requestId:'request-1',diagnostic:{command:'bpm',targetId:'source-1'}}),{status:409});
|
||||
|
||||
Reference in new issue
Block a user