Skip to content

refactor: centralize session-group defaults replacement - #154017

Merged
roboclaw-bot merged 2 commits into
mainfrom
openclaw/session-groups-active-defaults-snapshot
Sep 23, 2026
Merged

roboclaw-bot merged 2 commits into
mainfrom
openclaw/session-groups-active-defaults-snapshot

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #142863

What Problem This Solves

The group-defaults helper retained obsolete working-directory/worktree values on enriched records, forcing its caller to duplicate the replacement rule.

User Impact

No user-visible, group-ownership, schema, migration, or RPC change. The caller already cleared old defaults; the helper now owns that rule consistently.

Why This Change Was Made

Rebuild each result from its catalog name/position and the authoritative current defaults. Omitted values clear, explicit false survives, and inputs remain untouched. Remove the caller’s redundant projection and retain one composite regression instead of seven repetitive variants.

Evidence

  • Original regression failed on the baseline, then all four helper tests passed (1.57s wall; new case rounded to 0ms). The earlier 68 related cases and canonical changed-file gate passed.
  • September 23 resumed qualification: local rebase onto 0bd1624a883bbd81701c0d4eed7740b534aa4635 is patch-identical. Its complete tree equals the conflict-free composition of the public head with that main revision. The native publisher preserves hosted ancestry, so the public head remains 83a6cfd53f0a14af29653f76f4b03928eb27df78; no rewritten or empty refresh commit was published.
  • On that rebased tree, all 50 cases across the helper, catalog-migration, and grouping suites passed (2.70s Vitest; 4.78s wrapper wall). UI production types, all UI test type shards, targeted lint, formatting, and whitespace checks passed.
  • Independent P0–P2 review was scoped-clean. Current-head ClawSweeper review found no actionable issue.
  • Three files, +23/−6: 17 net lines, including three fewer production lines. The former version added 44 net lines.
  • Exact-head CI, attempt 2 passed; the required CI/security gate is green. Attempt 1 was explicitly canceled, not source-failed, and the renewed maintainer instruction authorized this single resumption. No browser/native/live-Gateway or upgrade proof is claimed for this internal-only cleanup.

Extracted from the work requested by @vyctorbrzezowski; original contributor history and credit remain preserved.

Work sessions

@clawsweeper

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

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 20, 2026 19:55
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Sep 20, 2026
@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 20, 2026
@clawsweeper

clawsweeper Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 23, 2026, 11:06 AM ET / 15:06 UTC (Revision 5).

ClawSweeper review

What this changes

The PR centralizes replacement of session-group folder and worktree defaults in the shared helper, removes duplicate caller logic, and adds a focused regression test.

Merge readiness

✅ Ready for maintainer review

Keep open as a focused, maintainer-requested cleanup. The production behavior is preserved, the consolidation remains absent from current main, and no actionable correctness or security defect was found.

Priority: P3
Reviewed head: 83a6cfd53f0a14af29653f76f4b03928eb27df78

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving cleanup with meaningful regression coverage and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The trusted internal cleanup moves an existing projection between the catalog caller and helper without changing production outputs. Reported helper and catalog tests are supplemental evidence; no live execution is claimed. 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: The trusted internal cleanup moves an existing projection between the catalog caller and helper without changing production outputs. Reported helper and catalog tests are supplemental evidence; no live execution is claimed. No stored-data contract changes.
Evidence reviewed 6 items Pinned introduced change: The merge-base-to-head diff changes only the defaults helper, its update caller, and a regression test. The caller's name-and-position projection moves into the helper without changing the resulting production records.
Complete caller inspection: All five production calls reside in the catalog owner. Load, put, rename, and delete supply records already reduced to names and positions; update previously performed that same reduction inline. Connection checks, RPC parameters, publication, and storage operations are unchanged.
Regression and existing boundary coverage: The added frozen-input case checks removal of omitted values, preservation of explicit false, catalog metadata, and input immutability. The existing catalog test already exercises clearing cwd through groupsUpdate. The captured PR body reports baseline failure and passing focused suites with measured costs; these tests were inspected but not executed during this review.
Findings None None.
Security None None.

How this fits together

The Control UI combines Gateway-provided group names and ordering with folder and worktree defaults. Its session catalog publishes those settings for sidebar and New Session consumers.

flowchart LR
  A[Gateway group catalog] --> C[Control UI catalog]
  B[Gateway defaults snapshot] --> D[Replace group defaults]
  C --> D
  D --> E[Session state]
  E --> F[Sidebar and New Session]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -3, Tests +20. Total +17 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 3 6 -3
Tests 1 20 0 +20
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 23 6 +17

Review metrics

None.

Technical review

Best possible solution:

Keep snapshot replacement in the shared helper and preserve the existing catalog, persistence, and authorization contracts.

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

Not applicable to a user-facing bug: the production caller already clears obsolete defaults. Source inspection confirms the helper-level inconsistency addressed by the new regression.

Is this the best way to solve the issue?

Yes. Moving the existing projection into the shared helper removes duplicate policy while preserving all inspected production callers' outputs.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is a bounded internal cleanup that preserves existing user behavior.
  • 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 trusted internal cleanup moves an existing projection between the catalog caller and helper without changing production outputs. Reported helper and catalog tests are supplemental evidence; no live execution is claimed. No stored-data contract changes.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head diff changes only the defaults helper, its update caller, and a regression test. The caller's name-and-position projection moves into the helper without changing the resulting production records. (ui/src/lib/sessions/custom-groups.ts:60, 83a6cfd53f0a)
  • Complete caller inspection: All five production calls reside in the catalog owner. Load, put, rename, and delete supply records already reduced to names and positions; update previously performed that same reduction inline. Connection checks, RPC parameters, publication, and storage operations are unchanged. (ui/src/lib/sessions/session-group-catalog.ts:365, 83a6cfd53f0a)
  • Regression and existing boundary coverage: The added frozen-input case checks removal of omitted values, preservation of explicit false, catalog metadata, and input immutability. The existing catalog test already exercises clearing cwd through groupsUpdate. The captured PR body reports baseline failure and passing focused suites with measured costs; these tests were inspected but not executed during this review. (ui/src/lib/sessions/session-group-migration.test.ts:173, 83a6cfd53f0a)
  • Current-main and release comparison: Fetched main still spreads enriched group records in the helper and retains the compensating projection in the update caller. The v2026.9.5 helper also retains the old implementation. This consolidation is therefore still distinct work. A broader main-tree grep could not complete because fetching an unavailable object returned HTTP 403; the relevant main and release blobs were successfully read. (ui/src/lib/sessions/custom-groups.ts:59, 60d25b947df5)
  • Feature-history routing: File history identifies Jesse Merhi's folder-group defaults work and Peter Steinberger's subsequent catalog maintenance. GitHub commit metadata verified the jesse-merhi login and supplied the relevant historical patch. Local blame and pickaxe inspection encountered unavailable-object HTTP 403 failures, so no source-line introduction attribution is asserted. (ui/src/lib/sessions/custom-groups.ts, edb5adfbf508)
  • Maintainer context and review continuity: The captured discussion for fix: session groups leak across agents #142863 explicitly retains this focused cleanup while deferring the ownership migration. The current item carries the maintainer label. The previous completed review inspected the same head and recorded no findings or published rank-up moves. No applicable maintainer-notes directory exists in this checkout. (83a6cfd53f0a)

Likely related people:

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

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-20T20:14:51.859Z sha d17b963 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-20T20:50:05.189Z sha d17b963 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-22T00:22:56.799Z sha d17b963 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-23T07:24:15.610Z sha 83a6cfd :: needs maintainer review before merge. :: none

Keep authoritative snapshot replacement in the helper and remove the caller’s duplicate projection. Retain one composite regression instead of a redundant input matrix.

Co-authored-by: vyctorbrzezowski <[email protected]>
Co-authored-by: steipete <[email protected]>
Co-authored-by: fuller-stack-dev <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: shakkernerd <[email protected]>
@roboclaw-bot
roboclaw-bot marked this pull request as draft September 23, 2026 06:31
@roboclaw-bot
roboclaw-bot changed the base branch from fix/session-groups-06-mock-fixture-preparation to main September 23, 2026 06:31
@roboclaw-bot
roboclaw-bot force-pushed the openclaw/session-groups-active-defaults-snapshot branch from d17b963 to 900f2d1 Compare September 23, 2026 06:31
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 23, 2026 06:34
@roboclaw-bot roboclaw-bot self-assigned this Sep 23, 2026
The prior test merge failed in chat/route-loader.ts because of the main-branch TS2322 regression. Main now contains 813a10e, and its exact UI and UI-E2E typechecks pass. Refresh the test merge without changing the reviewed cleanup or rewriting its ancestry.

Co-authored-by: vyctorbrzezowski <[email protected]>
Co-authored-by: steipete <[email protected]>
Co-authored-by: fuller-stack-dev <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: shakkernerd <[email protected]>
@roboclaw-bot roboclaw-bot changed the title fix: clear stale session-group defaults from complete snapshots refactor: centralize session-group defaults replacement Sep 23, 2026
@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) September 23, 2026 15:05
@roboclaw-bot
roboclaw-bot merged commit b1ec560 into main Sep 23, 2026
131 of 201 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/session-groups-active-defaults-snapshot branch September 23, 2026 15:12
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 24, 2026
)

Centralize authoritative group-default snapshot replacement in the existing helper. Remove the caller’s duplicate projection and retain one frozen-input regression covering omission, explicit false, metadata retention and nonmutation.

No group-ownership, schema, protocol or appearance change. The cleanup reduces production code by three lines.

Implementation and verification: https://team.openclaw.ai/chat/roboclaw/839d1724
Original discussion: https://team.openclaw.ai/chat/roboclaw/dashboard/28feaf46-a23c-468e-bfad-ab44a1d5ac7b

Co-authored-by: vyctorbrzezowski <[email protected]>
Co-authored-by: steipete <[email protected]>
Co-authored-by: fuller-stack-dev <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: shakkernerd <[email protected]>
@roboclaw-bot roboclaw-bot mentioned this pull request Sep 24, 2026
2 of 8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui 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