fix(subagent): confirm steering request admission

This commit is contained in:
Dudu-0223
2026-07-24 14:32:19 +08:00
committed by imccyu
parent 189502e4ac
commit e1f7eeeb95
58 changed files with 565 additions and 480 deletions

View File

@@ -40,7 +40,7 @@ function stubAgent(ctx: Context, id: string): { agent: Agent; session: Session }
send: () => {},
updateInbox: () => 'not-found',
followup: () => {},
steer: () => {},
steer: () => ({ outcome: Promise.resolve({ status: 'rejected' as const }) }),
inject(input) { appendInjection(session, input) },
reserveTurnAdmission: () => undefined,
cancel() { status = 'idle' },

View File

@@ -50,7 +50,7 @@ function stubAgentForSession(session: Session): StubAgent {
send: () => {},
updateInbox: () => 'not-found',
followup: () => {},
steer: () => {},
steer: () => ({ outcome: Promise.resolve({ status: 'rejected' as const }) }),
inject(input) {
if (shouldDefer) deferred.push(input)
else appendInjection(session, input)

View File

@@ -41,7 +41,7 @@ function liveAgent(ctx: Context, session: Session): Agent {
send: () => {},
updateInbox: () => 'not-found',
followup: () => {},
steer: () => {},
steer: () => ({ outcome: Promise.resolve({ status: 'rejected' as const }) }),
inject(input: UserMessage) {
session.append('user/message', input, { surfaceOp: 'append' })
},

View File

@@ -35,7 +35,7 @@ function stubAgent(rawId: string, supplied?: Session): StubAgent {
send: () => {},
updateInbox: () => 'not-found',
followup: () => {},
steer: () => {},
steer: () => ({ outcome: Promise.resolve({ status: 'rejected' as const }) }),
inject(input) {
session.append('user/message', input, { surfaceOp: 'append' })
},