Skip to content

fix(codex): distinguish initialization timeout outcomes - #163230

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

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

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Codex initialization timeouts identify the acquisition stage but do not distinguish a local write failure, a pending native response, or a response followed by cleanup.

User Impact

Operators get bounded initialization observations in the existing timeout warning. This is diagnostic enablement only: it does not change deadlines, retries, authentication, client ownership, or request execution, and it does not claim to fix the underlying timeout.

Why This Change Was Made

Retain a copied scalar snapshot for the physical client that started initialization. Keep possible writes, stream callbacks, matching native responses, version validation, and client closure separate. Freeze the pre-close observation so nested timeout cleanup cannot overwrite the evidence available to the outer warning.

The diagnostic excludes request parameters, response bodies, stderr, credentials, and process paths. Existing cancellation and cleanup order remain unchanged.

Evidence

  • Actual transport/decoder tests cover pending and delayed writes, write failure, pre-write refusal, native success/error, version rejection, response-before-close, overload replacement, and stale-client isolation.
  • Existing focused run: 226 passing cases and one nested-cleanup regression found; the corrected real-owner case and related copy/close cases passed in targeted follow-ups. Affected writer/frame/initialize cases passed after the mechanical extraction.
  • Independent scoped review found no remaining issue. The original autoreview and the bounded follow-up review cover the final diagnostic and mechanical changes.
  • Native changed-file gates passed through the corrected failure surfaces and completed suffix, including extension production/test typechecks, lint, Doctor closure checks, dead-code exports, and import-cycle checks. Earlier line-cap, assertion-safety, unused-export, and lint failures were corrected at their exact surfaces; the original failed aggregate is not reported as green.
  • Test cost on the exact reviewed patch, Node 26.7.0, pnpm 12.5.1, and --maxWorkers=1: the new client-initialize-diagnostics.test.ts suite took 23.387 seconds end to end; the two changed shared-acquisition cases took 8.996 seconds end to end. Both commands exited 0. These serial measurements include native runner/compiler preparation and are not a benchmark or a repeat of the full focused suite.
  • Exact-head hosted CI completed successfully: CI run, gate publication. The completed ClawSweeper review found no correctness or security issue and requested the measured test-cost evidence recorded above.
  • No live deployment, successful heartbeat, production-auth reproduction, or causal recovery is claimed.

@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 03:49
@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 changes before merge. Reviewed October 1, 2026, 11:55 PM ET / October 2, 2026, 03:55 UTC.

ClawSweeper review

What this changes

The Codex plugin adds bounded initialization observations to timeout warnings, distinguishing write callbacks, native responses, version validation, and client cleanup.

Merge readiness

⛔ Needs changes before merge - 1 item remains

The PR adds useful diagnostic detail beyond current main, and no introduced correctness or security defect was found. The MEMBER-authored work should remain open.

Priority: P3
Reviewed head: 06f25235b76a8598f270c2a798ee8a0484d9a78d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused diagnostic improvement with meaningful boundary coverage and no supported blocking code finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-author exemption applies. Inspected tests exercise the production initialization and decoder paths with an in-memory transport, including nested cleanup; they are supplemental validation, not native-runtime proof. 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-author exemption applies. Inspected tests exercise the production initialization and decoder paths with an in-memory transport, including nested cleanup; they are supplemental validation, not native-runtime proof. No stored-data contract changes.
Evidence reviewed 9 items Introduced patch identity: Reviewed the pinned merge-base-to-head changes, separating them from unrelated base-branch drift. The assertion baseline change is shrink-only.
Diagnostic lifecycle: Initialization observations contain scalar states, copy snapshots on read, isolate replacement attempts, and freeze the observation before client closure. Request settlement and transport ownership remain with their existing owners.
Current-main necessity: The fetched main version records acquisition boundaries and client identities but lacks the added initialization snapshots. The merged acquisition-stage work at #163156 is adjacent groundwork rather than a replacement.
Findings None None.
Security None None.

How this fits together

OpenClaw’s Codex plugin connects agent requests to the native Codex app-server. Its initialization and acquisition diagnostics help operators identify where startup stalled.

flowchart TD
  A[Agent request] --> B[Acquire Codex client]
  B --> C[Initialize native server]
  C --> D[Observe write and response]
  D --> E[Validate server version]
  E --> F[Ready client]
  B --> G[Timeout or cleanup]
  D --> G
  G --> H[Bounded diagnostic warning]
Loading

Before merge

  • Complete next step (P2) - Record measured test wall times in the PR body for the new initialization diagnostic suite and changed shared-client coverage.
Agent review details

Security

None.

PR surface

Source +188, Tests +244, Other 0. Total +432 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 6 246 58 +188
Tests 3 245 1 +244
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 10 492 60 +432

Review metrics

Metric Value Why it matters
Production versus test growth production +188 lines; tests and test support +244 lines Production growth is explained by separate initialization observations and integration into the existing warning owner.

Technical review

Best possible solution:

Keep initialization observations with the physical client and project copied, bounded facts through the existing opt-in timeout warning.

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

Not applicable to an underlying timeout fix: this PR adds diagnostic distinctions, with source-inspected boundary tests covering the relevant outcomes.

Is this the best way to solve the issue?

Yes. The patch extends existing client and timeout owners with bounded observations while preserving request execution, retry, and cleanup behavior.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This improves operator diagnostics without changing timeout policy or claiming to repair the underlying startup failure.
  • 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-author exemption applies. Inspected tests exercise the production initialization and decoder paths with an in-memory transport, including nested cleanup; they are supplemental validation, not native-runtime proof. No stored-data contract changes.

Label justifications:

  • P3: This improves operator diagnostics without changing timeout policy or claiming to repair the underlying startup failure.
  • 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-author exemption applies. Inspected tests exercise the production initialization and decoder paths with an in-memory transport, including nested cleanup; they are supplemental validation, not native-runtime proof. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit c1683a6 adds extensions/codex/src/app-server/request-diagnostics.ts:66 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c1683a687418; files: extensions/codex/src/app-server/request-diagnostics.ts)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Add the repository-required measured wall times for the new diagnostic test file and the changed shared-client test coverage to the PR body.

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 5663c4a into main Oct 2, 2026
194 checks passed
@vincentkoc
vincentkoc deleted the fix/codex-initialize-diagnostics-20261002 branch October 2, 2026 04:09
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

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