Skip to content

fix: preserve config reload diagnostics in tests - #157886

Merged
steipete merged 3 commits into
mainfrom
codex/fix-config-reload-stale-secrets-20260925
Sep 25, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/fix-config-reload-stale-secrets-20260925

Conversation

@steipete

@steipete steipete commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Related: #157584

What Problem This Solves

Config RPC tests hid the runtime cause when a saved edit failed to apply, and the committed-error regression did not actually perform a commit.

User Impact

This improves internal tests and failure diagnostics. The runtime recovery fix is already supplied by @joshavant in 71cc18ae.

Why This Change Was Made

Keep one four-case recovery table, reach the actual publication commit boundary before injecting a committed error, and verify retry decisions, commit ownership, and preserved authored state. Canonical admission-checkpoint tests remain intact.

Persisted-config RPC failures retain their original code, details, and message prefix, with up to eight redacted reload-log records from a 64 KiB tail window. The fixture uses its own log file and flushes before removing its state. This is a tail-window bound, not a guarantee of strict total I/O or operation-correlated logs.

Evidence

  • On the staged tree now committed as 9f0e24a57fb9, all 149 tests passed. The four owner/logging files passed 68 cases in 116.85 seconds grouped wall time; the owner file passed 18 cases in 89.68 Vitest seconds, with the four refined recovery cases taking 22 ms combined.
  • The real config-RPC file passed all 81 cases in isolated synthetic state: 406.98 Vitest seconds / 562.23 seconds wall including runtime build and worker preparation. An earlier artifact-preparation refusal occurred before tests under inherited service selectors; the supported isolated wrapper corrected that prerequisite without touching an operator Gateway or disabling checks.
  • All 25 selected changed checks passed. Fresh independent P0–P2 review found no actionable findings in the complete diff and supplied contracts/logging context. Its input omitted the unchanged recovery handler, which was inspected separately. Injected plugin errors prove the coordinator’s reaction, not real plugin teardown.
  • Earlier CI 36099648083 passed the then-16-case owner file but failed the broader include-only config-RPC case at its existing 180-second hook timeout, followed by no-output termination. Bounded probes did not establish its cause. This refreshed proof is neither an original-order reproduction of that CI failure nor a claimed timeout repair.

Production source is byte-for-byte the incorporated canonical main. Published-head CI 36193004339 passed with 34 successful jobs and 21 skipped; the exact-head ClawSweeper review reported no findings. Landed as 2998a881c7bca2d0d336bc9933dbbd82cca701d8 through native merge and completed cleanup. The historical timeout remains unresolved as described above.

Preserve the existing stale-preparation retry after plugin activation rolls back cleanly and wraps the original error. Keep committed replacements and cleanup failures terminal, and retain bounded reload diagnostics in the config RPC fixture.
@clawsweeper

clawsweeper Bot commented Sep 25, 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: S labels Sep 25, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 25, 2026
@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 25, 2026, 5:57 PM ET / 21:57 UTC (Revision 4).

ClawSweeper review

What this changes

The branch makes Gateway reload tests exercise an actual committed failure and adds bounded, redacted reload logs to failed config RPC test responses.

Merge readiness

✅ Ready for maintainer review

Keep open. Current main contains the runtime reload repair, but it does not contain this branch’s distinct test and diagnostic improvements. A later merged rollback repair addresses the historical timeout discussed on the PR; the introduced patch has no supported blocking finding.

Priority: P2
Reviewed head: 9f0e24a57fb9b52582cabe23508623da0123ac31

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused owner-boundary assertions and reported Gateway validation support a good patch, with no introduced blocking defect found.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: This member-authored test-only PR has no contributor real-behavior-proof gate. Its body reports 18 owner tests and an 81-case run through a real Gateway with isolated synthetic state; this read-only review did not directly observe the persisted-error log-tail branch. 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: This member-authored test-only PR has no contributor real-behavior-proof gate. Its body reports 18 owner tests and an 81-case run through a real Gateway with isolated synthetic state; this read-only review did not directly observe the persisted-error log-tail branch. No stored-data contract changes.
Evidence reviewed 11 items Introduced test coverage: The four-case table now performs the publication callback before marking a commit, then checks retry count, commit ownership, error cause, and authored state.
Introduced diagnostic path: Only a config RPC error carrying persistedConfig triggers a logger flush and an eight-record, 64 KiB reload-log tail; the original error code and details remain in the response.
Current-main behavior: The production reload coordinator on main retries a stale secret publication only after an uncommitted plugin rollback; the PR does not alter this owner.
Findings None None.
Security None None.

How this fits together

Gateway config RPCs save settings edits and ask the running Gateway to apply them. The shared test fixture sends those requests and presents reload failure details to test assertions.

flowchart LR
A[Config RPC test] --> B[Gateway client]
B --> C[Config write]
C --> D[Reload coordinator]
D --> E{Applied?}
E -->|Yes| F[Active Gateway]
E -->|No| G[Redacted log tail]
G --> H[Test failure details]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +56. Total +56 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 112 56 +56
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 112 56 +56

Review metrics

Metric Value Why it matters
Failure log bound 8 records from a 64 KiB tail The diagnostic output stays bounded while retaining recent reload context.

Technical review

Best possible solution:

Keep recovery semantics guarded at the publication commit boundary and make persisted-but-unapplied config writes diagnosable through the shared, redacted test logger.

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

Yes for the test defect: the prior committed-error case asserted that commit was never called, while the new table reaches the publication commit callback. I did not execute tests in this read-only review.

Is this the best way to solve the issue?

Yes. The test uses the production publication boundary, and the fixture consumes the existing redacting log-tail owner without adding runtime diagnostic behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 800bf8e10e7c.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The PR improves a focused Gateway regression test and failure diagnosis without changing shipped runtime 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. Not applicable: This member-authored test-only PR has no contributor real-behavior-proof gate. Its body reports 18 owner tests and an 81-case run through a real Gateway with isolated synthetic state; this read-only review did not directly observe the persisted-error log-tail branch. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • joshavant: 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 (3 earlier review cycles)
  • reviewed 2026-09-25T04:18:19.361Z sha a006d67 :: blocked before merge. :: none
  • reviewed 2026-09-25T06:05:49.426Z sha 76b7190 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-25T06:18:05.363Z sha 76b7190 :: needs maintainer review before merge. :: none

Adopt the canonical runtime fix from main. Keep one recovery table, derive committed failure from an actual commit, preserve refreshed state after cleanup failure, and retain bounded redacted diagnostics from the config RPC fixture.
@steipete steipete changed the title fix: recover config edits after plugin rollback fix: preserve config reload diagnostics in tests Sep 25, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Additional canonical Linux context for this diagnostic work: run36087033303/1, job107933689308, frozen source ba122ee828480c1d93a834eea39c518932944975, failed server.config-patch.test.ts → accepts exact numeric record keys in replacePaths at the patch response assertion. The Discord seed succeeded; the later patch persisted but returned the generic active-Gateway application failure. The ordered file finished 80 passed / 1 failed.

The retained log contains no underlying reload exception, so this is not evidence of numeric-key rejection, a timeout, or the host-broker failures in other jobs. It also differs from the seed-application stage covered by the previously reported macOS reproduction. Main already contains 71cc18ae186d5f73fcf243ed955fe237cbd40335; this old-source failure cannot establish whether the wrapped-stale repair resolves its hidden cause.

Your bounded redacted reload-tail diagnostics and post-commit coverage are the existing owner path for resolving that uncertainty. I have not changed assertions/deadlines, opened a competing patch, or replayed the suite to get green. Keeping this exact Linux patch-stage failure linked here avoids silently treating adjacent proof as its diagnosis.

Preserve canonical admission-checkpoint coverage while exercising real
publication commit ownership in the existing recovery table. Keep bounded,
redacted reload context on persisted-config RPC failures.

The prior CI include-only hook timeout remains unexplained; the current
boundary proof does not establish its cause or claim a runtime fix.
@steipete
steipete merged commit 2998a88 into main Sep 25, 2026
111 checks passed
@steipete
steipete deleted the codex/fix-config-reload-stale-secrets-20260925 branch September 25, 2026 22:40
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

roboclaw-bot added a commit that referenced this pull request Sep 25, 2026
Main now records and attaches Gateway reload diagnostics through the canonical config RPC fixture (2998a88, #157886). Remove this branch-only console override so the merge takes that implementation without conflict. All five native ownership simplifications and production source remain unchanged.

Verified fixture equality with the branch base, formatting, type-aware lint, and whitespace checks.

Co-authored-by: galiniliev <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 26, 2026
Preserve the existing stale-preparation retry after plugin activation rolls back cleanly and wraps the original error. Keep committed replacements and cleanup failures terminal, and retain bounded reload diagnostics in the config RPC fixture.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

2 participants