fix(agent-loop): report turn failures at source
This commit is contained in:
@@ -300,6 +300,10 @@ export function apply(ctx: Context): void {
|
||||
}
|
||||
return
|
||||
case 'turn/end':
|
||||
if (event.data.reason.kind === 'max-tokens') {
|
||||
disarm(state)
|
||||
return
|
||||
}
|
||||
if (event.data.reason.kind !== 'aborted') return
|
||||
if (state.attempt?.phase === 'admitted') state.attempt.cancelled = true
|
||||
else disarm(state)
|
||||
|
||||
Reference in New Issue
Block a user