fix(agent-loop): balance inbox invariant on continuation-reason steer
The FIFO-conservation invariant fired on the loop-authored continuation reason path: a continue-with-reason decision entered the steering FIFO without an agent/inbox/enqueue, so its later dequeue/discard had no matching enqueue. Emit the enqueue for that steer too, add a regression test that mounts the invariant over a continue-with-reason turn and a cancel, and hoist the duplicated inboxInfo helper into inbox.ts. Found by fresh-eye review.
This commit is contained in:
@@ -594,8 +594,9 @@ describe('pi-tui chat lifecycle and transcript', () => {
|
||||
await tick()
|
||||
expect(result.terminal.output).toContain('1 queued')
|
||||
|
||||
// A loop-authored steering event (plugin source, no matching agent/inbox/enqueue)
|
||||
// cannot consume a pending user slot, even when it drains first.
|
||||
// A steering/message whose source matches no pending badge entry (here a
|
||||
// plugin source with no tracked enqueue) pops nothing, so it cannot consume
|
||||
// a pending user slot even when it drains first.
|
||||
result.terminal.output = ''
|
||||
result.session.append('steering/message', {
|
||||
turn: 1,
|
||||
|
||||
Reference in New Issue
Block a user