Skip to content

test(gateway): preserve saved config in auth reload fixture - #140433

Merged
steipete merged 1 commit into
mainfrom
codex/gateway-auth-reload-fixture
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/gateway-auth-reload-fixture

Conversation

@steipete

@steipete steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

The Gateway auth reload tests rebuilt a logging-only update from their initial config object. The first config write and Gateway startup had already added native-session-catalog privacy preferences, metadata, and agent workspace state, so that later write unintentionally removed those fields instead of testing a safe logging reload.

Read the current saved source immediately before the update, preserve existing logging fields, and assert that the only changed path is logging.level. All four generated, explicit-override, SecretRef-override, and runtime-override cases retain their source, runtime-auth, policy, and WebSocket reconnection assertions.

Validation on main 62fca0de: a fresh canonical E2E build, four real Gateway/WebSocket cases failing before the fixture repair with unexpected plugins, meta, and agents changes, then all four passing after the repair. No production code changes; net test LOC +5.

The complete changed-file gate and fresh independent P2 review pass.

Extracted while splitting #135599. Follow-up: audit the other saved-config replacements in the Control UI origin-reload and SecretRef rotation fixtures; their similar pattern is recorded without claiming an independently established failure.

@steipete steipete self-assigned this Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 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: XS maintainer Maintainer-authored PR labels Sep 6, 2026
@steipete
steipete marked this pull request as ready for review September 6, 2026 20:39
@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 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 4:46 PM ET / 20:46 UTC.

ClawSweeper review

What this changes

The Gateway auth-reload tests now preserve saved configuration when changing the logging level and assert that no unrelated configuration paths change.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a focused, useful fixture repair that remains absent from fetched main and the latest release. No actionable correctness findings were found, and the maintainer-authored, protected PR is not a cleanup-close candidate.

Priority: P3
Reviewed head: c859a1c70de5b54db38853872e0ec3f3b4d98494

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused fixture repair preserves meaningful integration coverage and has reported before/after validation, with no actionable defects found.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored test repair is exempt from the external-contributor proof gate and changes no production authority; its body reports before/after execution of the four real Gateway/WebSocket auth-reload cases.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored test repair is exempt from the external-contributor proof gate and changes no production authority; its body reports before/after execution of the four real Gateway/WebSocket auth-reload cases.
Evidence reviewed 8 items Verified introduced change: The merge-base-to-head diff changes only the logging-update fixture and imports the existing changed-path collector. Authentication, runtime-override, policy, and WebSocket reconnection assertions remain intact.
Repair still needed on fetched main: Fetched main still constructs the logging update from initialConfig. The later policy-edit fixture already uses the saved source snapshot, supporting the proposed approach.
Latest release comparison: The supplied latest-release commit for v2026.9.2 also retains the initialConfig-based logging update; the fixture repair is not present there.
Findings None None.
Security None None.

How this fits together

The Gateway loads saved configuration and applies supported changes while serving WebSocket clients. These integration tests verify that a logging update preserves authentication and allows clients to reconnect.

flowchart LR
  A[Saved configuration] --> B[Read current source]
  B --> C[Change logging level]
  C --> D[Assert only logging changed]
  D --> E[Gateway config reload]
  E --> F[Check auth and reconnect]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +5. Total +5 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 7 2 +5
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 7 2 +5

Review metrics

None.

Technical review

Best possible solution:

Keep the logging-only fixture grounded in saved source configuration while retaining all existing runtime-auth, policy, and reconnection checks.

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

Yes, at the source level: the original fixture rebuilds its update from the pre-startup object, omitting subsequently saved fields. The body reports four before/after failures and passes; this review did not independently execute them.

Is this the best way to solve the issue?

Yes. Reusing the existing saved-source snapshot pattern repairs the fixture at its producer and preserves the stronger Gateway authentication and reconnection checks.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a bounded integration-test fixture repair with no production behavior change.
  • 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 maintainer-authored test repair is exempt from the external-contributor proof gate and changes no production authority; its body reports before/after execution of the four real Gateway/WebSocket auth-reload cases.

Label justifications:

  • P3: This is a bounded integration-test fixture repair with no production behavior change.
  • 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 maintainer-authored test repair is exempt from the external-contributor proof gate and changes no production authority; its body reports before/after execution of the four real Gateway/WebSocket auth-reload cases.

Evidence

What I checked:

  • Verified introduced change: The merge-base-to-head diff changes only the logging-update fixture and imports the existing changed-path collector. Authentication, runtime-override, policy, and WebSocket reconnection assertions remain intact. (src/gateway/gateway.test.ts:275, c859a1c70de5)
  • Repair still needed on fetched main: Fetched main still constructs the logging update from initialConfig. The later policy-edit fixture already uses the saved source snapshot, supporting the proposed approach. (src/gateway/gateway.test.ts:274, d97078731212)
  • Latest release comparison: The supplied latest-release commit for v2026.9.2 also retains the initialConfig-based logging update; the fixture repair is not present there. (src/gateway/gateway.test.ts, 3928bad9badf)
  • Saved source versus runtime configuration: Valid snapshots expose sourceConfig separately from materialized runtimeConfig. Reading sourceConfig preserves saved fields without copying runtime-only auth overrides into the fixture. (src/config/io.snapshot.ts:346, c859a1c70de5)
  • Existing change detector: The collector recursively reports added, removed, and changed paths and already serves production config writes. The assertion protects the logging-only scenario without introducing a test-only production seam. (src/config/config-change-paths.ts:5, c859a1c70de5)
  • Established reload contract: Configuration documentation identifies logging changes as not requiring a Gateway restart, matching the scenario exercised by the retained auth and reconnect assertions. Public docs: docs/gateway/configuration.md. (docs/gateway/configuration.md:602, c859a1c70de5)

Likely related people:

  • Peter Steinberger: 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.

@steipete
steipete merged commit b9a8086 into main Sep 6, 2026
215 checks passed
@steipete
steipete deleted the codex/gateway-auth-reload-fixture branch September 6, 2026 20:56
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 6, 2026
…ig-ref

* origin/main: (31 commits)
  docs(web): split the Control UI page into task pages (#140437)
  fix: tool_search rejects calls that send both query and queries (#140310)
  fix(update): preserve rollback and truthful serving reports (#140419)
  fix: restore context when CLI recovery starts a fresh session (#140294)
  refactor(tests): retain transport-driven auth dismissal coverage (#140430)
  fix: stop unfinished subagents before resetting a conversation (#140417)
  fix(models): cap configured output at the final context window (#140436)
  refactor(mcp): reuse transport config normalization (#140439)
  test(gateway): preserve saved config in auth reload fixture (#140433)
  fix(plugins): inherit active config for embedded agent runs (#140435)
  refactor(tui): remove test-only shutdown timer hooks (#140432)
  fix(agents): preserve channel silent-reply guidance (#138345)
  fix(tasks): cancel resumed yielded subagent tasks (#140410)
  refactor(doctor): share compaction config traversal (#140330)
  fix(doctor): restore LINE and Mattermost account promotion (#136045)
  docs: remove the empty release-sections nav group (#140427)
  fix(tooling): omit Codex machine squash credit (#140420)
  chore(ui): refresh control ui locales (#140384)
  refactor(plugin-sdk): reuse native approval input contracts (#140415)
  fix: silent model WebSocket streams hang past the idle timeout (#140335)
  ...

# Conflicts:
#	docs/web/control-ui.md
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 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: XS 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