Skip to content

feat(gateway): session worktree targeting, branch listing, and server-side session groups#103432

Merged
steipete merged 4 commits into
mainfrom
feat/sessions-worktree-foundation
Jul 10, 2026
Merged

feat(gateway): session worktree targeting, branch listing, and server-side session groups#103432
steipete merged 4 commits into
mainfrom
feat/sessions-worktree-foundation

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #103431

What Problem This Solves

Session lists cannot show which sessions run in an isolated checkout or on which branch, worktree sessions always get an auto-generated branch off origin/HEAD with no way to pick a base ref or name, custom session groups live half in browser localStorage (catalog/order do not sync across devices; rename/delete page through every session client-side), group sessions display token names like slack:g-general instead of the stored chat title, and dirty worktrees silently outlive deleted sessions. This is the protocol/server foundation for the Control UI sessions-sidebar redesign tracked in #103431.

Why This Change Was Made

Persist the worktree binding on the session entry (worktree { id, branch, repoRoot }, set and cleared together with spawnedCwd) and project it plus the existing execNode binding onto session rows, so clients stop depending on the one-shot create response. sessions.create gains additive worktreeBaseRef/worktreeName at write scope and execNode at admin scope (matching the sessions.patch execNode bar). A new worktrees.branches RPC lists local/remote branches without fetching, for base-ref pickers. The custom group catalog moves into the shared SQLite state DB behind sessions.groups.list/put/rename/delete; membership stays on each session's category field, rename/delete update members server-side without bumping recency ordering, and sessions.patch absorbs ad-hoc categories so the catalog covers everything operator UIs observe. Group display names now prefer the human chat title (subject or space #channel) over the stored compact token. worktrees.remove stops dropping snapshotError, and sessions.delete reports preserved dirty checkouts as worktreePreserved.

User Impact

Operator clients can show repo/branch/node state per session, offer branch pickers for new worktree sessions, and keep custom group order consistent across devices. Group chats list under their real titles ("Engineering", "Acme #general"). No behavior changes for plain New Chat, /new, or channel routing; all new protocol surface is additive and scope-gated.

Evidence

  • pnpm test src/gateway/session-groups.test.ts src/agents/worktrees/service.test.ts packages/gateway-protocol/src/schema/worktrees.test.ts src/config/sessions/group.test.ts src/gateway/method-scopes.test.ts — all shards green (Blacksmith Testbox).
  • pnpm test src/gateway/server.sessions.create.test.ts src/gateway/server.sessions.store-rpc.test.ts src/gateway/session-utils.test.ts — 550 tests green, including new coverage: worktree base-ref/name creation persists entry.worktree and checks out the requested base commit, execNode binds execHost=node, groups CRUD + rename repoints member categories without touching updatedAt, absorbed categories appear in sessions.groups.list, group rows prefer subject/#channel titles, and method scopes keep execNode/cwd at admin while worktree targeting stays at write.
  • pnpm check:changed (Testbox): typecheck core + core tests green; lint clean after fixing the one no-array-sort finding.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels Jul 10, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 757c98e3b9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/worktrees/service.ts Outdated
Comment on lines +496 to +501
const name = withoutPrefix.slice(slash + 1);
// remote HEAD symrefs are pointers, not selectable branches.
if (!name || name === "HEAD") {
continue;
}
branches.set(name, { name, kind: "remote" });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Return remote refs that worktree creation can consume

When the only selectable branch is remote-only (for example origin/feature-a), this strips the remote and returns feature-a; clients then pass that value back as worktreeBaseRef. git worktree add -h documents --guess-remote as matching a new branch with a remote-tracking branch, and with git 2.43 the later git worktree add <path> -b openclaw/<name> feature-a creates/checks out local branch feature-a instead of openclaw/<name>. The registry still records openclaw/<name>, so subsequent remove/restore branch operations fail and leave the checkout behind; return a creatable ref such as origin/feature-a or add a separate ref field.

Useful? React with 👍 / 👎.

Comment on lines +111 to +113
// Read-only git probe, but it accepts arbitrary host paths; keep it at the
// same bar as starting worktree sessions instead of plain read scope.
{ name: "worktrees.branches", scope: "operator.write" },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Require admin for arbitrary branch probes

This classifies worktrees.branches as operator.write, but the handler accepts caller-supplied repoRoot and passes it directly to service.listRepositoryBranches(params.repoRoot). That differs from sessions.create, where arbitrary host paths via cwd are admin-only and write scope is limited to configured workspaces; a write-scoped gateway client can now probe any path on the host for git checkout existence and branch/default/current names. Either require operator.admin here or constrain repoRoot to configured agent workspaces before keeping write scope.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 38123d382c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +2605 to +2607
worktreebaseref: String?,
worktreename: String?,
execnode: String?,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep Swift create params source-compatible

OpenClawProtocol is exported as a public SwiftPM library in apps/shared/OpenClawKit/Package.swift, so adding these optional protocol fields as non-defaulted public init parameters source-breaks existing Swift clients that construct SessionsCreateParams with the previous initializer; they now must pass three extra nil arguments even when not using worktree targeting or exec-node binding. Give the new optional parameters default nil values or add a compatibility overload so this additive protocol change remains additive for Swift callers.

Useful? React with 👍 / 👎.

) {
return;
}
respond(true, { ok: true, groups: putSessionGroups(params.names) }, undefined);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Broadcast group catalog changes

When an operator creates or reorders the server-side group catalog from one client, this persists via putSessionGroups but sends no sessions.changed broadcast; the protocol adds no separate group-change event, and the rename/delete handlers below only broadcast when member sessions changed. Other connected dashboards that already fetched the catalog will keep stale group names/order until reconnect or manual refresh, so emit a reason: "groups" change for catalog mutations even when no session rows were updated.

Useful? React with 👍 / 👎.

steipete added 3 commits July 10, 2026 01:04
…catalog

- sessions.create accepts worktreeBaseRef/worktreeName (write scope) and
  execNode (admin); worktree binding persists on the session entry as
  worktree { id, branch, repoRoot } and projects onto session rows with
  execNode so UIs can show checkout/branch/node state
- new worktrees.branches RPC lists local/remote branches (no fetch) for
  base-ref pickers; worktrees.remove now reports snapshotError
- sessions.delete reports preserved dirty checkouts as worktreePreserved
- gateway-owned session group catalog in the shared state DB with
  sessions.groups.list/put/rename/delete; rename/delete update member
  categories server-side without bumping recency; sessions.patch absorbs
  ad-hoc categories into the catalog
- group session display names prefer the human chat title (subject or
  space #channel) over stored compact tokens

Part of #103431
…or and regen protocol models

- bulk member-category rename/clear uses applySessionEntryReplacements
  instead of legacy updateSessionStore call sites (session accessor
  boundary guard)
- regenerate Swift GatewayModels for the worktrees.branches schemas,
  snapshotError, and new sessions.create params

Part of #103431
…ch listing

- worktrees.branches returns remote-only branches remote-qualified
  (origin/feature-a) so every advertised name works as a worktree base ref
- write-scoped worktrees.branches callers are limited to configured agent
  workspaces; other host paths require operator.admin, matching the
  sessions.create cwd bar

Part of #103431
@steipete
steipete force-pushed the feat/sessions-worktree-foundation branch from 38123d3 to a6afa58 Compare July 10, 2026 08:19

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a6afa58471

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 1344 to +1347
repoRoot: workspace,
ownerKind: "session",
ownerId: target.canonicalKey,
name: requestedWorktreeName,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject worktree names already owned by another session

When worktreeName matches any existing live managed worktree in the same repo, managedWorktrees.create() returns that existing registry row by path before considering ownerKind/ownerId. In this new session path, that lets a second session adopt a manual or other-session checkout, ignores the requested worktreeBaseRef, and later cleanup/delete uses findLiveByOwner("session", target.canonicalKey) so it will not release or remove the checkout for this session. Validate the returned record is owned by this session, or make the service reject/reassign cross-owner name collisions.

Useful? React with 👍 / 👎.

…transactions

- managedWorktrees.create rejects a caller-chosen name whose live or
  restorable record belongs to a different owner, so write-scoped
  sessions.create cannot bind a session into another session's or a
  manual checkout
- session group catalog writes run their SQLite transaction on the same
  env-scoped handle as their statements, keeping OPENCLAW_STATE_DIR
  overrides atomic and away from the default state DB

Part of #103431

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9bbb1b4efa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

});
respond(true, { ok: true, ...result }, undefined);
if (result.updatedSessions > 0) {
emitSessionsChanged(context, { reason: "groups" });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Emit parseable events for group member updates

When a group rename updates member sessions, this broadcasts only { reason: "groups" }. The existing session clients I checked (ui/src/lib/sessions/reconcile.ts) discard sessions.changed payloads that lack a key or sessionKey before reconciling, so another open dashboard ignores this event and keeps the old categories until it performs a full refresh; the delete handler uses the same keyless broadcast. Emit a dedicated group-change event or per-session changes for the updated members.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Jul 10, 2026
@clawsweeper

clawsweeper Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 10, 2026, 6:54 AM ET / 10:54 UTC.

Summary
Adds gateway RPCs and shared-state persistence for branch-targeted worktree sessions and custom session groups, projects worktree/node metadata onto session rows, extends cleanup results and generated Swift models, and updates docs and tests.

PR surface: Source +787, Tests +542, Docs +4, Generated +16, Other +172. Total +1521 across 35 files.

Reproducibility: yes. Source inspection shows successful put/reorder sends no catalog event and zero-member rename/delete sends none, while the dependent client reloads its separate group state only on reason: "groups".

Review metrics: 3 noteworthy metrics.

  • Public protocol additions: 4 group RPCs, 1 branch RPC, 3 create parameters. These become compatibility-sensitive gateway and generated-client contracts that require an intentional permanent API decision.
  • Persistent schema additions: 1 SQLite table added. Existing installations must open and use the additive shared-state schema safely during upgrade.
  • Cross-client invalidation coverage: 0 complete catalog-mutation paths. Put/reorder emits no invalidation and rename/delete skip it when no session membership changes.

Stored data model
Persistent data-model change detected: database schema: packages/gateway-protocol/src/schema/worktrees.test.ts, database schema: src/state/openclaw-state-schema.generated.ts, database schema: src/state/openclaw-state-schema.sql, serialized state: packages/gateway-protocol/src/schema/sessions.ts, serialized state: src/agents/worktrees/service.test.ts, serialized state: src/config/sessions/group.ts, and 19 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #103431
Summary: This PR is the protocol/server implementation candidate for the canonical sessions-sidebar redesign and directly underpins two open stacked UI PRs.

Members:

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

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦐 gold shrimp
Patch quality: 🦐 gold shrimp
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add a focused server/client fix and two-connected-client proof for create, reorder, rename, and delete, with private details redacted.
  • Link exact-head live output showing branch-targeted worktree creation, persisted session metadata, dirty-checkout preservation, and cleanup.
  • Rebase on current main after the functional change, then refresh the exact-head review.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The dependent UI PR describes a live branch-targeted worktree run, but this PR provides no directly inspectable exact-head two-client synchronization proof and its own evidence is otherwise test or CI based; add redacted proof, update the PR body, and request @clawsweeper re-review if a fresh review does not start automatically.

Risk before merge

  • [P1] Connected dashboards can disagree about custom group names and order after successful create, reorder, rename, or delete operations until they reconnect or manually reload.
  • [P1] The PR establishes permanent public gateway/generated-client APIs and a persistent state model; green CI does not settle whether maintainers want this complete core surface or a narrower contract.
  • [P1] The branch is behind current main, so it needs a review refresh or rebase after the functional blocker is fixed; the stale base alone is not evidence of merged-code deletion.

Maintainer options:

  1. Fix and prove the full foundation (recommended)
    Emit unconditional group-catalog invalidation, add two-client coverage, rebase, and provide exact-head fresh-install and upgrade proof before merge.
  2. Accept the synchronization gap temporarily
    Merge the API stack knowing connected clients may show divergent custom groups until reconnect, with maintainers explicitly owning that user-visible inconsistency.
  3. Pause the feature stack
    Close or defer the stacked branches if the permanent protocol and state surface is not worth the compatibility and maintenance cost.

Next step before merge

  • [P1] A narrow repair is identifiable, but the protected maintainer label and unresolved permanent core API decision require explicit human handling before any repair lane is promoted.

Maintainer decision needed

  • Question: Should OpenClaw core permanently own this combined session-group catalog and worktree-targeting gateway protocol as the foundation for the linked Control UI redesign?
  • Rationale: The PR adds multiple public RPCs, generated-client parameters, and persistent shared state under a protected maintainer label; correctness can be repaired mechanically, but automation cannot decide the long-term core product and API boundary.
  • Likely owner: steipete — The history shows the strongest ownership across the affected gateway, worktree, state, and protocol surfaces, and this person authored the linked feature stack.
  • Options:
    • Accept after synchronization fix (recommended): Keep the proposed core foundation, repair unconditional group invalidation, and require exact-head upgrade and live multi-client proof before merge.
    • Narrow the foundation: Land only the worktree and session-metadata APIs and redesign the custom group catalog contract separately before exposing it publicly.
    • Pause the stack: Hold this PR and its dependent UI branches until maintainers choose a smaller session-management direction.

Security
Cleared: The latest head scopes arbitrary branch probes to configured workspaces or admins and rejects cross-owner worktree reuse; no concrete security or supply-chain regression remains.

Review findings

  • [P2] Broadcast every group catalog mutation — src/gateway/server-methods/sessions.ts:2621
Review details

Best possible solution:

Keep the gateway-owned SQLite catalog, but emit one unconditional catalog invalidation after every successful put, rename, and delete, retain canonical session-row refresh for membership changes, and land only after exact-head two-client and worktree-lifecycle proof plus maintainer confirmation of the permanent protocol surface.

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

Yes. Source inspection shows successful put/reorder sends no catalog event and zero-member rename/delete sends none, while the dependent client reloads its separate group state only on reason: "groups".

Is this the best way to solve the issue?

No on the current head. Gateway ownership and SQLite storage are the clean boundary, but the advertised cross-device behavior requires an unconditional catalog-invalidation contract rather than conditional session-row signaling.

Full review comments:

  • [P2] Broadcast every group catalog mutation — src/gateway/server-methods/sessions.ts:2621
    Emit the existing reason: "groups" invalidation after every successful put, rename, and delete. The dependent client keeps this catalog separately and reloads it only on that event, so create/reorder and empty-group rename/delete remain stale on other connected devices.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 7d87cedcda21.

Label changes

Label changes:

  • add P2: This unreleased feature has a concrete multi-client synchronization blocker but does not represent an urgent current-user regression.
  • add merge-risk: 🚨 compatibility: The PR adds public gateway/generated-client contracts and persistent shared state that existing clients and installations must tolerate across upgrades.
  • add merge-risk: 🚨 session-state: The current notification contract can leave connected clients with stale server-owned session-group state after successful mutations.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The dependent UI PR describes a live branch-targeted worktree run, but this PR provides no directly inspectable exact-head two-client synchronization proof and its own evidence is otherwise test or CI based; add redacted proof, update the PR body, and request @clawsweeper re-review if a fresh review does not start automatically.

Label justifications:

  • P2: This unreleased feature has a concrete multi-client synchronization blocker but does not represent an urgent current-user regression.
  • merge-risk: 🚨 compatibility: The PR adds public gateway/generated-client contracts and persistent shared state that existing clients and installations must tolerate across upgrades.
  • merge-risk: 🚨 session-state: The current notification contract can leave connected clients with stale server-owned session-group state after successful mutations.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The dependent UI PR describes a live branch-targeted worktree run, but this PR provides no directly inspectable exact-head two-client synchronization proof and its own evidence is otherwise test or CI based; add redacted proof, update the PR body, and request @clawsweeper re-review if a fresh review does not start automatically.
Evidence reviewed

PR surface:

Source +787, Tests +542, Docs +4, Generated +16, Other +172. Total +1521 across 35 files.

View PR surface stats
Area Files Added Removed Net
Source 21 798 11 +787
Tests 9 547 5 +542
Docs 2 13 9 +4
Config 0 0 0 0
Generated 2 17 1 +16
Other 1 173 1 +172
Total 35 1548 27 +1521

What I checked:

  • Missing catalog invalidation: The put handler persists catalog creation or reordering without emitting the reason: "groups" invalidation consumed by connected clients. (src/gateway/server-methods/sessions.ts:2621, 9bbb1b4efaed)
  • Conditional invalidation: Rename and delete emit the group invalidation only when member session rows changed, so empty-group mutations also remain stale on other clients. (src/gateway/server-methods/sessions.ts:2641, 9bbb1b4efaed)
  • Stacked client contract: The dependent sidebar client stores groups separately and reloads sessions.groups.list only when a session event carries reason: "groups", confirming that omitted notifications cause stale cross-client state. (ui/src/lib/sessions/index.ts:1282, d79a2a6bf18e)
  • Prior review fixes: Later head commits corrected remote-only branch refs, arbitrary-path branch-probe authorization, generated Swift initializer defaults, cross-owner worktree reuse, and env-scoped SQLite transactions; those earlier review threads are outdated on the current head. (src/agents/worktrees/service.ts:370, 9bbb1b4efaed)
  • Additive state bootstrap: The shared state database executes the generated CREATE TABLE IF NOT EXISTS schema during open, so the new table follows the existing additive startup path rather than creating a parallel store. (src/state/openclaw-state-db.ts:932, 9bbb1b4efaed)
  • Current-main necessity: Current main lacks the new session-group RPCs and worktree-targeting parameters, so the central work is not already implemented or superseded. (packages/gateway-protocol/src/schema/sessions.ts:256, 7d87cedcda21)

Likely related people:

  • steipete: Authored this stack and has the highest historical contribution count across the central gateway, worktree, state, and protocol files, including earlier refactors in these paths. (role: feature and recent area owner; confidence: high; commits: 8f54c5f6e08e, e7d33b4870f7, 9e0d35869521; files: src/gateway/server-methods/sessions.ts, src/agents/worktrees/service.ts, src/state/openclaw-state-db.ts)
  • Takhoffman: Recent merged work repeatedly maintained session-row persistence and sessions.changed metadata, making this person relevant to the event contract and synchronization repair. (role: session event history contributor; confidence: high; commits: 1fee91e431c7, c326083ad8fd, 2b6375faf9f8; files: src/gateway/server-methods/sessions.ts, src/gateway/session-utils.ts)
  • jalehman: Recent merged changes maintained session-creation aliases and lifecycle metadata in the same gateway session surface. (role: session lifecycle contributor; confidence: medium; commits: 1c83e2eec727, 2b28e758222c; files: src/gateway/server-methods/sessions.ts, src/gateway/session-create-service.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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 48b0f4e into main Jul 10, 2026
137 of 142 checks passed
@steipete
steipete deleted the feat/sessions-worktree-foundation branch July 10, 2026 14:51
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 11, 2026
…-side session groups (openclaw#103432)

* feat(gateway): session worktree targeting, branch listing, and group catalog

- sessions.create accepts worktreeBaseRef/worktreeName (write scope) and
  execNode (admin); worktree binding persists on the session entry as
  worktree { id, branch, repoRoot } and projects onto session rows with
  execNode so UIs can show checkout/branch/node state
- new worktrees.branches RPC lists local/remote branches (no fetch) for
  base-ref pickers; worktrees.remove now reports snapshotError
- sessions.delete reports preserved dirty checkouts as worktreePreserved
- gateway-owned session group catalog in the shared state DB with
  sessions.groups.list/put/rename/delete; rename/delete update member
  categories server-side without bumping recency; sessions.patch absorbs
  ad-hoc categories into the catalog
- group session display names prefer the human chat title (subject or
  space #channel) over stored compact tokens

Part of openclaw#103431

* fix(gateway): route group category updates through the session accessor and regen protocol models

- bulk member-category rename/clear uses applySessionEntryReplacements
  instead of legacy updateSessionStore call sites (session accessor
  boundary guard)
- regenerate Swift GatewayModels for the worktrees.branches schemas,
  snapshotError, and new sessions.create params

Part of openclaw#103431

* fix(gateway): resolvable remote branch refs and workspace-scoped branch listing

- worktrees.branches returns remote-only branches remote-qualified
  (origin/feature-a) so every advertised name works as a worktree base ref
- write-scoped worktrees.branches callers are limited to configured agent
  workspaces; other host paths require operator.admin, matching the
  sessions.create cwd bar

Part of openclaw#103431

* fix(gateway): guard worktree name reuse by owner and env-scope group transactions

- managedWorktrees.create rejects a caller-chosen name whose live or
  restorable record belongs to a different owner, so write-scoped
  sessions.create cannot bind a session into another session's or a
  manual checkout
- session group catalog writes run their SQLite transaction on the same
  env-scoped handle as their statements, keeping OPENCLAW_STATE_DIR
  overrides atomic and away from the default state DB

Part of openclaw#103431
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant