Skip to content

feat: add gateway session maintenance settings UI - #1163

Open
RomneyDa wants to merge 1 commit into
mainfrom
feat/session-maintenance-ui-romneyda
Open

feat: add gateway session maintenance settings UI#1163
RomneyDa wants to merge 1 commit into
mainfrom
feat/session-maintenance-ui-romneyda

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Aug 15, 2026

Copy link
Copy Markdown
Member

Summary

  • add a dedicated Session maintenance expander to the existing Gateway Configuration page
  • expose mode, pruneAfter, maxEntries, resetArchiveRetention, maxDiskBytes, and highWaterBytes
  • stage edits through the page's existing Save/Discard, validation, JSON preview, and optimistic config.patch flow
  • reset drafts when the active gateway client changes so values cannot leak between gateways
  • add parser/model coverage, UI source-contract coverage, and localized resource plumbing

Fixes #1161

Validation

Validated on the exact current PR head 76666d58ac067d18a11d8e2291ad2d39016c8dab on Windows:

  • ./build.ps1 passed: Shared, CLI, WinNodeCli, SetupEngine, and WinUI
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore passed: 3,698 passed, 32 skipped
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore passed: 2,474 passed
  • git diff --check passed in the PR review snapshot
  • XML/resource and localization coverage remain covered by the PR tests

Rubber-duck review identified and drove fixes for cross-gateway stale drafts, refresh-overwriting edits, gateway parser parity, archive-retention wording, and localization coverage.

Real behavior proof

Current-head Windows proof used the real tray executable and a disposable real loopback WebSocket protocol endpoint. This was not a production OpenClaw Gateway binary, so production-Gateway compatibility remains explicitly distinguishable from the UI and wire round trip proven here.

The endpoint returned this initial maintenance state:

mode=warn
pruneAfter=45d
maxEntries=321
resetArchiveRetention=14d
maxDiskBytes=12gb
highWaterBytes=9gb
unrelated.sentinel=keep-me
gateway.bind=loopback

UI Automation confirmed all six values loaded into the expanded Session maintenance controls. The proof changed all six values and invoked Save Changes. The captured config.patch contained:

mode=enforce
pruneAfter=60d
maxEntries=654
resetArchiveRetention=21d
maxDiskBytes=20gb
highWaterBytes=15gb
unrelated.sentinel=keep-me
gateway.bind=loopback

The endpoint observed a second config.get after save. UI Automation then confirmed the refreshed controls displayed all six saved values and the Save button returned to disabled, proving a clean post-save state. Unrelated configuration remained intact in the emitted full-config patch.

Proof artifacts were captured locally from the exact PR head:

  • expanded Session maintenance UI screenshot
  • Live Visual Tree dump
  • redacted JSONL request transcript containing connect, initial config.get, config.schema, config.patch, and post-save config.get

Not verified: acceptance by a production OpenClaw Gateway binary. The disposable endpoint proves the WinUI, client serialization, full-config preservation, and refresh behavior without mutating a maintainer's real gateway.

@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. 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 Aug 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 7:41 PM ET / 23:41 UTC.

ClawSweeper review

What this changes

Adds a Gateway Configuration form for session retention and disk-cleanup settings, including validation, localization, and focused tests.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open. Current main does not contain this session-maintenance editor, and this member-authored feature still needs maintainer product confirmation plus production-Gateway compatibility evidence.

Priority: P3
Reviewed head: 76666d58ac067d18a11d8e2291ad2d39016c8dab
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is coherent and well-covered, with maintainer direction and production-Gateway compatibility as the remaining merge decisions.
Proof confidence 🌊 off-meta tidepool Not applicable: The author is a repository member. The PR nevertheless documents a current-head WinUI and loopback WebSocket round trip, while identifying the production-Gateway gap.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The author is a repository member. The PR nevertheless documents a current-head WinUI and loopback WebSocket round trip, while identifying the production-Gateway gap.
Evidence reviewed 5 items Current-main comparison: Current main has no Session maintenance form in the Gateway Configuration page; the PR adds the form and its control wiring.
Patch implementation: The PR head reads gateway values, stages validated maintenance changes, and sends them through the existing optimistic patch path.
Feature history: ConfigPage’s editor shape dates to the ConfigPage revamp, with later localization work on the same surface.
Findings None None.
Security None None.

Live Verification

Command: .\run-app-local.ps1 -NoBuild -Isolated -AllowNonMain

Result: FAIL (failed) — execution before step 1 run: sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.22.0.tgz

sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.22.0.tgz

Assertions:

  • FAIL expect_output: Started OpenClaw Tray

How this fits together

The Gateway Configuration page reads a connected gateway’s JSON configuration and sends an optimistic full-config patch after user edits. This adds a typed session-maintenance form to that existing save and refresh flow.

flowchart LR
A[Connected gateway] --> B[Configuration response]
B --> C[Gateway Configuration page]
C --> D[Session maintenance form]
D --> E[Validation and draft changes]
E --> F[Optimistic configuration patch]
F --> G[Gateway refresh]
G --> C
Loading

Decision needed

Question Recommendation
Should Windows Hub expose gateway session-maintenance policy as a dedicated form rather than rely on the generic JSON editor? Sponsor the dedicated editor: Keep the form and require production-Gateway compatibility proof before merge.

Why: This adds a durable operator-facing configuration surface, while the linked request is explicitly awaiting product direction.

Before merge

  • Resolve merge risk (P1) - Saving one form edit writes the full maintenance field set, so production-Gateway acceptance is needed to confirm compatibility with omitted fields and gateway defaults.
  • Complete next step (P2) - A maintainer must decide whether the dedicated configuration surface is desired before merge.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Code and tests production +563/-2, tests +146 The feature adds a substantial typed UI and model layer with focused parser and UI-contract coverage.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #1161
Summary: This PR is the candidate implementation for the linked session-maintenance UI request.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Prove production compatibility before merge (recommended)
    Capture a redacted production-Gateway patch and post-save refresh round trip for all six fields.
  2. Accept the protocol risk
    A maintainer may accept the loopback proof only after independently confirming the gateway contract.

Technical review

Best possible solution:

If sponsored, retain the dedicated form and validate a current-head save and refresh round trip against a production OpenClaw Gateway.

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

Not applicable. This PR adds a new configuration UI rather than reporting broken current-main behavior.

Is this the best way to solve the issue?

Unclear. The generic JSON editor already writes configuration, so a maintainer must confirm that the specialized form is the desired product surface.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 99730e7569fc.

Labels

Label justifications:

  • P3: This is optional operator ergonomics rather than a current runtime regression.
  • merge-risk: 🚨 compatibility: The PR persists gateway configuration but has not demonstrated production-Gateway field compatibility.
  • 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 author is a repository member. The PR nevertheless documents a current-head WinUI and loopback WebSocket round trip, while identifying the production-Gateway gap.

Evidence

What I checked:

Likely related people:

  • Ranjesh: Introduced the prior ConfigPage editor revamp that this change extends. (role: feature-history contributor; confidence: medium; commits: 9de9b5ba0f8a; files: src/OpenClaw.Tray.WinUI/Pages/ConfigPage.xaml.cs)
  • Régis Brid: Has prior localization and tray UX history on this ConfigPage surface. (role: recent area contributor; confidence: medium; commits: 25c11dd07f09, 1a07759a7e6e; files: src/OpenClaw.Tray.WinUI/Pages/ConfigPage.xaml.cs, src/OpenClaw.Tray.WinUI/Strings/en-us/Resources.resw)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Confirm the specialized editor is desired over the generic JSON path.
  • Post redacted production-Gateway acceptance and refresh evidence for the current head.

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 (1 earlier review cycle)
  • reviewed 2026-08-15T12:31:46.006Z sha 76666d5 :: needs maintainer review before merge. :: none

@shanselman

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 18, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Windows Hub UI for gateway session maintenance settings

2 participants