Skip to content

fix(codex): forward-port 2026.10.10 thread ownership and cleanup fixes - #191830

Merged
RomneyDa merged 9 commits into
mainfrom
fix/forward-port-2026.10.10
Nov 5, 2026
Merged

RomneyDa merged 9 commits into
mainfrom
fix/forward-port-2026.10.10

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Problem

The 2026.10.10 stable release fixed Codex thread ownership and native follow-up failures that were missing from main. A freshly forked child could fail its first turn with an active-writer error; a resumed thread could race its previous owner; a later parent turn could no longer resolve a native child by task name. Short shutdown budgets also converted healthy loaded cleanup into failure.

Solution

Keep this existing PR for the Codex portion of the original forward-port batch. All sibling splits target main independently; this is not a stack.

  • Unload a canonical fork before its child turn connection resumes it.
  • Wait for a live previous owner's unload before another client resumes the same thread.
  • Preserve bounded loaded one-shot cleanup and match Codex's 10-second unload confirmation window.
  • Retain canonical native child paths across parent registrations and name usable agent IDs for unidentified targets.

Preserves the six original Codex forward-port commits and release references. Fresh local review also caught a defect in the inherited one-shot change: shared retirement started shutdown before its longer grace options were applied. The repair now applies those options at the first close; the operation lives with the existing shared-client lifecycle owner. A deterministic fake-clock regression fails before this repair because containment starts before the delayed clean exit. The exact scoped test-line allocation is 295 lines for fork handoff, native targeting, previous-owner handoff, and shutdown-budget regressions. Simplification review kept these ownership fixes together; unrelated Matrix, process, storage, cron, config, startup, and file-transfer changes moved out.

Evidence

  • git diff --check and targeted oxfmt checks passed.
  • Red proof for shared cleanup: node scripts/run-vitest.mjs extensions/codex/src/app-server/client-shutdown.test.ts --maxWorkers=1 — the new grace regression failed as expected; 3 existing tests passed.
  • Fresh targeted lint and extension typecheck were attempted after a successful isolated frozen install. Both are blocked by an unchanged main error: src/agents/mcp-metadata.ts:5 imports McpCatalogTool from a module that does not export it, with consequent optional-property errors in agent-bundle-mcp-materialize.ts. All three source files are byte-identical to base 3400782.
  • Fresh cleanup validation: shared-client/client-shutdown 162/162 and one-shot cleanup 11/11 passed. Final local ClawSweeper reviewed 34007820fa2c..f00f4d2e7b58: no actionable correctness or security findings; prior shutdown-grace finding resolved.
  • Fresh focused validation: all 336 tests passed across 6 files / 3 Vitest shards (814.57s including worker compilation): native-subagent inventory, native thread handoff, thread binding, run-attempt, canonical-descendant integration, and Gateway Codex failure recovery.

Prior combined-PR evidence: canonical-descendant 65/65; native-subagent 141; binding 100/100; codex-failure-recovery 7/7; handoff.native 2/2. The original regressions were confirmed failing without the corresponding changes, except the one-shot cleanup budget (the delayed-exit fixture was flaky and nondiscriminating, so no such test is claimed).

Codex shutdown contract checked against sibling source commit 092d3acd6bec3e3a14bdc7e7a2810ab628ab759d; the per-thread unload-delay override was also verified against pinned rust-v0.164.0 (6aaac694803004a63c6f393d153c96d22521a6b9): codex-rs/app-server/src/request_processors/thread_lifecycle.rs waits for shutdown and only emits thread/closed after cleanup, reporting shutdown as slow after 10 seconds.

Known limitation retained from the original PR: the retired native child-path index is not pruned. Broad CI and live authenticated Codex/MCP qualification are not claimed by local fixture tests.

Independent forward-port PRs

All eight target main directly, not one another.

Scope PR
Codex (this PR) #191830
Storage #192378
Cron #192379
Plugin config #192380
Gateway startup #192383
Matrix #192385
Process cleanup #192386
Goal test correction #192387

Matrix retains its existing dependency-patch approval requirement before landing.

Original release audit: changes intentionally not ported

Not ported

Release commit Reason
2e588c7 (supervisor stdin) Already on main: 1840456 (#187803)
2023da6 (hook-free Linux owners) Already on main: 7a9a6a9 (#182306), using runtimeHasSourceLoader()
6d231f7 (#188170) Already on main: 4dc8e71
c8dd2ee (#188842) Already on main: dc4b96e (#175656)
914d1ae (portal tool) Already on main: b326dc0 (#175309)
943b9bc (package declarations) Already on main: f41d6b8 / ad9b7ae
cc76b58 (+ locale catalogs) Already on main (core-load.ts:8); no string changes, so no catalog regeneration needed
03c1bd6 (prompt observer tools) Obsolete: main's observer never reads tools
890fd2d Reverted on the release branch (ecda656) and replaced by cc9ab3d (ported)
0c755e0 (claude-cli #186684) Not needed on main: file tools route through the OpenClaw loopback on every turn. The adapted regression test passes on unmodified main.
58b5fd6 (workboard agent_end reread) Builds on release-only aad30d2 / 79c6be8. Main may still have the "running, hasActiveRun:false" stuck-card race. Follow-up: port those together.
0da2084 (models.list reread after superseded generation) Dropped after PR CI: main deliberately reports retryable UNAVAILABLE, and its authority tests (models-list-result.plugin-runtime, models-list-result.configured-static, model-account-catalog-authority.integration unlink-during-auth/dns) require a request superseded by an account unlink not to reread. A blind reread breaks that, so a main-owned fix must distinguish publication supersession from authority loss. Follow-up.
ce02f49 / c4169eb (deps) Main is already on newer versions (undici 8.12.3)

Additionally omitted during this split: file-transfer d562323353, already repaired on main by #174252 (515b3c409583). Both existing cold and legacy-cache concurrent-import regressions passed on unchanged main sources. Redundant draft #192382 was closed.

Exact-head CI attribution and repair

The failed check-test-types job on f00f4d2e7b58 included a related error at client-shutdown.test.ts:68: unexpected containment is not a valid ProcessInspectionError reason. Commit d46c932c2f16 corrects it to unavailable, without weakening the assertion that containment must not run. Fresh shutdown tests passed 4/4. The repository extension-test typecheck no longer reports this error; remaining errors are the inherited MCP failures below. Targeted formatting and diff checks passed.

All failed job logs were individually inspected. The three MCP files (mcp-metadata.ts, agent-bundle-mcp-types.ts, agent-bundle-mcp-materialize.ts) are byte-identical to base 34007820fa2c. Missing McpCatalogTool export/optional UI metadata errors therefore predate this split. The test-budget job exceeds its adjusted ceiling by the same inherited 47 lines: 6,445,222 versus 6,445,175, with the exact +295 regression allocation.

Failed check on prior head Attribution
checks-fast-baseline-ratchets Inherited 47-line budget deficit
check-additional-extension-package-boundary Inherited MCP declaration/type errors
check-prod-types Inherited MCP declaration/type errors
check-test-types Related invalid error reason fixed in d46c932c2f16; remaining MCP errors inherited
check-test-types-core-1 Inherited MCP declaration/type errors
check-test-types-core-2 Inherited MCP declaration/type errors
check-test-types-core-3 Inherited MCP declaration/type errors
check-test-types-core-4 Inherited MCP declaration/type errors
check-test-types-core-5 Inherited MCP declaration/type errors
openclaw/ci-gate Aggregate failed/downstream-skipped prerequisites above
openclaw/ci-gate Aggregate failed/downstream-skipped prerequisites above

New-head CI is pending, not claimed green. No merge conflicts were reported against current main.

Rebase onto current main

Rebased onto a1f99240c8367a0e012b401bed71831a3cc65026, including merged Goal-test correction #192387. New candidate: 888fb2bcb77fc9912135f274cb970e14526c5fe4. This PR still targets main independently.

Verified the complete rebased tree equals the previous PR patch integrated with that main snapshot. No new behavior was added during rebase. Prior test and CI attribution sections remain evidence for their named old revisions; fresh CI on this head is pending, not claimed green.

@clawsweeper

clawsweeper Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Dependency graph guard cleared

This PR no longer has dependency changes awaiting review. A future dependency graph change from an external contributor requires a maintainer's /allow-dependencies-change comment after the guard notice identifies that revision.

  • Current SHA: 888fb2bcb77fc9912135f274cb970e14526c5fe4

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 3, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 3, 2026
@clawsweeper

clawsweeper Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR repairs Codex thread handoffs, native follow-up targeting, and graceful cleanup budgets.

Example: A later parent turn sends followup_task to worker, previously registered as /root/worker.

  • Before: The retired registration loses the name mapping, so targeting fails.
  • After: The retained mapping resolves the child, subject to current source and native lineage checks.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A useful, focused repair with meaningful owner-boundary coverage; supplied proof remains harness-based and exact-head CI is unresolved.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; supplied evidence exercises production owners through synthetic and real-native test harnesses, and explicitly claims no live authenticated qualification.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Codex conversations can fail during fork or resume, lose usable child task names between turns, and report healthy cleanup as failure.
Reason: These are concrete workflow failures, and the maintainer-authored PR already establishes direction for the focused repair.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it contains useful Codex repairs still missing from main, with no definite introduced defect found.

Priority: P1
Reviewed head: f00f4d2e7b585a7a179d8ce9d787b4119ad8bff7

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence does not demonstrate these changes through a shipped CLI or Gateway using a live authenticated Codex setup.
Agent review details

How this fits together

The Codex plugin translates Gateway turns and collaboration requests into native app-server operations while owning shared clients, thread subscriptions, and cleanup.

flowchart LR
  A[Gateway turn] --> B[Codex plugin]
  B --> C[Shared client lifecycle]
  B --> D[Native child admission]
  C --> E[Codex app server]
  D --> E
  E --> F[Thread writer and cleanup]
Loading

Technical review

Best possible solution:

Land the focused repairs through the existing Codex lifecycle owners once the failed checks are resolved or supported by an accepted failure attribution.

Do we have a high-confidence way to reproduce the issue?

Current-main source and the independently inspected native writer contract establish the failure paths; the PR supplies discriminating regressions, but this read-only review ran no reproduction.

Is this the best way to solve the issue?

The change repairs the existing fork, admission, and shared-client owners without adding a parallel execution path; the simplification pass found no definite unnecessary machinery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 44eaed3d95d7.

Provenance checked

  • Canonical fork ownership keeps the original intent (f5f44fa: Native forks preserve exact history and independently admit child execution; the added unload handoff retains that contract.)
  • Previous physical thread owner keeps the original intent (a09a59e: Exact thread closure permits continuation without waiting for unrelated sibling leases; this PR extends closure waiting to a live previous owner.)
  • Native follow-up targeting keeps the original intent (17d2faf: Native input must retain current model-source and tree authority; task-name retention changes lookup while preserving admission checks.)
  • Unload confirmation budget changes intended behavior with a stated reason (90a1481: The earlier repair deliberately bounded exact-close confirmation at two seconds; this PR explains the increase using native shutdown behavior and observed MCP teardown.)
  • One-shot shutdown keeps the original intent (8670959: Graceful native shutdown avoids converting successful agent exec work into cleanup failure while retaining uncertain-cleanup rejection.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Introduced changes and current main: Reviewed the pinned merge-base-to-head diff. Current main retains the old behavior in the affected production owners; base-only catalog and CLI changes are outside this PR's introduced edits. (extensions/codex/src/app-server/canonical-session-fork.ts:343, f00f4d2e7b58)
  • Personally inspected native contract: The patch sends native thread lifecycle requests and tests against Codex, making its implementation authoritative here. The pinned sibling source confirms exclusive loaded-thread writer ownership and thread/closed publication after shutdown; GitHub verified this dependency commit. (codex-rs/app-server/src/request_processors/thread_lifecycle.rs:559, 6aaac6948030)
  • Distinct regression coverage: Added coverage exercises separate-connection fork handoff, live native previous-owner handoff, later-registration task-name resolution, delayed unload, and initial shared-shutdown grace. The body reports focused passing runs and counterfactual failures; no tests were executed during this review. (extensions/codex/src/app-server/thread-lifecycle.handoff.native.test.ts:213, f00f4d2e7b58)
  • Current admission checks remain: Retained task paths locate candidate children; admission still captures the current sender source, reads native metadata, checks receiver lineage and configuration, and revalidates before admission. (extensions/codex/src/app-server/native-subagent-model-input.ts:232, f00f4d2e7b58)
  • Maintainer direction and accepted limitation: The maintainer-authored body explicitly chooses this coherent Codex scope and records that retired child paths remain unpruned. That recorded tradeoff is not reopened as a new blocker. (f00f4d2e7b58)
  • Exact-head CI remains unresolved: Package-boundary, production/test type, and baseline-ratchet checks failed. Available annotations identify failed commands without their underlying diagnostics. Job logs redirect to a blocked Azure host, so these failures cannot be attributed to this diff from the available evidence. (f00f4d2e7b58)

Likely related people:

  • Peter Steinberger: Raw commit f5f44fa adds extensions/codex/src/app-server/canonical-session-fork.ts:286 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f5f44faeca4e; files: extensions/codex/src/app-server/canonical-session-fork.ts)
  • Dallin Romney: Raw commit 92eba62 adds extensions/codex/src/app-server/thread-lifecycle-warm.ts:159 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 92eba62bdfd7; files: extensions/codex/src/app-server/thread-lifecycle-warm.ts)
  • Jacqueline Henriksen: Raw commit b4d60fa adds extensions/codex/src/app-server/thread-lifecycle-warm.ts:150 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b4d60fa5edfc; files: extensions/codex/src/app-server/thread-lifecycle-warm.ts)

PR surface

Source +160, Tests +295, Other +2. Total +457 across 20 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 9 203 43 +160
Tests 10 307 12 +295
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 20 512 55 +457

Review metrics

Metric Value Why it matters
Production versus regression coverage Production +203/-43; tests/support +307/-12 Growth covers distinct ownership and cleanup failures, including native transport handoff; the separate 295-line allocation matches net regression coverage.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P1: The affected paths can reject first child turns, block native follow-ups, or report successful one-shot work as failed.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Have the CI owner classify the failed exact-head checks using their full diagnostics.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-03T10:55:32.351Z sha 3c7cde0 :: needs real behavior proof before merge. :: [P2] Preserve personal-account invalidation when retrying catalog reads

Reviewed November 4, 2026, 5:13 PM ET / 22:13 UTC (Revision 2).

@clawsweeper clawsweeper Bot removed the status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. label Nov 4, 2026
@RomneyDa

RomneyDa commented Nov 4, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 4, 2026
A clean Codex shutdown can spend several seconds flushing its state
database after stdin closes under load. Give one-shot and caller-owned
isolated clients a bounded 5s graceful window (6s exit budget) instead of
force-killing after 250ms, so a normal exit is not converted into a
forced, uncertain cleanup receipt.

Includes the shared close-options constant introduced by 2eaf9aa on
the release branch, which main lacked.

Forward-port of 46db9eb from release/2026.10.10.
Codex holds a per-home writer lock while a thread is loaded and keeps it
after unsubscribe until the idle unload delay. Canonical forks ran on the
catalog connection while child turns resume on the supervision turn
connection, so the first child turn failed with 'already has an active
writer'. Fork with a zero unload delay, release the catalog subscription
and wait for thread/closed before readiness. Model the writer lock in the
native fixture and prove the handoff on a separate turn connection.

Also covers a3778c8 and 5c47f59, whose retained-subscription
approach caa7ea6 reverted on the release branch.

Forward-port of caa7ea6 from release/2026.10.10.
Codex followup_task accepts a canonical task name. Each Gateway turn owns a
fresh parent registration, and pruning the previous registration dropped
its children's agent paths, so a later follow-up by name failed with
'native target lineage is not currently identified'. Treat a registered
non-child parent as /root and keep retired children's canonical paths per
native parent so the name resolves to the same child. The retired-path
index lives beside target resolution so the monitor does not grow.

Forward-port of b435b6f from release/2026.10.10.
gpt-5.6-luna runs Codex multi-agent v1, whose follow-up tools address
children only by agent ID (Codex agent/control/target.rs resolves IDs and
registered task paths). When a later turn names a child by nickname, the
refusal now lists this thread's known and earlier-registered child IDs so
the model can retry with the exact ID.

Forward-port of bbc4e29 from release/2026.10.10.
When a binding's thread is owned by another live app-server connection
(for example after /codex resume attached it on the command connection),
the handoff unsubscribed the old owner but only waited for closure when
that owner was retiring. Codex holds the per-home writer lock until the
thread unloads (rollout/src/writer_lock.rs), so the turn connection's
resume failed with 'already has an active writer' or rotated to a new
thread. Wait for the old owner's thread/closed, bounded, before resuming.

Forward-port of f9b8534 from release/2026.10.10.
…load

Codex emits thread/closed only after the unloaded thread's
shutdown_and_wait completes and reports shutdown as slow only after 10s
(app-server thread_lifecycle.rs, unload_thread_without_subscribers).
Live teardown of a thread with MCP servers measured about 1.98s, right at
OpenClaw's 2s confirmation budget, so reconfiguring resumes intermittently
failed with 'Codex did not confirm unloading its previous configuration'.
Use Codex's 10s window, kept module-private.

The Gateway physical-exit recovery cases retain the previous native thread
so it never confirms its unload; they now wait out the 10s window before
the exit gate (release test companion 8c275c6).

Forward-port of d19bd1d and 35fb02f from release/2026.10.10.
@RomneyDa
RomneyDa force-pushed the fix/forward-port-2026.10.10 branch from d46c932 to 888fb2b Compare November 5, 2026 01:48
@RomneyDa
RomneyDa merged commit 17b6ad4 into main Nov 5, 2026
132 checks passed
@RomneyDa
RomneyDa deleted the fix/forward-port-2026.10.10 branch November 5, 2026 02:39
RomneyDa added a commit that referenced this pull request Nov 5, 2026
Carry the final reviewed changes from #191830, #192378, #192379,
#192380, #192383, #192385, and #192386. Preserve #191838's existing
file-transfer import fix. Adapt Gateway readiness to the release owner
and include the narrow SQLite cold-admission prerequisite from #192586.

Do not carry #192387: its Goal expectation depends on main-only
Stop-to-paused behavior absent from this release.

Retain regression allocations without changing the shared baseline.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 5, 2026
openclaw#191830)

* fix(codex): preserve loaded one-shot cleanup

A clean Codex shutdown can spend several seconds flushing its state
database after stdin closes under load. Give one-shot and caller-owned
isolated clients a bounded 5s graceful window (6s exit budget) instead of
force-killing after 250ms, so a normal exit is not converted into a
forced, uncertain cleanup receipt.

Includes the shared close-options constant introduced by 2eaf9aa on
the release branch, which main lacked.

Forward-port of 46db9eb from release/2026.10.10.

* fix(codex): unload canonical forks before child turns resume them

Codex holds a per-home writer lock while a thread is loaded and keeps it
after unsubscribe until the idle unload delay. Canonical forks ran on the
catalog connection while child turns resume on the supervision turn
connection, so the first child turn failed with 'already has an active
writer'. Fork with a zero unload delay, release the catalog subscription
and wait for thread/closed before readiness. Model the writer lock in the
native fixture and prove the handoff on a separate turn connection.

Also covers a3778c8 and 5c47f59, whose retained-subscription
approach caa7ea6 reverted on the release branch.

Forward-port of caa7ea6 from release/2026.10.10.

* fix(codex): resolve native follow-ups by task name across parent turns

Codex followup_task accepts a canonical task name. Each Gateway turn owns a
fresh parent registration, and pruning the previous registration dropped
its children's agent paths, so a later follow-up by name failed with
'native target lineage is not currently identified'. Treat a registered
non-child parent as /root and keep retired children's canonical paths per
native parent so the name resolves to the same child. The retired-path
index lives beside target resolution so the monitor does not grow.

Forward-port of b435b6f from release/2026.10.10.

* fix(codex): name usable agent IDs when a native target is unidentified

gpt-5.6-luna runs Codex multi-agent v1, whose follow-up tools address
children only by agent ID (Codex agent/control/target.rs resolves IDs and
registered task paths). When a later turn names a child by nickname, the
refusal now lists this thread's known and earlier-registered child IDs so
the model can retry with the exact ID.

Forward-port of bbc4e29 from release/2026.10.10.

* fix(codex): wait for a live previous owner to unload before resuming

When a binding's thread is owned by another live app-server connection
(for example after /codex resume attached it on the command connection),
the handoff unsubscribed the old owner but only waited for closure when
that owner was retiring. Codex holds the per-home writer lock until the
thread unloads (rollout/src/writer_lock.rs), so the turn connection's
resume failed with 'already has an active writer' or rotated to a new
thread. Wait for the old owner's thread/closed, bounded, before resuming.

Forward-port of f9b8534 from release/2026.10.10.

* fix(codex): allow Codex's shutdown window when confirming a thread unload

Codex emits thread/closed only after the unloaded thread's
shutdown_and_wait completes and reports shutdown as slow only after 10s
(app-server thread_lifecycle.rs, unload_thread_without_subscribers).
Live teardown of a thread with MCP servers measured about 1.98s, right at
OpenClaw's 2s confirmation budget, so reconfiguring resumes intermittently
failed with 'Codex did not confirm unloading its previous configuration'.
Use Codex's 10s window, kept module-private.

The Gateway physical-exit recovery cases retain the previous native thread
so it never confirms its unload; they now wait out the 10s window before
the exit gate (release test companion 8c275c6).

Forward-port of d19bd1d and 35fb02f from release/2026.10.10.

* test(ci): allocate Codex forward-port regression coverage

* fix(codex): apply one-shot grace at initial shared shutdown

* test(codex): use valid process inspection failure reason
YuriyPopovDev added a commit to YuriyPopovDev/openclaw that referenced this pull request Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: codex gateway Gateway runtime P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant