Skip to content

improve: retain quota refresh evidence from successful CI runs - #152173

Merged
steipete merged 3 commits into
mainfrom
codex/qa-quota-refresh-correlation
Sep 19, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/qa-quota-refresh-correlation

Conversation

@steipete

@steipete steipete commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Related: #152003

What Problem This Solves

Quota recovery CI can refresh OAuth credentials without retaining enough evidence to explain why, especially when the test passes.

User Impact

There is no user-visible behavior change. Maintainers get bounded, sanitized evidence from successful and failed quota recovery runs; production authentication and the historical refresh trigger are unchanged.

Why This Change Was Made

Replace the stack-based caller guess with observed native account/chatgptAuthTokens/refresh method/reason and correlate it with synthetic provider response status and timing. Reuse the existing fixture response records and public diagnostic owner. CI retains only quota.public.json for seven days, separately from failure-only timeout diagnostics.

The test-artifact schema advances to version 2. It removes the unreliable caller field, limits each public stream to 128 entries, caps native auth receipts per process with an explicit truncation flag, and excludes payloads, credentials, IDs, headers, raw paths, and stacks. Response payloads, token expiry, test assertions, and deadlines are unchanged.

Evidence

  • Ten focused diagnostics tests pass, covering secret canaries, unknown fields, bounded streams, split/malformed/oversized native frames, and warmup classification.
  • The maintained real-Gateway saved-clear case passes unchanged (39.177s), with six native observer attachments and no refreshes.
  • A temporary first-upgrade HTTP401 control passes (37.808s): the native unauthorized refresh follows the 401 by 3ms, the OAuth receipt follows by 45ms, and the token HTTP200 follows by 8ms. The temporary rejection was removed before review. Both runs retained schema-2 artifacts with no omissions or truncation.
  • Changed checks, root test types, targeted lint, workflow validation, and the updated CI upload contract pass. Fresh independent review found no actionable issues.

The successful real-Gateway job in the original hosted run retained three schema-2 artifacts with native refresh reason unauthorized, no truncation or omissions, and no recorded fixture HTTP401. This identifies the native callback reason, not its triggering request or endpoint. WebSocket status describes emitted event payloads rather than a received HTTP response; temporal proximity does not establish cause. The historical refresh trigger remains unresolved.

CI recovery

The original run failed only the unchanged private-child QA Smoke scenario and its aggregate gate. PR #152207 separately reproduced and fixed the conversation-identity settlement bug. This update integrates landed main through 2d1973e31d3a, including that repair, while preserving all six diagnostics feature files byte-for-byte.

On the integrated candidate, all ten diagnostics tests, the selected CI upload-contract test, root test types, scoped typed lint, formatting, export/guard checks, and workflow validation pass. Fresh full-diff P0–P2 review is clean. The earlier real-Gateway diagnostic evidence remains scoped to its recorded revision; the integrated hosted run passed all four QA Smoke profiles. No retries, timeout changes, or assertion relaxations were used to address the Smoke failure.

The integrated run then failed Windows concurrent Control UI asset publication: one preparation rejected, but the assertion retained only its status and hid the error. A separate diagnostic-only seventh file now compares the full settled results while requiring the same two successful preparations. The six quota feature files remain unchanged. Both original concurrency cases and a task-only ordered shared-pruning probe passed on Linux; this does not establish the historical Windows cause. No production pruning change or retry policy is included. A subsequent green Windows run alone would not prove that cause fixed.

The diagnostic-only assertion passes both normal publication cases and its owning Gateway test type graph, typed lint, and formatting. Fresh independent P0–P2 review is clean. Exact-head CI passed at 14d560c4435022828579d86ae87af51f317e13c9: run 35406946696, attempt 2 completed all 133 jobs with no failures.

At the current diagnostic head 14d560c4435, the hosted real-Gateway suite passed and uploaded three schema-2 artifacts from its successful job. Each records two native unauthorized callbacks, zero recorded fixture HTTP401 responses, no omitted entries, and no auth-capture truncation. The downloaded bounded artifacts were independently inspected; this strengthens success-path publication proof without identifying the historical triggering endpoint.

Windows publication passed at 14d560c4435; this does not explain its earlier rejection. The only failure in that run was a core-lint runner shutdown (exit 143, no lint diagnostic). After the full run settled, a single failed-only recovery retained successful jobs and reran the interrupted lint job on the same commit; it and the aggregate gate passed.

@clawsweeper

clawsweeper Bot commented Sep 18, 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.

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Sep 18, 2026
@steipete
steipete marked this pull request as ready for review September 18, 2026 21:30
@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 Sep 18, 2026
@clawsweeper

clawsweeper Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 18, 2026, 7:52 PM ET / 23:52 UTC (Revision 3).

ClawSweeper review

What this changes

The PR retains sanitized quota diagnostics from successful CI runs, records native refresh reasons and provider response timing, and exposes concurrent asset-publication rejection details.

Merge readiness

✅ Ready for maintainer review

Keep open: current main still lacks success-run quota evidence retention, and the patch has no actionable correctness findings. The latest assertion change preserves the existing concurrency requirements.

Priority: P3
Reviewed head: 14d560c4435022828579d86ae87af51f317e13c9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused diagnostic improvement with relevant runtime evidence, bounded output and no actionable patch findings.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (linked_artifact): The reported real-Gateway/native-client runs exercise the observer and diagnostic collector, including an injected HTTP401 refresh sequence; GitHub independently confirms successful artifact publication. The six feature files remain identical to that tested revision. Artifact-content observations remain attributed to the captured body, and the added assertion claims no Windows runtime repair.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The reported real-Gateway/native-client runs exercise the observer and diagnostic collector, including an injected HTTP401 refresh sequence; GitHub independently confirms successful artifact publication. The six feature files remain identical to that tested revision. Artifact-content observations remain attributed to the captured body, and the added assertion claims no Windows runtime repair.
Evidence reviewed 8 items Current main still needs the change: Fetched main retains schema-1 stack-based caller classification and uploads quota.public.json only through the failure-conditioned step. The latest release tree has no quota-reset-diagnostics.mjs at this path. The merged predecessor #152003 therefore does not supersede this success-retention improvement.
Bounded public diagnostic boundary: The collector allowlists event kinds, reason, numeric timing/status, endpoint categories and request mode; public streams retain at most 128 entries. The preload caps receipts and observes existing stdout delivery without adding a flowing data listener. CI selects only quota.public.json using the existing pinned upload action and seven-day retention.
Affirmative native dependency signal: The introduced observer parses account/chatgptAuthTokens/refresh frames, and the fixture launches @openai/codex app-server. These explicit protocol and execution dependencies make direct Codex source inspection applicable.
Findings None None.
Security None None.

How this fits together

Quota recovery tests run a real Gateway and native Codex client against a synthetic provider. Their diagnostic collector filters transport and authentication observations into bounded public artifacts for CI investigation.

flowchart LR
  A[Quota recovery scenario] --> B[Gateway and native client]
  B <--> C[Synthetic provider]
  B --> D[Native refresh observer]
  C --> E[Public diagnostic filter]
  D --> E
  E --> F[Seven-day CI artifact]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +278, Config +8. Total +286 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 6 332 54 +278
Docs 0 0 0 0
Config 1 9 1 +8
Generated 0 0 0 0
Other 0 0 0 0
Total 7 341 55 +286

Review metrics

None.

Technical review

Best possible solution:

Retain the bounded public evidence on both successful and failed runs while keeping refresh attribution separate from claims about its cause.

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

Not applicable as a product-bug reproduction: source confirms the failure-only retention gap, and hosted evidence demonstrates successful-run publication. No tests were executed during this read-only review.

Is this the best way to solve the issue?

Yes: extending the existing diagnostic collector and narrowing publication to its sanitized artifact avoids a competing telemetry path or production authentication changes.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This improves internal test diagnostics without changing user-facing authentication or recovery behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The reported real-Gateway/native-client runs exercise the observer and diagnostic collector, including an injected HTTP401 refresh sequence; GitHub independently confirms successful artifact publication. The six feature files remain identical to that tested revision. Artifact-content observations remain attributed to the captured body, and the added assertion claims no Windows runtime repair.
  • proof: sufficient: Contributor real behavior proof is sufficient. The reported real-Gateway/native-client runs exercise the observer and diagnostic collector, including an injected HTTP401 refresh sequence; GitHub independently confirms successful artifact publication. The six feature files remain identical to that tested revision. Artifact-content observations remain attributed to the captured body, and the added assertion claims no Windows runtime repair.

Evidence

What I checked:

  • Current main still needs the change: Fetched main retains schema-1 stack-based caller classification and uploads quota.public.json only through the failure-conditioned step. The latest release tree has no quota-reset-diagnostics.mjs at this path. The merged predecessor test: retain safe quota recovery failure evidence #152003 therefore does not supersede this success-retention improvement. (.github/workflows/ci.yml:3035, e623bcd437da)
  • Bounded public diagnostic boundary: The collector allowlists event kinds, reason, numeric timing/status, endpoint categories and request mode; public streams retain at most 128 entries. The preload caps receipts and observes existing stdout delivery without adding a flowing data listener. CI selects only quota.public.json using the existing pinned upload action and seven-day retention. (test/e2e/qa-lab/runtime/quota-reset-diagnostics.mjs:103, 14d560c44350)
  • Affirmative native dependency signal: The introduced observer parses account/chatgptAuthTokens/refresh frames, and the fixture launches @openai/codex app-server. These explicit protocol and execution dependencies make direct Codex source inspection applicable. (test/e2e/qa-lab/runtime/quota-reset-diagnostics.mjs:49, 14d560c44350)
  • Native refresh contract verified: The sibling checkout's backing repository remote identifies openai/codex. Its external-auth bridge emits the refresh request with Unauthorized, and protocol serialization confirms the method, id and lowercase unauthorized reason. The inspected client also distinguishes generate=false prewarm from inference. (codex-rs/app-server/src/external_auth.rs:33, 6b9826e3aa83)
  • Successful hosted artifact publication: GitHub confirms real-Gateway job 105768604777 succeeded and its quota upload step succeeded in run 35397117590. Artifact 10569836014, control-ui-quota-diagnostics-1, contains 4,366 archive bytes and belongs to the original feature head. https://github.com/openclaw/openclaw/actions/runs/35397117590/job/105768604777. (.github/workflows/ci.yml:3045, f4a4f324b48a)
  • Runtime evidence and its limits: The captured PR body reports an unchanged real-Gateway saved-clear run and a temporary HTTP401 control that observed native refresh, OAuth receipt and successful token response in sequence. It also reports three hosted schema-2 artifacts without omissions or truncation. Archive contents were not independently read in this review; those content observations remain attributed to the supplied body snapshot. The body explicitly leaves the historical refresh trigger unresolved. (f4a4f324b48a)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • obviyus: 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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-18T21:36:30.158Z sha f4a4f32 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-18T23:26:33.092Z sha 8582077 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 18, 2026
@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Sep 18, 2026
@steipete
steipete merged commit d481a85 into main Sep 19, 2026
329 of 332 checks passed
@steipete
steipete deleted the codex/qa-quota-refresh-correlation branch September 19, 2026 00:18
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 19, 2026
* commit 'ca69b4d25dfcd488acc6ba1d878e4b4252f40cd2': (325 commits)
  perf(gateway): streamline config reload comparison (#152279)
  fix(xai): reject invalid UTF-8 OAuth responses (#111737)
  fix(release): accept waived advisory performance evidence for stable publication (#152290)
  fix: deliver watcher results while other sessions are busy (#152287)
  perf(media): reuse attachment filename classification (#152274)
  refactor(build): reuse forwarded option scanning (#152293)
  chore(diagnostics-otel): revert unapproved duration-bucket merge (#152292)
  fix: stop chat media reads after access changes (#152219)
  fix(test): use Gateway WebSocket transport in network fixtures (#152143)
  improve: retain quota refresh evidence from successful CI runs (#152173)
  improve(gateway): reduce memory used by session selection (#152260)
  perf(agents): use keyed subagent capability lookups (#152263)
  refactor(matrix): centralize media metadata assembly (#149128)
  chore(ui): refresh control ui locales (#152276)
  feat: open Crabbox apps beside the conversation (#152094)
  refactor: simplify worker and model fallback handling (#152268)
  perf(codex): reconcile session catalogs incrementally (#152257)
  fix(ui): keep submitted prompts visible across session startup (#152241)
  perf(sessions): move automatic maintenance database work to workers (#148630)
  fix: preserve reply metadata through outbound preparation (#152231)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 19, 2026
…law#152173)

* test: retain native quota refresh diagnostics

* test(gateway): retain concurrent publication rejection details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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