fix(runner): cold-replay stopgaps — result caps, resume frame, arg parsing#5152
Conversation
…harden approval arg parsing Claude-Session: https://claude.ai/code/session_01AumZJ9xRd4XYNHThqy4rTv
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Two production turns failed on 2026-07-07 because the runner cold-replays the conversation as flattened text every turn. Turn c6de1865 needed three approval rounds for one curl: each fresh model rebuilt the arguments from the text replay and drifted the approval key. Turn 6d34b1ea ran five rounds and executed zero commits: the resume prompt re-presented the stale user command as if just spoken, so each fresh model restarted the whole task, and one 30-60 KB tool dump filled the 24K window and evicted the original goal.
Full analysis:
docs/design/agent-workflows/projects/approval-boundary/cold-replay-failure-report.md. Session-based continuation is the real fix and lands next; these are the cheap repairs to the text-replay path, which stays as the fallback after sessions.Replay framing, before/after
Before (approval resume, no new user text):
After:
The four changes (all
services/runner)transcript.ts): each rendered tool RESULT body caps at 4,000 chars with an explicit[... N chars omitted]marker. Tool CALL args are never capped (the resume nudge says "with the same arguments"). DefaultAGENTA_AGENT_HISTORY_MAX_CHARSraised 24,000 -> 100,000, still env-overridable.transcript.ts): when an unresolved approved call is newer than the last user text, the closing frame becomes the execute-the-approved-call instruction above instead of the stale command. Normal new-user-message turns are unchanged.normalizeJsonishhardening (responder.ts): tolerates up to three stray trailing}/]on stringified JSON args (the round-5 shape), so the honest re-issue matches the stored approval key. Non-JSON strings keep their literal value.transcript.ts+run-plan.ts): one[HITL] cold replay:log line per replay with transcript length before/after the tail slice, fully evicted message count, pending-nudge presence, resume-frame flag, and turnText length.Deferred to the session work
get_revisionplatform op (build-kit backlog).Tests:
pnpm test620/620 green,pnpm run typecheckgreen. Design doc:docs/design/agent-workflows/projects/cold-replay-stopgaps/.https://claude.ai/code/session_01AumZJ9xRd4XYNHThqy4rTv