Skip to content

Let a Planner reply the check still flags after its repair end the turn, instead of failing it - #1051

Merged
lavaman131 merged 1 commit into
mainfrom
fix/reply-check-no-fail
Dec 1, 2026
Merged

lavaman131 merged 1 commit into
mainfrom
fix/reply-check-no-fail

Conversation

@lavaman131

Copy link
Copy Markdown
Collaborator

What happened

A remote Planner finished a seven-minute turn (plan saved, build graph saved) and ended its Chat reply with an offer: "Want me to walk you through why …?". The reply check read that as a request for input. The one repair step still read as one, no decision card was added, and publishPlannerReplies threw (apps/server/src/chat/reply-policy.ts). turnFailureOf turned that into "Couldn't finish the reply." with no detail. The work was saved, but the member saw a failure, and Retry would take the reply away.

Change

  • When the repair is still flagged and no decision card was added or kept, the repaired reply stands as the Planner's answer. The turn ends normally, and the server logs a warning with the reason. Both attempts' words already streamed into Chat, so the throw hid nothing. It only reported finished work as failed.
  • Everything else stays. A reply that asks still gets its one repair step. Cards the turn added or kept still get their fixed count summary, and a bogus count still claims none. A stream error or a tool boundary stop still fails the turn, and a Stop still ends it.
  • Why no flagged reply is still blocked outright: the docs called for blocking because replies used to be withheld until checked, so a failure kept unchecked prose out of Chat. Since replies started streaming as they are written (c98a367), nothing is withheld. The only failures left are the turn's own.
  • docs/hosted-agent.md still described replies being withheld until checked. Its reply-check paragraph now describes the current behavior. docs/agent-connection.md no longer calls the repaired reply withheld.

Tests

  • New reply-policy test reproducing the production sequence: the first reply is flagged after a saved edit, the repair is still flagged, and no card is added or kept. It fails on main with "could not move its questions into inline decisions" and passes with the fix.
  • I updated the tests that asserted the old throw so they keep what they protect: the single repair step, no summary from an invalid count, no turn failure, and the session plus its open question kept past 30 minutes. A threads Retry case that used the refused reply as its "keeps the session" failure now uses a stream error while the session waits on a question.
  • With the fix reverted, 19 of these tests fail. With it, bun test apps/server/src/chat apps/server/src/agent gives 1590 passed and 0 failed. bun run fix, bun run ci and bun run types are clean.

…rn, instead of failing it

A remote Planner finished a seven-minute turn that saved the plan and its build
graph, and ended its Chat reply with an offer ("Want me to walk you through why
...?"). The reply check read that as a request for input, the one repair step
still read as one, no decision card was added, and publishPlannerReplies threw.
The turn ended as "Couldn't finish the reply." with no detail: the work was
saved, but the member saw a failure, and Retry would take the reply away.

The throw dates from when replies were withheld until checked. Since replies
stream as they are written, both attempts' words are already in Chat before the
check runs, so failing the turn hid nothing and only misreported finished work.
A repair the check still flags, with no decision card added or kept, now stands
as the Planner's answer, the turn ends normally, and the server logs a warning
with the reason.

Everything else stays: a reply that asks still gets its one repair step, cards
the turn added or kept still get their fixed count summary, a bogus count still
claims none, and a stream error, a tool boundary stop or a Stop end the turn as
before. No flagged reply is blocked outright any more; the only failures left
are the turn's own.

docs/hosted-agent.md described the withholding era, so its reply-check
paragraph now says what happens, and docs/agent-connection.md no longer calls
the repaired reply withheld.

Assistant-model: Claude Opus 5.5
Assistant-verification: red before fix: the new reply-policy test reproducing the production sequence (first reply flagged, repair flagged, no card) threw "could not move its questions into inline decisions" at reply-policy.ts:240; with the fix reverted, 19 tests across reply-policy, invoke and threads fail
Assistant-verification: bun test apps/server/src/chat apps/server/src/agent (1590 pass, 0 fail)
Assistant-verification: bun run fix, ci and types
@lavaman131
lavaman131 merged commit 86d36e0 into main Dec 1, 2026
26 checks passed
@lavaman131
lavaman131 deleted the fix/reply-check-no-fail branch December 1, 2026 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant