Repository navigation
fix(agents): prevent recursive task execution during model fallback - #92011
Conversation
d122371 to
c18b02b
Compare
|
Cross-harness review: not landable yet. The patch only injects a fallback identity prompt into CLI backends. It does not establish one invariant across OpenClaw's embedded runtime, Claude/Codex CLI backends, or Codex's native Best-fix requirement before merge: define the forbidden recursion state at the shared fallback/run boundary, then enforce it in every harness that can spawn work (or explicitly prove a harness cannot), with regression coverage for embedded OpenClaw, CLI/MCP exposure, and Codex native collaboration. I checked Codex ownership in |
|
Thanks for the cross-harness review — you're right on all three counts. The pushed diff was also structurally broken (the injection landed after the return path), so the prompt never executed; I'm treating this as a rewrite, not a patch. Converting to draft while I rework it along the lines you outlined:
Will mark ready once CI and the behavior-proof job are green. |
|
Codex review: needs maintainer review before merge. Reviewed July 16, 2026, 11:59 PM ET / July 17, 2026, 03:59 UTC. Summary PR surface: Source +137, Tests +205. Total +342 across 15 files. Reproducibility: no. independent current-main reproduction was completed in this review, but the incident record, provenance path, and production-boundary tests provide a clear source-level reproduction model. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land the shared capability design only after checking the exact pinned Codex source and recording that its native collaboration registration and thread-config semantics match the two feature flags and transient-thread strategy used here. Do we have a high-confidence way to reproduce the issue? No independent current-main reproduction was completed in this review, but the incident record, provenance path, and production-boundary tests provide a clear source-level reproduction model. Is this the best way to solve the issue? Yes, conditionally: a typed capability enforced at shared tool construction is substantially safer than prompt-only or AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6c075724fe7c. Label changesLabel justifications:
Evidence reviewedPR surface: Source +137, Tests +205. Total +342 across 15 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (12 earlier review cycles; latest 8 shown)
|
a0039dd to
46d93c4
Compare
|
Reworked per the cross-harness review and marking ready: the invariant is now defined at the shared fallback/run boundary and enforced mechanically at the One open scoping question from before still stands: should the Codex-native |
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
83ce64f to
53b8496
Compare
|
Rebased onto latest Verification on the rebased head I also attempted the repo typecheck locally, but this checkout's dependency set is currently missing unrelated workspace deps such as Scope is unchanged: this PR is still intentionally limited to the embedded runtime Requesting maintainer scope decision: is landing this as a scoped embedded-runtime mitigation acceptable, or should one of the follow-up surfaces be pulled into this PR? @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
|
Merged current Verification on head |
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
Co-authored-by: Mert Başar <[email protected]>
|
Merged via squash.
|
Closes #92271
What Problem This Solves
Fixes an issue where a fallback model handling an internal completion report could interpret that report as fresh work and recursively delegate it again.
Why This Change Was Made
The run now derives a typed
report_onlydelegation capability only when a fallback handles completion provenance. The shared OpenClaw tool boundary removes or action-gates delegation surfaces while preserving reporting, status, history, and cleanup tools. Codex app-server runs additionally disable both native collaboration feature generations on a transient thread, because loaded Codex threads ignore resume-time config overrides. Normal thread bindings remain unchanged.This replaces the original
sessions_spawn-only guard and coverssessions_send, system-agent delegation, LLM tasks, Codex session steering, cron/media launch actions, the Pi/Copilot/Codex shared tool surfaces, and native Codex collaboration.User Impact
Fallback completion reports can summarize and verify completed work without launching or redirecting more work. Normal user turns, non-fallback completion reports, and ordinary verification/reporting tools retain their existing behavior.
Evidence
node scripts/run-vitest.mjs src/agents/delegation-capability.test.ts extensions/codex/src/app-server/thread-lifecycle.test.ts extensions/codex/src/app-server/thread-lifecycle.binding.test.ts extensions/codex/src/app-server/dynamic-tool-build.test.ts extensions/copilot/src/tool-bridge.test.ts— 3 core tests, 223 Codex tests, and 77 Copilot tests passed.node scripts/check-changed.mjs -- <15 touched files>— Blacksmith Testbox changed gate passed (tbx_01kxq0tacnrjjj6vpd3h3x22c5): https://github.com/openclaw/openclaw/actions/runs/29551712547subagents.steeraction; current source and schema expose onlylistandcancel, so no hypothetical branch was added.Contributor credit preserved in the rewritten commit. Thanks @MertBasar0.