Skip to content

agent loop: fixes from a review of the whole loop - #414

Merged
rromenskyi merged 3 commits into
mainfrom
loop-review-fixes
Nov 22, 2026
Merged

rromenskyi merged 3 commits into
mainfrom
loop-review-fixes

Conversation

@rromenskyi

@rromenskyi rromenskyi commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor
  • Judge: done() next to a stray tool call is no verdict.
  • A collapsed generation gets a fresh nudge after any whole turn, not once per run.
  • Job results delivered mid-task are kept after the task, as a plain append:
    no longer ahead of the task's own message, and /rewind checkpoints stay valid.
  • A sub-agent that stopped (steps, stuck, failed turn) is reported as a failure.
  • A task that finished behind a modal gets the plan handshake and auto-compact.
  • External agents list the files they created (git diff --stat never shows them).
  • /goal ttl 0 says the goal stays open until /goal clear.
  • Spawns run in parallel only in plan mode or in separate, non-nested dirs.
  • A prose answer is judged when the run is the goal itself.
  • An oversized newest tool result is cut from the middle to fit the window.
  • The history cap never leaves an answer first.

Review round (codex, muse, devin):

  • Force-detach hands back job results the wedged run took; they reached no history.
  • External agents: diff against the commit they started from, so staged or
    committed work shows; untracked names read with -z (no git quoting).
  • Spawn fan-outs compare real paths, widened to the git checkout (symlinks,
    sibling dirs of one repo).
  • Judge: DONE in the text next to a stray tool call is no verdict either.
  • runIsTheGoal recognises corrections by their header, not any second paragraph.
  • A prose reply to the goal the judge does not accept hands control back
    (it may be a question), instead of re-feeding the goal over it.
  • The middle cut keeps at least 200 bytes and never outgrows the result.

Each fix has a test that fails with the fix reverted. go test ./... and -race on internal/agent + cmd/agent pass.

🤖 Generated with Claude Code

- Judge: done() next to a stray tool call is no verdict.
- A collapsed generation gets a fresh nudge after any whole turn, not once per run.
- Job results delivered mid-task are kept after the task, as a plain append:
  no longer ahead of the task's own message, and /rewind checkpoints stay valid.
- A sub-agent that stopped (steps, stuck, failed turn) is reported as a failure.
- A task that finished behind a modal gets the plan handshake and auto-compact.
- External agents list the files they created (git diff --stat never shows them).
- /goal ttl 0 says the goal stays open until /goal clear.
- Spawns run in parallel only in plan mode or in separate, non-nested dirs.
- A prose answer is judged when the run is the goal itself.
- An oversized newest tool result is cut from the middle to fit the window.
- The history cap never leaves an answer first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

rromenskyi and others added 2 commits November 22, 2026 12:11
- Force-detach hands back job results the wedged run took; they reached no history.
- External agents: diff against the commit they started from, so staged or
  committed work shows; untracked names read with -z (no git quoting).
- Spawn fan-outs compare real paths, widened to the git checkout (symlinks,
  sibling dirs of one repo).
- Judge: DONE in the text next to a stray tool call is no verdict either.
- runIsTheGoal recognises corrections by their header, not any second paragraph.
- A prose reply to the goal the judge does not accept hands control back
  (it may be a question), instead of re-feeding the goal over it.
- The middle cut keeps at least 200 bytes and never outgrows the result.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Job draining is bound to its agent and refuses a detached one under jobMu, so
  a wedged run reaching its next drain after a force-detach takes nothing.
- External agents in a repository with no commit yet diff against the empty tree.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rromenskyi
rromenskyi merged commit 7340e9e into main Nov 22, 2026
2 checks passed
@rromenskyi
rromenskyi deleted the loop-review-fixes branch November 22, 2026 20:39
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