Skip to content

fix(status): prepare runtime config before resolving online usage - #170692

Merged
steipete merged 2 commits into
mainfrom
dbasync/redmain-status-usage-config
Oct 13, 2026
Merged

steipete merged 2 commits into
mainfrom
dbasync/redmain-status-usage-config

Conversation

@steipete

@steipete steipete commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

status --usage --json can lose the selected Codex account identity and retain a generic OpenAI “Token expired” result. Passive online status reads the full config for usage arguments, but never prepares it for plugin runtime readers. Codex registration then reaches runtime.config.current() with no published snapshot.

The source-supported culprit is 7e48efb (#169714), which changed cold runtime reads to require prior asynchronous preparation. This repair reuses the status owner's existing config read and awaits setAppliedRuntimeConfigSnapshot(runtimeConfig, sourceConfig) before resolving usage. It preserves the explicit --usage gate and source config; there is no second read, synchronous fallback, or plugin-loader change.

The new regression invokes the real online-usage callback from an empty runtime snapshot and checks that policy and source config are visible when usage resolution starts. It catches both missing publication and a missing await. The adjacent usage-routing fixtures never set scan.collection, so they do not enter this callback and need no changes.

Evidence

Failure evidence: CI run 38346907753, job 115130732432 failed codex-auth-product-proof.e2e.test.ts / “repairs mixed legacy auth into SQLite and sends the selected OAuth profile to app-server”. The same missing-email assertion was reproduced on baseline 592b7e4 after Doctor and the selected-account Gateway turn succeeded. That diagnostic run substituted the verified version constant 0.160.0 for the broad test-API version lookup, raised the fixture test limit from 180 to 900 seconds, and raised Doctor/status managed-command fixture limits from 120 to 600 seconds. All assertions and product source stayed unchanged; the product status timeout stayed 60000. Fixtures were restored afterward. The test took 196.211 seconds, 286.33 seconds total; those loaded-host timings are not performance claims.

Proof: changed-file oxfmt and oxlint plus git diff --check passed. One completed isolated Codex autoreview returned scoped-clean at P0–P2; the earlier interrupted attempt never produced a result. No local tests or broad scans were run under the compute-conservation rule. The status owner file passed all five tests in PR CI (run 38353082464, job 115149998826): 2.86 seconds Vitest, 5.02 seconds including its wrapper. The only failed leaf was a stale mock-baseline row for the replaced status-runtime-shared mock; follow-up b80841f removes that exact row. The original unchanged hosted product case passed on final head b80841f in run 38354682615/job115154703436: 105.048 seconds for the case, 155.13 seconds for the filtered file (158.41 seconds with its wrapper). The unrelated second case was intentionally filtered out. The final-head baseline/ratchet job also passed: T1 454→454, compatibility 9→9, and all dialect categories 0→0. One unrelated type defect in the preparation-recovery test fixture is being fixed separately: main-session-restart-recovery-admission.test.ts:705 uses unsupported title instead of label. It was introduced by 2251880 on main and is repaired separately in #170722. The actual CI merge a354bc947d26, its main parent 0ae42f0, and observed main 95b3b97 have identical fixture, session-entry type, and failing agents-sessions typecheck configuration blobs. This is the same TS2322 rule on the same file; the inherited static-failure exception applies. All other selected static and security gates passed.

Scope: three files, production +3/−1 lines, tests +61 lines, and one obsolete baseline row removed. No schema, SDK, update, or plugin-loading lifecycle changes; no removed authority checks. No warmed-path SQL/request or T1 change is claimed, so no SQL harness was run.

@clawsweeper

clawsweeper Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T05:49:47.084452Z adbb3d3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: S labels Oct 13, 2026
@steipete
steipete merged commit 54d8098 into main Oct 13, 2026
125 of 128 checks passed
@steipete
steipete deleted the dbasync/redmain-status-usage-config branch October 13, 2026 06:20
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
…enclaw#170692)

Publish the existing online status config read before resolving usage so Codex runtime readers retain the selected account identity. Await publication and preserve the explicit usage gate without an extra read or synchronous fallback.

The status owner tests and original unchanged auth product case passed. The only failing static leaf is the independently verified main recovery-fixture TS2322, repaired separately in openclaw#170722.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant