Skip to content

fix(test): retain Gateway recovery failure diagnostics - #146925

Merged
steipete merged 1 commit into
mainfrom
codex/gateway-recovery-failure-diagnostics
Sep 13, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/gateway-recovery-failure-diagnostics

Conversation

@steipete

@steipete steipete commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Related: #146547

What Problem This Solves

A failed RPC in the built Gateway recovery test reports only a WebSocket closure, losing the Gateway diagnostics needed to investigate it.

User Impact

No runtime behavior changes. Future test failures include the existing bounded Gateway log tail, recovery phase, current step, and observed child exit facts. The original Gateway 1006 cause remains unresolved.

Why This Change Was Made

Capture diagnostics before fixture cleanup, then rethrow the original error even if diagnostic output fails. Requests, assertions, deadlines, and cleanup stay unchanged.

Evidence

Focused typed lint, Gateway-root typechecking, formatting, independent review, and exact-head CI passed.

The unchanged recovery test file passed both cases before (10d36d1) and after (33d1d81) on the same Linux Testbox with Node 24.19.0, using separate exact checkouts and normal builds: 30.51s before, 30.78s after. Both verified persisted failure state, credential refresh, the recovered response, and the configured catalog. Testbox run completed successfully and its lease stopped; its backing Actions status may reflect lease cleanup.

No failure was injected or reproduced, so failure-output behavior remains source-reviewed. The original unresolved closure is retained in CI run 34750584650.

@clawsweeper

clawsweeper Bot commented Sep 13, 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 gateway Gateway runtime size: M maintainer Maintainer-authored PR labels Sep 13, 2026
@steipete
steipete marked this pull request as ready for review September 13, 2026 10:20
@steipete
steipete requested a review from a team as a code owner September 13, 2026 10:20
@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 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 13, 2026, 6:26 AM ET / 10:26 UTC.

ClawSweeper review

What this changes

The Gateway recovery test reports its current step, recovery phase, child-process status, and bounded logs before cleanup while preserving the original failure.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open: this is a focused, useful diagnostic improvement absent from current main. No introduced correctness defect was found, and the protected maintainer label excludes cleanup closure.

Priority: P3
Reviewed head: 33d1d81446e573fd6dc1705a39b969d94d0edb80

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused diagnostic improvement with preserved test semantics and a remaining scoped validation requirement.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a MEMBER-authored test-only PR, so the external-contributor proof gate does not apply; static checks are reported, but after-change failure output was not exercised.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a MEMBER-authored test-only PR, so the external-contributor proof gate does not apply; static checks are reported, but after-change failure output was not exercised.
Evidence reviewed 7 items Introduced behavior: The whitespace-insensitive introduced diff adds step markers and a guarded diagnostic catch only; requests, assertions, deadlines, and cleanup remain unchanged.
Existing diagnostic and cleanup owners: The instance log formatter retains at most 256 KiB per output stream. The fixture runs cleanup after the body settles, retaining the original Error or including it in an AggregateError when cleanup also fails.
Current-main necessity: The fetched main version still lacks the diagnostic catch and step markers; its comparison with the reviewed head contains the same focused additions.
Findings None None.
Security None None.

How this fits together

The recovery test drives an isolated built Gateway through synthetic provider failures and credential recovery. Its diagnostics help developers investigate failed requests before the fixture stops the Gateway.

flowchart TD
  A[Synthetic provider failures] --> B[Gateway recovery test]
  B --> C[Built Gateway requests]
  C --> D{Test outcome}
  D -->|Failure| E[Capture phase and bounded logs]
  E --> F[Preserve original error]
  D -->|Success| G[Fixture cleanup]
  F --> G
Loading

Before merge

  • Resolve merge risk (P1) - Before/after execution timings required by the Gateway guide are not supplied; the new failure-output path has not been demonstrated at runtime.
  • Complete next step (P2) - Record before/after results and timings for src/gateway/gateway-auth-recovery.test.ts under the Gateway guide’s validation requirement.
Agent review details

Security

None.

PR surface

Tests +29. Total +29 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 232 203 +29
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 232 203 +29

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep failure reporting local to the recovery fixture, reuse bounded instance logs, and preserve the existing error and cleanup contracts.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep failure reporting local to the recovery fixture, reuse bounded instance logs, and preserve the existing error and cleanup contracts.

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

Yes, at source level: a rejected recovery RPC previously escaped without attaching the instance log tail. No runtime failure was reproduced during this read-only review.

Is this the best way to solve the issue?

Yes. The patch uses the existing log owner and reports context before cleanup, while a nested catch prevents diagnostic failures from replacing the test error.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This improves test-failure diagnostics without changing product behavior or relaxing test coverage.
  • 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 supplied repository state identifies a MEMBER-authored test-only PR, so the external-contributor proof gate does not apply; static checks are reported, but after-change failure output was not exercised.

Label justifications:

  • P3: This improves test-failure diagnostics without changing product behavior or relaxing test coverage.
  • 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 supplied repository state identifies a MEMBER-authored test-only PR, so the external-contributor proof gate does not apply; static checks are reported, but after-change failure output was not exercised.

Evidence

What I checked:

  • Introduced behavior: The whitespace-insensitive introduced diff adds step markers and a guarded diagnostic catch only; requests, assertions, deadlines, and cleanup remain unchanged. (src/gateway/gateway-auth-recovery.test.ts:328, 33d1d81446e5)
  • Existing diagnostic and cleanup owners: The instance log formatter retains at most 256 KiB per output stream. The fixture runs cleanup after the body settles, retaining the original Error or including it in an AggregateError when cleanup also fails. (test/helpers/openclaw-test-instance.ts:525, 33d1d81446e5)
  • Current-main necessity: The fetched main version still lacks the diagnostic catch and step markers; its comparison with the reviewed head contains the same focused additions. (src/gateway/gateway-auth-recovery.test.ts:93, 1393a714309f)
  • Release check: The latest supplied release, v2026.9.4, does not contain this test path. No shipped replacement for this diagnostic change was established. (src/gateway/gateway-auth-recovery.test.ts, 3a9d69db306c)
  • Prior area work: GitHub commit metadata identifies steipete as the author of prior merged work that renamed this test and retained built-Gateway recovery coverage. Deeper local history inspection failed when unavailable objects could not be retrieved; no source-line introduction attribution is claimed. (src/gateway/gateway-auth-recovery.test.ts, c91669493102)
  • Validation scope: The full Gateway policy requires before/after timing for the affected test. The captured PR body reports static checks and explicitly says no runtime scenario was rerun. This read-only review ran no tests; diff whitespace checking passed and the checkout remained clean. (src/gateway/AGENTS.md:64, 33d1d81446e5)

Likely related people:

  • 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.

  • Record before/after timings for the affected Gateway test as required by its scoped guide.

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.

@steipete
steipete merged commit e45c014 into main Sep 13, 2026
175 checks passed
@steipete
steipete deleted the codex/gateway-recovery-failure-diagnostics branch September 13, 2026 10:59
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 13, 2026
* temp/pr-146802: (51 commits)
  improve: reduce worktree filesystem stalls and archive syncs (#146906)
  fix(ui): avoid extra chat rail work while replies stream (#146883)
  improve(ui): speed up populated Usage timelines (#146947)
  test(gateway): retain auth recovery failure diagnostics (#146925)
  fix(tests): create private temporary home directories (#146931)
  fix(backup): preserve discovery under concurrent state writes (#146912)
  fix: keep queued deliveries in their original state directory (#146917)
  fix(discord): settle voice waveform work before releasing input (#146885)
  fix(memory): preserve newer indexes and disclose automatic rebuild costs (#146908)
  fix: retain route ownership while discovering conversations (#146927)
  refactor: reuse plugin fixture shell runner (#146920)
  fix(worker): stop preparing disabled live previews (#146896)
  fix(runtime): support Bun across tooling suite (#146807)
  chore(i18n): refresh native locales (#146924)
  perf(secrets): limit expiry metadata to transient credentials (#146882)
  fix(ui): preserve queued refreshes during session discovery (#146535)
  test(ui): wait for quiet scrolling and close named file tabs (#146836)
  fix(ui): prevent Usage hour filters from freezing during DST (#146919)
  test(ui): share browser page cleanup across layout fixtures (#146805)
  ci: balance complete PR runtime test groups (#146916)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* commit 'ccfd2377cd07d1ad3a583ba64d08e29a065f7061': (1587 commits)
  fix(ui): avoid recapturing chat drafts during UI updates (#146884)
  fix(ui): show system uptime in the debug overlay (#146960)
  fix(retry): honor waits beyond the native timer limit (#145718)
  fix(ui): keep chat history idle when run status changes (#146802)
  fix(ui): reuse persisted text during chat streaming (#146831)
  refactor(qa): share harness drift result construction (#146903)
  test(agents): coordinate settings lock contention (#146949)
  fix(worker): avoid repeatedly serializing screenshot history (#146907)
  fix(secrets): stop buffered upload writes after cancellation (#146840)
  perf(doctor): avoid unnecessary state runtime imports (#146926)
  improve: reduce compaction request estimation work (#146961)
  fix(ci): wait for forwarded avatar imports before assertions (#146729)
  perf(workers): skip configured Git author lookups (#146833)
  fix: admit borrowed memory writes through the agent database owner (#146760)
  fix(discord): prevent voice playback gaps and stale turn controls (#146798)
  improve: reduce worktree filesystem stalls and archive syncs (#146906)
  fix(ui): avoid extra chat rail work while replies stream (#146883)
  improve(ui): speed up populated Usage timelines (#146947)
  test(gateway): retain auth recovery failure diagnostics (#146925)
  fix(tests): create private temporary home directories (#146931)
  ...

# Conflicts:
#	test/tsconfig/tsconfig.core.test.agents-other.json
#	test/tsconfig/tsconfig.core.test.agents-root.json
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
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. 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