Repository navigation
fix(agents): let read-only settled turns continue with tools after an empty stop - #178192
Conversation
… empty stop Retain the normal tools and transcript for one continuation only when current-attempt replay evidence explicitly reports no potential side effects. Keep isolated text-only finalization unchanged for possible effects or missing evidence, including its failure warning and existing retry budget.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: def611ce84
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| }; | ||
| const answer = classifyAssistantTurn({ attempt, payloadCount: 0 }); | ||
| const instruction = resolveSettledToolTerminalContinuationInstruction({ | ||
| const continuation = resolveSettledToolTerminalContinuation({ |
There was a problem hiding this comment.
Pass current replay evidence to worker continuations
readSubscriptionCompletionEvidence() supplies only replayMetadata, but resolveSettledToolTerminalContinuation() retains tools only when attempt.currentAttemptReplayMetadata?.hadPotentialSideEffects === false. Consequently, every worker turn still gets disableTools: true: after a settled read-only tool and empty stop, this path clears session.agent.state.tools, so multi-read worker tasks remain unable to continue. Populate the current-attempt metadata from this fresh subscription before calling the resolver.
AGENTS.md reference: AGENTS.md:L48-L51
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. What this changesThis PR allows one tool-enabled continuation after non-visible output when the current attempt explicitly records no potential side effects. Example: Groq openai/gpt-oss-120b stops empty after reading four files in a six-file task.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this PR open: the recovery change has clear value, but the worker adapter never supplies the evidence required to retain tools. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe embedded runner and worker pass settled tool activity and assistant output into shared recovery policy, which selects either normal continuation or isolated text-only finalization. flowchart TD
A[Assistant stops without visible output] --> B[Subscription completion evidence]
B --> C[Shared recovery policy]
C --> D[Normal continuation with tools]
C --> E[Isolated text-only finalization]
D --> F[Terminal reply]
E --> F
Technical reviewBest possible solution: Keep the shared recovery policy and supply explicit current-attempt replay evidence from the worker’s fresh subscription. Do we have a high-confidence way to reproduce the issue? Source inspection establishes the worker failure deterministically: missing current-attempt metadata selects disableTools=true after a settled read and empty stop; no target code was executed. Is this the best way to solve the issue? Using the existing replay classifier and recovery owner is appropriate; the worker must provide the same explicit evidence that local attempt completion already produces. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 11ad47f0ea86. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +37, Tests +94. Total +131 across 7 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 20, 2026, 3:18 AM ET / 07:18 UTC. |
|
Merged via squash.
|
… empty stop (openclaw#178192) Retain the normal tools and transcript for one continuation only when current-attempt replay evidence explicitly reports no potential side effects. Keep isolated text-only finalization unchanged for possible effects or missing evidence, including its failure warning and existing retry budget.
PR openclaw#178192 moved terminal recovery onto the aggregate retry policy. Keep its two component helpers private and exercise the same expectations through that public policy. PR openclaw#178116 replaced the Telegram group-config alias with the canonical resolver type; remove the unused alias.
What Problem This Solves
When a model returns an empty or non-visible stop right after settled tool calls, the embedded runner gives it one "settled tool terminal continuation". That continuation is text-only (tools disabled, reduced transcript) so a model cannot repeat side effects. It also ran when every settled tool in the attempt was read-only. A model that stalled mid-task could then only answer that it cannot read the remaining files.
Live, Groq
openai/gpt-oss-120bon a six-file read task: after 4-5 successfulreadcalls Groq returns a genuinely empty completion (finish_reason: stop, no content, no reasoning; wire-captured through a logging proxy). The text-only continuation then produced "I'm unable to read the remaining files without tool access" or a partial answer. In one run it returned raw tool-call markup as the reply. The same model in a direct API loop completes the task, so the empty stop is transient.User Impact
Turns that stall after read-only tool work can now continue the task with their tools. Turns that may have caused side effects, or that lack side-effect evidence, keep the existing text-only finalization unchanged.
Why This Change Was Made
The decision point in
incomplete-turn-recovery.tsnow keeps normal tools and transcript for the one continuation only when current-attempt replay evidence explicitly reportshadPotentialSideEffects === false. That is the same classifier the replay-safety paths already use. The instruction says to continue the task and not repeat completed calls. The retry budget (one continuation) and silent-reply handling are unchanged.terminal-resolution.tsroutes those attempts to the normal continuation instead of isolated finalization; the finalizer itself is untouched.Evidence
openclaw agent --local, Groq gpt-oss-120b, six sequential reads, 4 runs each: main 0/4 correct (7/7 failures across the investigation); this branch 2/4 fully correct. The other two reached 5 of 6 words before a second empty stop exhausted the unchanged one-retry budget.