Repository navigation
Conversation
Share runtime-context traversal between current-turn adoption and replay so a compacted completion input keeps its own turn. Treat genuine keyed-turn assertions as terminal across model retries and completion delivery, recording one permanent failure.
|
🦞👀 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: needs maintainer review before merge. Reviewed September 24, 2026, 4:50 PM ET / 20:50 UTC. ClawSweeper reviewWhat this changesThe branch lets completion inputs retain their transcript turn across runtime-context messages and compaction, then treats a closed-turn assertion as a permanent completion failure instead of retrying models or delivery. Merge readiness✅ Ready for maintainer review Current main still stops keyed-user turn traversal at runtime-context messages, and the branch addresses that gap and the resulting retry loop. The review found no actionable introduced defect. Priority: P1 Review scores
Verification
How this fits togetherSubagent results enter a requester completion flow that resumes an agent turn and may deliver a reply. Transcript traversal decides whether the persisted input belongs to that turn; retry and delivery owners then either continue or record a terminal failure. flowchart LR
A[Settled subagent results] --> B[Requester completion wake]
B --> C[Embedded agent run]
C --> D[Transcript turn check]
D --> E[Retry decision]
E --> F[Reply or recorded failure]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +29, Tests +108, Docs +5. Total +142 across 14 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one current-turn resolver for replay and keyed-user adoption, and retain the existing permanent-failure disposition for closed turns. Do we have a high-confidence way to reproduce the issue? Yes. A persisted keyed user followed by runtime context and compaction reaches the mismatch on current main; the PR reports a failing baseline, though this read-only review did not execute it. Is this the best way to solve the issue? Yes. Sharing the existing current-turn traversal rule and classifying the exact local assertion at retry and completion boundaries is a narrow repair. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 11d36ebc2583. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
* commit '0484d7a3ecf52589b0d3d98741e58e5f6b5bf661': (68 commits) fix(subagents): stop completion transcript retry loops (#157571) perf(sessions): remove duplicate foreground history reference scans (#157572) improve(typesafe): defer startup work until the first decision (#157380) fix(update): restore npm-pack helper typechecking (#157659) fix(packaging): avoid heap exhaustion on large bundles (#157471) refactor(infra): share process error handler registries (#157632) chore(ui): refresh control ui locales (#157573) fix(gateway): release remote Skills subscriptions when shutdown drains (#157592) perf(plugins): reuse declared tool membership during resolution (#156205) fix(ui): pasted text previews fail before sending (#157390) fix(agents): wait for database resources during deletion (#157631) improve: move operator profile database reads off the Gateway thread (#155800) fix: explain rejected settings without losing edits (#157549) fix: keep Gateway responsive while recording trajectory events (#157598) fix(auth): show SIWC email and selected model account identity (#157629) docs: explain Codex app approval precedence (#155089) refactor(wizard): share select prompt requests (#157607) fix(ui): omit empty sections from conversation Markdown exports (#157590) fix(doctor): explain update lint supervisor refusals (#156547) fix(ui): GitHub folder links lose repository context (#157619) ...
* commit '0484d7a3ecf52589b0d3d98741e58e5f6b5bf661': (68 commits) fix(subagents): stop completion transcript retry loops (#157571) perf(sessions): remove duplicate foreground history reference scans (#157572) improve(typesafe): defer startup work until the first decision (#157380) fix(update): restore npm-pack helper typechecking (#157659) fix(packaging): avoid heap exhaustion on large bundles (#157471) refactor(infra): share process error handler registries (#157632) chore(ui): refresh control ui locales (#157573) fix(gateway): release remote Skills subscriptions when shutdown drains (#157592) perf(plugins): reuse declared tool membership during resolution (#156205) fix(ui): pasted text previews fail before sending (#157390) fix(agents): wait for database resources during deletion (#157631) improve: move operator profile database reads off the Gateway thread (#155800) fix: explain rejected settings without losing edits (#157549) fix: keep Gateway responsive while recording trajectory events (#157598) fix(auth): show SIWC email and selected model account identity (#157629) docs: explain Codex app approval precedence (#155089) refactor(wizard): share select prompt requests (#157607) fix(ui): omit empty sections from conversation Markdown exports (#157590) fix(doctor): explain update lint supervisor refusals (#156547) fix(ui): GitHub folder links lose repository context (#157619) ...
* refactor(ai): share Mistral text delta appends * Merge main to incorporate the upstream update type fix * commit '0484d7a3ecf52589b0d3d98741e58e5f6b5bf661': (68 commits) fix(subagents): stop completion transcript retry loops (#157571) perf(sessions): remove duplicate foreground history reference scans (#157572) improve(typesafe): defer startup work until the first decision (#157380) fix(update): restore npm-pack helper typechecking (#157659) fix(packaging): avoid heap exhaustion on large bundles (#157471) refactor(infra): share process error handler registries (#157632) chore(ui): refresh control ui locales (#157573) fix(gateway): release remote Skills subscriptions when shutdown drains (#157592) perf(plugins): reuse declared tool membership during resolution (#156205) fix(ui): pasted text previews fail before sending (#157390) fix(agents): wait for database resources during deletion (#157631) improve: move operator profile database reads off the Gateway thread (#155800) fix: explain rejected settings without losing edits (#157549) fix: keep Gateway responsive while recording trajectory events (#157598) fix(auth): show SIWC email and selected model account identity (#157629) docs: explain Codex app approval precedence (#155089) refactor(wizard): share select prompt requests (#157607) fix(ui): omit empty sections from conversation Markdown exports (#157590) fix(doctor): explain update lint supervisor refusals (#156547) fix(ui): GitHub folder links lose repository context (#157619) ... Co-authored-by: Vincent Koc <[email protected]>
Preserve the current keyed completion input across runtime-context carriers and compaction by sharing the turn traversal rule. Keep completed-assistant and newer-user boundaries closed. Treat a genuine keyed-turn transcript assertion as terminal across empty-error recovery, model fallback, and subagent completion delivery. Record one permanent failure with the error instead of scheduling another announce. Testbox proof reduces flattened-error model attempts from 12 to 1 and thrown-error attempts from 3 to 1. All 104 tests in the final changed files passed, along with 416 earlier focused tests, the candidate runtime build, and the full changed-file checks. Independent review found no actionable issues.
* refactor(ai): share Mistral text delta appends * Merge main to incorporate the upstream update type fix * commit 'dda1f68bfa102cb804392c0e7cc22c0566a0944a': (68 commits) fix(subagents): stop completion transcript retry loops (openclaw#157571) perf(sessions): remove duplicate foreground history reference scans (openclaw#157572) improve(typesafe): defer startup work until the first decision (openclaw#157380) fix(update): restore npm-pack helper typechecking (openclaw#157659) fix(packaging): avoid heap exhaustion on large bundles (openclaw#157471) refactor(infra): share process error handler registries (openclaw#157632) chore(ui): refresh control ui locales (openclaw#157573) fix(gateway): release remote Skills subscriptions when shutdown drains (openclaw#157592) perf(plugins): reuse declared tool membership during resolution (openclaw#156205) fix(ui): pasted text previews fail before sending (openclaw#157390) fix(agents): wait for database resources during deletion (openclaw#157631) improve: move operator profile database reads off the Gateway thread (openclaw#155800) fix: explain rejected settings without losing edits (openclaw#157549) fix: keep Gateway responsive while recording trajectory events (openclaw#157598) fix(auth): show SIWC email and selected model account identity (openclaw#157629) docs: explain Codex app approval precedence (openclaw#155089) refactor(wizard): share select prompt requests (openclaw#157607) fix(ui): omit empty sections from conversation Markdown exports (openclaw#157590) fix(doctor): explain update lint supervisor refusals (openclaw#156547) fix(ui): GitHub folder links lose repository context (openclaw#157619) ... Co-authored-by: Vincent Koc <[email protected]>
* refactor(ui): share slash-command failure results * Merge main to incorporate the upstream update type fix * commit '0484d7a3ecf52589b0d3d98741e58e5f6b5bf661': (68 commits) fix(subagents): stop completion transcript retry loops (#157571) perf(sessions): remove duplicate foreground history reference scans (#157572) improve(typesafe): defer startup work until the first decision (#157380) fix(update): restore npm-pack helper typechecking (#157659) fix(packaging): avoid heap exhaustion on large bundles (#157471) refactor(infra): share process error handler registries (#157632) chore(ui): refresh control ui locales (#157573) fix(gateway): release remote Skills subscriptions when shutdown drains (#157592) perf(plugins): reuse declared tool membership during resolution (#156205) fix(ui): pasted text previews fail before sending (#157390) fix(agents): wait for database resources during deletion (#157631) improve: move operator profile database reads off the Gateway thread (#155800) fix: explain rejected settings without losing edits (#157549) fix: keep Gateway responsive while recording trajectory events (#157598) fix(auth): show SIWC email and selected model account identity (#157629) docs: explain Codex app approval precedence (#155089) refactor(wizard): share select prompt requests (#157607) fix(ui): omit empty sections from conversation Markdown exports (#157590) fix(doctor): explain update lint supervisor refusals (#156547) fix(ui): GitHub folder links lose repository context (#157619) ... * Merge frozen main to include the question fixture authority fix * commit '229ab8a1fe957d3d4822309a39ddf9c7ec616395': (25 commits) test(ui): capture live operator authority in guest question fixture refactor(agents): deslop runners, harness and recovery (#157294) fix(auth): preserve Copilot tenant credentials during Doctor repair (#139131) refactor(msteams): share stored service URL validation (#157706) fix(codex): honor configured tool PATH in native commands (#157290) refactor(msteams): share approval kind labels (#157705) fix(sessions): keep session results current during cold reads (#156121) fix(testing): capture bounded upgrade integrity diagnostics (#157535) refactor(i18n): reuse native branch candidate extraction (#157636) fix(update): preserve recovery files after ownership refusal (#148890) fix(test): prevent late announcements from contaminating registry tests (#157681) fix(e2e): scan full onboarding logs for prompts (#157624) refactor(session-tools): derive contracts from schemas (#156365) refactor(channels): derive config contracts from schemas (#156367) perf(test): reuse MCP archives and batch worker fixture copies (#157689) refactor: reuse prepared fixtures in slow core tests (#157685) refactor(codex): reuse marketplace reference selection (#157621) chore(ui): refresh control ui locales (#157710) docs(gateway): show how we build OpenClaw on Team (#157675) refactor: verify IRC surrogate chunking over loopback (#157580) ... * chore: merge frozen main prerequisite repairs Co-authored-by: Vincent Koc <[email protected]>
Backport #157571: 0484d7a Adapted backport #150702: 6b5fb4b Backport #157958: 3802abe Backport #158259: 847863a Backport #156858: a5f1d09 Keep completion carriers within current-turn traversal and stop terminal transcript assertion retries. Preserve delegated restart provenance and owed completion custody; unknown provenance cannot inherit human evidence. Never let a queued, unstarted timeout end a different active turn. Reuse warm device identity and reacquire complete admission after observed rotation. Move the unchanged synchronous abort event into its existing lifecycle owner to satisfy the frozen line budget without weakening tests or guards. Source proof, recovery correction and owner-extraction checks are retained at their exact trees. Independent findings are resolved and composition preserves all 32 postimages; frozen ratchets and Madge pass. The two embedded-fallback attempt-count E2E cases remain unexecuted because canonical runtime preparation refused ownership; no guard was bypassed. Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: Jason (Json) <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vyctorbrzezowski <[email protected]> Co-authored-by: steipete <[email protected]> Co-authored-by: jalehman <[email protected]>
* refactor(ui): share slash-command failure results * Merge main to incorporate the upstream update type fix * commit 'dda1f68bfa102cb804392c0e7cc22c0566a0944a': (68 commits) fix(subagents): stop completion transcript retry loops (openclaw#157571) perf(sessions): remove duplicate foreground history reference scans (openclaw#157572) improve(typesafe): defer startup work until the first decision (openclaw#157380) fix(update): restore npm-pack helper typechecking (openclaw#157659) fix(packaging): avoid heap exhaustion on large bundles (openclaw#157471) refactor(infra): share process error handler registries (openclaw#157632) chore(ui): refresh control ui locales (openclaw#157573) fix(gateway): release remote Skills subscriptions when shutdown drains (openclaw#157592) perf(plugins): reuse declared tool membership during resolution (openclaw#156205) fix(ui): pasted text previews fail before sending (openclaw#157390) fix(agents): wait for database resources during deletion (openclaw#157631) improve: move operator profile database reads off the Gateway thread (openclaw#155800) fix: explain rejected settings without losing edits (openclaw#157549) fix: keep Gateway responsive while recording trajectory events (openclaw#157598) fix(auth): show SIWC email and selected model account identity (openclaw#157629) docs: explain Codex app approval precedence (openclaw#155089) refactor(wizard): share select prompt requests (openclaw#157607) fix(ui): omit empty sections from conversation Markdown exports (openclaw#157590) fix(doctor): explain update lint supervisor refusals (openclaw#156547) fix(ui): GitHub folder links lose repository context (openclaw#157619) ... * Merge frozen main to include the question fixture authority fix * commit 'dc64cc3a3a3cf38fff1e44c1d7af42a32929d7e4': (25 commits) test(ui): capture live operator authority in guest question fixture refactor(agents): deslop runners, harness and recovery (openclaw#157294) fix(auth): preserve Copilot tenant credentials during Doctor repair (openclaw#139131) refactor(msteams): share stored service URL validation (openclaw#157706) fix(codex): honor configured tool PATH in native commands (openclaw#157290) refactor(msteams): share approval kind labels (openclaw#157705) fix(sessions): keep session results current during cold reads (openclaw#156121) fix(testing): capture bounded upgrade integrity diagnostics (openclaw#157535) refactor(i18n): reuse native branch candidate extraction (openclaw#157636) fix(update): preserve recovery files after ownership refusal (openclaw#148890) fix(test): prevent late announcements from contaminating registry tests (openclaw#157681) fix(e2e): scan full onboarding logs for prompts (openclaw#157624) refactor(session-tools): derive contracts from schemas (openclaw#156365) refactor(channels): derive config contracts from schemas (openclaw#156367) perf(test): reuse MCP archives and batch worker fixture copies (openclaw#157689) refactor: reuse prepared fixtures in slow core tests (openclaw#157685) refactor(codex): reuse marketplace reference selection (openclaw#157621) chore(ui): refresh control ui locales (openclaw#157710) docs(gateway): show how we build OpenClaw on Team (openclaw#157675) refactor: verify IRC surrogate chunking over loopback (openclaw#157580) ... * chore: merge frozen main prerequisite repairs Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Fixes subagent completion announcements failing with
Session transcript keyed user is outside the current turnafter runtime context and compaction, then spending repeated model calls on the same local persistence error.User Impact
Completion inputs retain their own current turn. A genuine closed-turn rejection records one permanent completion failure with its error, without empty-error retries, model fallback, or another scheduled delivery attempt. No configuration or storage migration is required.
Why This Change Was Made
Replay preparation already walked past
openclaw.runtime-contextcarriers, but keyed-user adoption stopped at the carrier ID and compared it with the keyed input ID. Move that rule into the shared current-turn resolver while preserving completed-assistant and newer-user boundaries. Classify the exact transcript assertion across the existing flattened error surfaces and reuse the completion owner's permanent-failure disposition.Production growth is 29 net lines. Test-only mock extraction keeps the existing fallback suite below the line cap; all existing assertions remain.
Evidence
Failed-announce model attempts: 12 → 1 for the flattened assistant error, and 3 → 1 for a thrown assertion, measured through the actual embedded-runner/fallback orchestration with mocked model attempts. The old flattened path spent four attempts on each of three candidates. Valid carrier/compaction replay now succeeds, while closed-turn collision coverage continues to pass. Completion failure is recorded once with no requeue.
All remote runs used Blacksmith Testbox (
blacksmith-testbox, profileopenclaw-check), leasetbx_01m3ae75ntmatk3e09h0fcd7jv, runner, starting froma0905dfe5c17plus this patch. No heavy validation ran locally.node scripts/run-vitest.mjsfor user idempotencypnpm install --frozen-lockfileon the lease.node scripts/run-vitest.mjs src/agents/model-fallback.run-embedded.e2e.test.ts --maxWorkers=1 -t 'transcript turn assertion'node scripts/check-changed.mjsnode scripts/check-changed.mjs --base HEADFinal
pnpm test <file> --maxWorkers=1 --reporter=defaultcosts:src/agents/sessions/session-manager.user-idempotency.test.tssubagents/announce/subagent-announce.requester-settle-wake.test.tssubagents/announce/subagent-announce-direct-delivery.test.tsmodel-fallback.run-embedded.e2e.test.tsThe last command includes the required 9m26s candidate runtime rebuild; Vitest itself took 20.23s. The integration suite exercises retry, fallback, profile health, and suspension through their real orchestration owners; a classifier-only test cannot prove the number of model attempts. Peak RSS for that build/test command was 14,630,276 KiB. The first timed file includes a compiler-cache rebuild. Existing broad focused proof was reused; only changed test organization and the required per-file cost measurements were rerun.
Independent Codex review found no actionable P0–P2 issues, including the final test extraction. Hosted
security-fastpassed in 79s, and OpenGrep plus the dependency/security-sensitive reviews passed. The CI gate deliberately deferred all test jobs while Full Release Validation 36055733728 holds hosted-runner priority. Per-test CI timings are therefore unavailable. The release owner's restore operation reruns deferred CI after validation seals; this lane does not change that global control. Squash auto-merge is enabled for the reviewed head.This is synthetic SQLite and mocked-provider boundary proof. No production Gateway was changed or restarted; live traffic savings remain unmeasured after deployment.