Skip to content

Refuse lost later planner amendments and give repairs room for the reply - #2407

Merged
santoshkumarradha merged 31 commits into
app/v3from
c27/planner-lost-amendment
Nov 5, 2026
Merged

santoshkumarradha merged 31 commits into
app/v3from
c27/planner-lost-amendment

Conversation

@santoshkumarradha

Copy link
Copy Markdown
Member

What changes

Builds on #2404. That PR handles a cut-off or empty reply from the opening planner call. Later planner calls (amendments while a run is going) skipped those checks. A later reply cut off at the output limit, or a syntax repair that came back empty, was saved as "no change". The run lost the amendment without saying so.

  • Later replies: a later reply that was cut off or came back empty is now refused. The run leaves a note saying so, keeps its current plan and goes on to the next round. A complete, explicit {} from the planner is still "no change".
  • Repairs: a syntax repair now always gets at least as much output room as the reply it has to repeat: max(8192, 2 × the reply's completion tokens), or a larger cap if the call already asked for one. Before, it reused the original cap even when that was smaller than the reply.

No limit constant changes. The provider and spending checks still apply.

Tests

🤖 Generated with Claude Code

santoshkumarradha and others added 30 commits November 5, 2026 06:48
The base worker regression refused crew-0-a.md under crew-0-*.md. Commit
461fcd9 introduced exact/prefix matching and accepted unvalidated scopes;
dedbfef normalized scope spellings without interpreting glob syntax.

Share segment matching and scope validation across worker guards, scheduler
collisions, retry detection, quick-task admission and the harness rig. Reject
unsafe plans with repairable reasons and refuse symlink escapes, including
dangling links. Keep exact absolute quick-task scope normalization compatible.
Potential pattern intersections serialize conservatively. No recursive **.

The worker regression was red before implementation. Target tests pass five
times; all named tests in the affected session files and amendment file pass.
Source and packed manual checks pass. Fixed and lean prefix totals each fall
10 bytes; their existing budget failures remain. Changelog check rejects the
required pr: 0 placeholder as expected. No budgets or tests were weakened.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
As in the shell, a wildcard or class never matches a segment that starts
with a dot unless the pattern segment starts with one too, so * never
reaches .git, .env or .codeaf. Git hooks run code, and a scope that reads
as narrow must not reach them. .env* still names .env.local.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An empty opening fell through synthesis with no results, marked the root done, and announced an unsaved stop. End it through the existing failed-with-detail path and save one assistant notice. Admit retries only for live families that created no workers, through normal budget checks, with a new run and no carried output.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The planner introduced in 461fcd9 discarded finish reasons and accepted empty syntax repairs. Retain response metadata, retry a lost opening once with more output room, and preserve the cut-off detail through the empty-crew notice and fresh-run recovery path from #2403. Complete explicit empty plans and later planner calls keep their existing behavior.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Later planner calls bypassed the opening-only lost-reply guards, allowing cut-off replies and empty syntax repairs to settle as no change. Reuse the existing failure detection so the run notes the refusal, keeps its plan, and continues. Give syntax repair max(8192, twice reported completion tokens), preserving a larger requested recovery cap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The glob scope check pushed newQuickSpec to 18 decisions against a
ceiling of 15. The check is now its own function, refuseUnsafeScopes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	internal/session/orchestrate_test.go
With the Library re-land also in the manual, the word pulled "what happens
if it will not stop" away from the keys page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	internal/session/orchestrate_test.go
# Conflicts:
#	internal/orchestrate/orchestrate.go
#	internal/session/orchestrate.go
#	internal/session/orchestrate_test.go
@santoshkumarradha
santoshkumarradha merged commit 9104087 into app/v3 Nov 5, 2026
@santoshkumarradha
santoshkumarradha deleted the c27/planner-lost-amendment branch November 5, 2026 22:12
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