Skip to content

fix(codex): distinguish client acquisition timeout stages - #163156

Merged
vincentkoc merged 1 commit into
mainfrom
fix/codex-acquisition-diagnostics-20261002
Oct 2, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/codex-acquisition-diagnostics-20261002

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes: Codex acquisition timeouts report only acquire-client, hiding whether the last observed boundary was context preparation, shared startup, initialization, catalog observation, runtime binding, or authentication handoff.

User Impact

Operators get bounded diagnostic context for acquisition timeouts. This does not fix an underlying timeout or change timeout budgets, retries, authentication, client pooling, cancellation, or authority checks.

Why This Change Was Made

Forward observations from the existing acquisition owner into the existing scope-timeout warning. Distinguish newly created startup, joining startup, and ready-cache reuse. Joined callers receive the current boundary and later observations, with exception-isolated callbacks removed on abort or completion.

Keep the last boundary before cleanup and the last observed started-client identity separate from the acquired-client identity. These are diagnostic observations, not proof that a particular wait is still active or that a process is owned. No credentials, paths, pool keys, request payloads, or process identifiers are added.

Evidence

  • Both affected native test files passed: 165/165 tests in 25.38s. Subsequent fixture-only corrections passed their exact runtime-binding and nested-cleanup cases; the final runtime-binding recheck took 37.35s with cold compilation.
  • With frozen baseline production code and the new regression cases, 11 diagnostic assertions failed while the existing coarse-diagnostic control passed.
  • Real shared-owner regressions cover each held acquisition boundary, joined startup, ready-cache reuse, observer exceptions, cancellation, stale attempt callbacks, and nested deadline cleanup before the outer timeout.
  • Production and test typechecks, typed lint, formatting/size guards, all three unused-export scans, and the remaining native structural checks passed.
  • The initial changed-check run stopped at the inherited compatibility-date gate, reproduced on the clean baseline. Integrating the landed prerequisite fix(ci): keep unresolved compatibility removals in the review queue #163127 cleared that exact gate without changing this diagnostic patch or weakening policy. Passed checks were retained and the unrun suffix completed separately; the original failed invocation is not claimed as a passing monolithic run.
  • Scoped independent review found no remaining actionable issue. No live timeout recovery or deployment is claimed; hosted exact-head CI remains pending.

Record diagnostic-only acquisition boundaries and shared startup provenance without changing client timing, cancellation, authentication, or pool ownership. Preserve the last blocked boundary through cleanup and keep started-client observations separate from acquired identities.
@vincentkoc vincentkoc self-assigned this Oct 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 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.

@vincentkoc
vincentkoc marked this pull request as ready for review October 2, 2026 01:39
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 9:45 PM ET / October 2, 2026, 01:45 UTC.

ClawSweeper review

What this changes

Adds bounded acquisition-stage observations to Codex timeout warnings, including shared startup provenance and the boundary preceding cleanup.

Merge readiness

✅ Ready for maintainer review

Keep open: current main lacks these acquisition-stage diagnostics, and the review found no actionable defect introduced by the patch.

Priority: P3
Reviewed head: e4a13690623244dc0699d8b13f20aa13810b635e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused diagnostic improvement with meaningful regression coverage and no blocking source finding; reported test results were not independently executed.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored PR is exempt from external-contributor live proof. Inspected tests exercise the acquisition owner with mocked dependencies and transport; no live timeout or recovery is claimed, and no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR is exempt from external-contributor live proof. Inspected tests exercise the acquisition owner with mocked dependencies and transport; no live timeout or recovery is claimed, and no stored-data contract changes.
Evidence reviewed 10 items Introduced patch and merge ownership: Reviewed the pinned merge-base-to-head delta. The verified test merge records main followed by the exact PR head as parents; its comparison with main contains the same diagnostic changes, without unrelated base-branch removals.
Still useful on current main: Current main records the coarse acquisition phase but has no acquisition-boundary, startup-provenance, or started-client observation fields. The affected production files have no changes between the pinned merge base and fetched main. The diagnostic module is also absent from the supplied latest release tag.
Observer ownership and cleanup: Acquisition observations are exception-isolated, replay the shared entry's current boundary, and detach through the existing abort/completion cleanup. Attempt-local callbacks reject stale observations; repeated cleanup preserves the preceding boundary. Existing lease counters, authority predicates, timeout budgets, and authentication decisions remain intact.
Findings None None.
Security None None.

How this fits together

The Codex plugin acquires an app-server client before sending agent and control requests. Its acquisition owner now supplies progress observations to the existing timeout logger so operators can locate stalled startup.

flowchart TD
  A[Agent or control request] --> B[Prepare client context]
  B --> C[Select shared or isolated client]
  C --> D[Initialize and prepare runtime]
  D --> E[Authenticate and acquire client]
  B --> F[Acquisition observations]
  C --> F
  D --> F
  E --> F
  F --> G[Timeout warning]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +143, Tests +280. Total +423 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 4 176 33 +143
Tests 3 289 9 +280
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 465 42 +423

Review metrics

Metric Value Why it matters
Production versus regression coverage production +143 net lines; tests and test support +280 net lines Production growth supports bounded observations and observer lifecycle handling; regression coverage exercises the diagnostic boundaries.

Technical review

Best possible solution:

Keep acquisition observations within the existing client owner and timeout logger, with bounded metadata and unchanged runtime decisions.

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

Not applicable as a diagnostic refinement; source confirms the coarse current-main warning, and inspected fixtures provide deterministic acquisition-boundary scenarios.

Is this the best way to solve the issue?

Yes. Forwarding observations from the existing acquisition owner avoids a competing lifecycle tracker and preserves runtime policy.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This improves operator diagnostics without repairing timeout recovery or changing execution behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored PR is exempt from external-contributor live proof. Inspected tests exercise the acquisition owner with mocked dependencies and transport; no live timeout or recovery is claimed, and no stored-data contract changes.

Label justifications:

  • P3: This improves operator diagnostics without repairing timeout recovery or changing execution behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored PR is exempt from external-contributor live proof. Inspected tests exercise the acquisition owner with mocked dependencies and transport; no live timeout or recovery is claimed, and no stored-data contract changes.

Evidence

What I checked:

  • Introduced patch and merge ownership: Reviewed the pinned merge-base-to-head delta. The verified test merge records main followed by the exact PR head as parents; its comparison with main contains the same diagnostic changes, without unrelated base-branch removals. (e4a136906232)
  • Still useful on current main: Current main records the coarse acquisition phase but has no acquisition-boundary, startup-provenance, or started-client observation fields. The affected production files have no changes between the pinned merge base and fetched main. The diagnostic module is also absent from the supplied latest release tag. (extensions/codex/src/app-server/request-diagnostics.ts:23, d4b98b3a5101)
  • Observer ownership and cleanup: Acquisition observations are exception-isolated, replay the shared entry's current boundary, and detach through the existing abort/completion cleanup. Attempt-local callbacks reject stale observations; repeated cleanup preserves the preceding boundary. Existing lease counters, authority predicates, timeout budgets, and authentication decisions remain intact. (extensions/codex/src/app-server/shared-client-lifecycle.ts:27, e4a136906232)
  • Regression coverage and execution limits: Inspected deterministic held-boundary cases through the production acquisition owner, plus joined startup, cache reuse, observer exceptions, cancellation, nested cleanup, and stale-attempt tests. Transport and several dependencies are mocked. The captured body reports 165 passing tests and 11 baseline diagnostic failures; this reviewer did not execute tests or claim live deployment proof. (extensions/codex/src/app-server/shared-client-acquisition-diagnostics.test-support.ts:39, e4a136906232)
  • Dependency inspection signal: The changed acquisition owner brackets client.initialize(), and the harness documentation identifies Codex app-server as the native execution owner. This establishes the Codex dependency-contract signal; sibling source was personally inspected. (extensions/codex/src/app-server/shared-client.ts:1038, e4a136906232)
  • Native initialization boundary: Inspected initialize processing and the rejection of ordinary requests before session initialization. GitHub verified that the sibling checkout SHA belongs to openai/codex. The patch observes OpenClaw's existing handshake boundary without changing the native protocol. (codex-rs/app-server/src/message_processor.rs:937, 8e68a98ef03c)

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@vincentkoc
vincentkoc merged commit c1683a6 into main Oct 2, 2026
181 checks passed
@vincentkoc
vincentkoc deleted the fix/codex-acquisition-diagnostics-20261002 branch October 2, 2026 01:51
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 2, 2026
…63156)

Record diagnostic-only acquisition boundaries and shared startup provenance without changing client timing, cancellation, authentication, or pool ownership. Preserve the last blocked boundary through cleanup and keep started-client observations separate from acquired identities.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: codex P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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