Repository navigation
fix(codex): allow follow-up replies while background listeners run - #171963
Conversation
|
🦞👀 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 real behavior proof before merge. What this changesSeparates changing prompt-hook context from persistent Codex thread instructions. Example: A background callback listener remains active while hook context changes from “Synthetic first-turn recall” to “Synthetic second-turn recall.”
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this PR addresses a current Codex continuation bug at its producer while preserving background-work protection; no introduced code defect was found. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe shared prompt builder prepares plugin instructions; the Codex adapter sends stable policy to thread setup and changing context through the existing parent-only inference relay. flowchart TD
A[User follow-up] --> B[Shared prompt builder]
B --> C[Stable thread policy]
B --> D[Changing hook context]
C --> E[Codex thread lifecycle]
D --> F[Parent inference relay]
E --> F
F --> G[Model reply]
Technical reviewBest possible solution: Deliver changing hook context through the existing parent-local relay while retaining stable thread policy and background-work custody. Do we have a high-confidence way to reproduce the issue? Current main shows the complete changing-context, fingerprint-mismatch, and protected-release refusal path matching the official-release report; no target code was executed during this review. Is this the best way to solve the issue? The repair addresses the context producer and reuses the existing carrier without weakening lifecycle protection or changing other harnesses' merged instructions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 86380bba721a. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +21, Tests +182, Docs +12. Total +215 across 8 files. Added test files: 1. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 HistoryReviewed October 15, 2026, 5:10 AM ET / 09:10 UTC (Revision 3). |
|
@clawsweeper Thanks for the review. The remaining proof and owner-decision requirements are now explicit in the PR body. The existing negative control ran the final regression against incoming production and reproduced the exact For the SDK decision: both added fields are optional, and the existing complete merged All 18 focused cases, core/Codex typechecks, targeted type-aware lint, formatting, and independent scoped review were recorded in the PR evidence. This clarification does not request a merge or a waiver of the two remaining requirements. |
Keep volatile prompt-hook context after stable parent-local instructions, simplify the shared split result, and extend the continuation regression with prefix-order and genuine-policy-change refusal checks. Fixes openclaw#171954. Original fix by @Matuno in openclaw#171963. PR CI owns tests and typechecks; live proof intentionally skipped per maintainer policy. No thread lifecycle or claim-custody guard is bypassed. Co-authored-by: Matuno <[email protected]>
Use the existing leased wire harness instead of manually registering an unleased fake client as isolated. Real shared retirement preserves native background leases after a policy refusal; isolated fixture cleanup closes the client. Keep the refusal and listener-survival assertions unchanged. CI exposed the fixture mismatch after both follow-up replies and context assertions passed. No production code changed. PR CI remains the test gate.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…penclaw#171963) * fix(codex): keep hook context from blocking background follow-ups * fix(codex): preserve stable context during background follow-ups Keep volatile prompt-hook context after stable parent-local instructions, simplify the shared split result, and extend the continuation regression with prefix-order and genuine-policy-change refusal checks. Fixes openclaw#171954. Original fix by @Matuno in openclaw#171963. PR CI owns tests and typechecks; live proof intentionally skipped per maintainer policy. No thread lifecycle or claim-custody guard is bypassed. Co-authored-by: Matuno <[email protected]> * test(codex): retain shared listener custody in continuation fixture Use the existing leased wire harness instead of manually registering an unleased fake client as isolated. Real shared retirement preserves native background leases after a policy refusal; isolated fixture cleanup closes the client. Keep the refusal and listener-survival assertions unchanged. CI exposed the fixture mismatch after both follow-up replies and context assertions passed. No production code changed. PR CI remains the test gate. --------- Co-authored-by: Matuno <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
Fixes #171954
What Problem This Solves
Fixes follow-up messages failing with “claimed by active work” when a managed Codex conversation has a background listener and a prompt hook returns changing recall or time context.
User Impact
Users can continue the same conversation while the listener runs. Real policy and tool configuration changes retain the guarded reload path; a
systemPromptreplacement remains thread policy.Why This Change Was Made
The shared prompt builder previously mixed changing hook context into persistent developer instructions. That changed the thread configuration fingerprint, forcing a reload that correctly refused to release a thread protected by background work. The producer now separates policy from wrapped turn context. Codex uses its existing parent-only inference relay, with volatile hook context after stable parent context; other harnesses retain the complete merged instructions. Connections without the relay retain the existing native refreshable-instruction behavior.
The two optional result fields on the existing
agent-harness-runtimehelper are the minimum additive SDK contract needed to preserve the merged result while exposing both carriers. They are documented; no new export, subpath, configuration option, or protocol is introduced. The existing relay bounds the combined parent context to 256 KiB. Native children, memory requests, and compaction do not receive managed hook context.Original fix by @Matuno; maintainer cleanup simplifies split-result construction, preserves stable prefix order, extends the regression to check a genuine policy-change refusal, and reconciles the patch with the lifecycle fixes in #172287 and #172145.
Evidence
PR CI is the test and typecheck gate per maintainer policy. Live Gateway proof, Crabbox/Testbox leases, local tests/typechecks, and a new production-reverted negative control were intentionally skipped per that policy. The contributor's earlier synthetic test results are historical evidence, not verification of this updated head.
delivers fresh parent context on the same protected threadruns two production attempts with synthetic native notifications, receives both replies on the original protected thread, checks current context exactly once, stable prefix order, and child/compaction exclusion, then verifies that changedsystemPromptpolicy is refused without unsubscribing or sending a third turn. It uses no sleeps or polling.classifies restrictive globs before building system instructionsverifies preserved merged instructions, separated context, and policy replacement.oxfmtpassed on eight files. Coreoxlintpassed on six code files using trusted main tooling and all applicable rules; UI-only overrides were excluded because the shared install lacks their Solid lint package. No dependency installation was performed.git diff --checkpassed.b22a9b8effad4a8ec0315c27d755a976dddbb39c. Success: 48 jobs passed, includingopenclaw/ci-gate; 28 jobs were scope-skipped. Test bundles, production/test typechecks, lint, docs, prompt snapshots, security-fast, package-boundary checks, and baseline ratchets passed. There are no inherited failures to classify on this head. Full artifact-build and live/UI lanes were scope-skipped and are not claimed as proof.Source confirmation on main: hook context enters
developerInstructions, which feeds thread setup; warm configuration mismatch requests resume, andreleaseCodexBoundLiveThreadrefuses active background custody. The nearby landed lifecycle repairs retain that guard and do not fix the context producer.Codex source inspected read-only at
be2951ea34f0d295ed0becf97079f92fa5f6950e:codex-rs/app-server-protocol/src/protocol/v2/turn.rs:167-180exposes per-turn Responses metadata;codex-rs/app-server/src/request_processors/turn_processor.rs:625-658separates it from sticky thread settings.codex-rs/core/src/state/additional_context.rs:16-32turns native additional context into conversation input, andturn.rs:244-251gives collaboration-mode instructions policy semantics. The existing inference relay therefore preserves parent-only, nonpersistent delivery without reloading configuration.ClawSweeper review 6164233569 reported no code findings. Its live-proof request is superseded by the maintainer's PR-CI proof policy. The narrow documented SDK result addition is handled under this campaign's additive SDK exception; no separate approval is claimed. No human review findings were present.
Deferred-effect facts: hook text is the immutable snapshot prepared for this admitted turn; authority/lifetime, physical connection, thread/route identity, and live custody continue to be revalidated by the existing inference registration immediately before inference. Configuration, workspace paths, and limits retain their existing owners; this patch introduces no background task or new side-effect owner.
LOC against the merged main base: production +35/-14 (net +21), tests +181/-0, test routing +1/-0, docs +14/-2. The production-growth exception is necessary to preserve the existing merged SDK result and expose the separate carriers without duplicating hook execution; unrelated code was not deleted to fund it.