Skip to content

fix(framework): backlog turns drop the agent's signals#564

Merged
suleimansh merged 1 commit into
mainfrom
fix/backlog-turn-signals
Jul 16, 2026
Merged

fix(framework): backlog turns drop the agent's signals#564
suleimansh merged 1 commit into
mainfrom
fix/backlog-turn-signals

Conversation

@suleimansh

Copy link
Copy Markdown
Member

Closes #563

A backlog turn goes through the run's own driver session, so it carries the same signal protocol as any other turn. promptItem only parsed await gates, so the rest was dropped:

  • showMarkdown() views never reached the rail (backlog work was invisible in the dashboard)
  • setSessionName() was ignored
  • setReadyForMerge() never emitted ready-for-merge, which maybeFirePostMerge gates on, so --post-merge could not fire from backlog work

That last one matters now that the queue is where post-merge writes its follow-ups (#558) and the knowledge docs (#537).

Cause was duplication: emitTurnSignals was byte-identical in run.ts and prompt-run.ts, and the third turn site never got a copy. Now one createTurnSignalEmitter used by all three. The backlog loop keeps one emitter for the whole backlog so ready-for-merge still fires once across every item.

No prompt text changed.

Proof, with the fake driver against the real loop. Same probe before and after:

before: ["log","log","log"]
after:  ["log","log","view","session-name","ready-for-merge","log"]

Both new tests fail with the fix reverted (checked, not assumed). Full suite 536 pass / 0 fail on a clean dist-test.

The backlog loop prompts through the run's own driver session, so a backlog
turn carries the same signal protocol as any other turn. promptItem only
parsed await gates, so everything else was dropped: showMarkdown() views never
reached the rail, setSessionName() was ignored, and setReadyForMerge() never
emitted ready-for-merge, which is what maybeFirePostMerge gates on. So
--post-merge could not fire from backlog work, now that the queue is where
post-merge writes its follow-ups (#558) and the knowledge docs (#537).

The cause was duplication: emitTurnSignals was byte-identical in run.ts and
prompt-run.ts, and the third turn site never got a copy. It is now one
createTurnSignalEmitter used by all three. The backlog loop keeps a single
emitter for the whole backlog, so ready-for-merge still fires once.

Closes #563
@suleimansh suleimansh self-assigned this Jul 16, 2026
@suleimansh
suleimansh merged commit be0a58c into main Jul 16, 2026
2 checks passed
@suleimansh
suleimansh deleted the fix/backlog-turn-signals branch July 16, 2026 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backlog turns drop the agent's signals (views, session name, ready-for-merge)

1 participant