Skip to content

fix(sessions): Incognito reset leaves the session's managed worktree behind - #165185

Merged
obviyus merged 3 commits into
openclaw:mainfrom
jayzhou2309:fix/incognito-reset-worktree-removal
Oct 8, 2026
Merged

obviyus merged 3 commits into
openclaw:mainfrom
jayzhou2309:fix/incognito-reset-worktree-removal

Conversation

@jayzhou2309

@jayzhou2309 jayzhou2309 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Related: #159304

What Problem This Solves

Fixes: resetting an Incognito session that owns a managed worktree leaves that checkout on disk and live in the worktree registry after the session is gone, while deleting the same session removes it.

User Impact

User impact: an Incognito reset now removes the session's managed worktree the same way an Incognito delete does. Uncommitted work is snapshotted first. A checkout that cannot be removed safely (a live run lease, an owner mismatch, a failed snapshot) is kept, and the reset response reports it as worktreePreserved, the same way sessions.delete does. Durable sessions, and resets of sessions with no worktree, are unchanged.

Why This Change Was Made

#159304 lists the teardown steps that sessions.delete runs and Incognito sessions.reset skips. #159207 fixed the terminal row. This PR fixes the "physical worktree removal" row only. The controller, partial-persistence, and worker-inference drain rows stay open on the issue.

sessions.delete calls removeSessionWorktree after the row is deleted. The Incognito branch of performGatewaySessionReset deleted the row through deleteIncognitoSessionForReset and returned without that call. The fix adds the same call at the same point (after handleSessionStateSessionDeleted, inside the reset lifecycle mutation), with reason session-reset. The worktree id comes from the entry captured before deletion. deleteIncognitoSessionForReset deletes only when the stored row, its worktree included, still equals that entry, so the id always belongs to the deleted row.

How an Incognito session gets a worktree. A hidden native subagent spawned from an Incognito parent is itself Incognito and can own a managed worktree. sessions_spawn without visible: true passes worktree to spawnSubagentDirect (src/agents/tools/sessions-spawn-tool.ts:619). The child key gets :subagent:incognito- when the requester is Incognito (src/agents/subagents/spawn/subagent-spawn-child-plan.ts:94). The child row goes to the Incognito store with a pendingWorktree (src/agents/subagents/spawn/subagent-spawn-session-patch.ts:152 and :207). The child's first turn then creates the checkout and binds it to the row (src/gateway/agent-turn/agent-run-execution-phase.ts:277, which calls prepareSessionWorkspaceForRun in src/gateway/server-methods/session-create-project.ts). An earlier version of this description said no production path creates such a session. That was wrong. It was based on the dashboard sessions.create path, which does reject Incognito with worktree: true ("incognito sessions are web-only"). The hidden spawn path does not go through that check. The live run below uses it.

When removeSessionWorktree keeps the checkout, the reset result carries its { id, branch, path, reason } as worktreePreserved, and the sessions.reset handler adds it to the Incognito response, as sessions.delete does. sessions.reset has no result schema, so this needs no protocol change.

Evidence

  • Red first. Commit 649f02c4bca adds sessions.reset removes an Incognito session worktree like sessions.delete to src/gateway/server.sessions.delete-worktree-lifecycle.test.ts. It creates an Incognito session, binds a session-owned managed worktree to its row, and resets it. On upstream/main 989bd3f, the reset succeeds and the row is deleted, but the registry record has no removedAt and the checkout is still there (1 failed). With sessions.delete in place of sessions.reset, the same setup passes. That shows the gap is in reset only.
  • With the fix (57b3973e47c), the new test passes.
  • Review follow-up (1a7532e9078). A second test, sessions.reset reports a preserved Incognito worktree like sessions.delete, holds a live run lease on the worktree and resets the session. Before that commit the response had no worktreePreserved. After it, the response reports the checkout with reason busy, and the checkout and its registry record stay.
  • The touched area passes: all server.sessions.reset-* files, delete-worktree-lifecycle, create.incognito, incognito-lifetime, archive-terminal, and the two server-close.incognito-* files. That is 14 files and 121 tests through scripts/test-projects.mts.
  • oxfmt --check, oxlint -c .oxlintrc.json, and git diff --check are clean on the changed files. tsgo passes for core and for all 21 src test shards.
  • autoreview (Codex) is scoped-clean, with the verdict "patch is correct". A second model checked the lifecycle fence, the captured worktree id, the throw behavior, and snapshot safety, and found no defect.

Real behavior proof

Two real Gateways, one built from the merge base (96ccec4) and one from this branch (b89dde4cb61). Each was started with openclaw gateway run --auth token --port 19789 --bind loopback on a fresh OPENCLAW_STATE_DIR whose agent workspace is a new Git repo. Calls went through openclaw gateway call. Two config entries make the run possible without a paid model:

  • gateway.tools.allow: ["sessions_spawn"], so tools.invoke can call the same sessions_spawn tool a model would call. It is on the default HTTP deny list otherwise.
  • A local OpenAI-compatible stub on 127.0.0.1 as the default model (models.providers.stub, api: "openai-completions"). It answers every chat completion with a fixed text, so the child's first turn runs to stopReason=stop.

Steps, identical on both builds:

  1. sessions.create {agentId: "main", incognito: true} returns agent:main:dashboard:incognito-<id>.
  2. tools.invoke {name: "sessions_spawn", sessionKey: <parent>, args: {task, worktree: true, label: "proof child"}} returns status: "accepted" and childSessionKey: agent:main:subagent:incognito-<id>. The log shows managed worktree preparation kind=managed ... outcome=returned during the child's first turn.
  3. worktrees.list and git worktree list before the reset.
  4. sessions.reset {key: <child>} returns {ok: true, deleted: true} on both.
  5. worktrees.list, git worktree list, and git branch after the reset.
After sessions.reset of the Incognito child Merge base 96ccec4 This branch b89dde4cb61
Checkout state/worktrees/<repo>/proof-child before reset present present
Checkout after reset present missing
git worktree list in the workspace main and proof-child [openclaw/proof-child] main only
Branch openclaw/proof-child kept removed
Registry record (worktrees.list) ownerKind: session, owner is the child key, no removedAt, no snapshotRef same owner, removedAt set, snapshotRef: refs/openclaw/snapshots/<id>

Redacted terminal output from this branch:

build: b89dde4cb61
parent: agent:main:dashboard:incognito-7a1c4c46-...
sessions_spawn: child=agent:main:subagent:incognito-b99926f2-... accepted
managed worktree preparation kind=managed template=unavailable outcome=returned durationMs=664 phaseDurationsMs={"allocate":119,"checkout":145}
registry before reset: {'ownerKind': 'session', 'ownerId': 'agent:main:subagent:incognito-b99926f2-...', 'branch': 'openclaw/proof-child', 'removedAt': None, 'snapshotRef': None}
checkout before reset: present state/worktrees/e00012213124c7f0/proof-child
sessions.reset: {"ok": true, "key": "agent:main:subagent:incognito-b99926f2-...", "deleted": true}
registry after reset: {'ownerKind': 'session', 'ownerId': 'agent:main:subagent:incognito-b99926f2-...', 'branch': 'openclaw/proof-child', 'removedAt': 1791384614694, 'snapshotRef': 'refs/openclaw/snapshots/de20966c-...'}
checkout after reset: missing state/worktrees/e00012213124c7f0/proof-child
ws  97624f9 [main]
branches: main

And from the merge base:

build: 96ccec4a138
sessions_spawn: child=agent:main:subagent:incognito-db47c30f-... accepted
managed worktree preparation kind=managed template=unavailable outcome=returned durationMs=641 phaseDurationsMs={"allocate":118,"checkout":157}
sessions.reset: {"ok": true, "key": "agent:main:subagent:incognito-db47c30f-...", "deleted": true}
registry after reset: {'ownerKind': 'session', 'ownerId': 'agent:main:subagent:incognito-db47c30f-...', 'branch': 'openclaw/proof-child', 'removedAt': None, 'snapshotRef': None}
checkout after reset: present state/worktrees/e00012213124c7f0/proof-child
state/worktrees/e00012213124c7f0/proof-child  2db4b2f [openclaw/proof-child]
branches: main openclaw/proof-child

The model in this run is a stub, and the spawn came from tools.invoke rather than a model's tool call. Both reach the same sessions_spawn tool and the same native spawn, first-turn, and reset code. The preserved-worktree branch (live run lease) is covered by the second test above, not by this live run.

Test cost

Local runs of src/gateway/server.sessions.delete-worktree-lifecycle.test.ts with node scripts/run-vitest.mjs, one run each on a busy laptop. Merge base 96ccec4: 8 tests, 66s. This branch: 10 tests, 108s warm. The two new tests take 18.5s and 14.8s when run alone. CI seconds were not measured.

AI disclosure: an AI agent (Claude Code) found the gap in source, reproduced it with the test above (plus the sessions.delete control run), wrote the test and the fix, ran autoreview and a second-model review, and ran these gates: node scripts/run-vitest.mjs on the new test, node --import ./scripts/tsx.mjs scripts/test-projects.mts on the 14 files listed, oxfmt --check, oxlint -c .oxlintrc.json, scripts/run-tsgo.mjs -p tsconfig.core.json, scripts/run-tsgo-core-test-shards.mjs src, and git diff --check. On 2026-10-07 it measured the test timings above and ran the live Gateway proof on the merge base and this branch, with the local stub model and the config described there.

🤖 Written and posted by an AI agent (Claude Code) on behalf of @jayzhou2309.

Maintainer verification

No overlap with Pash/Sarah changes.

Built and exercised the real Gateway in isolated Docker against current main bcc3b58b7c614209c6ce01358087c40cca4aeaf1 and candidate 109f8b97f14d0b4246107841fe32fa783868a699. The flow used sessions.create, tools.invoke → sessions_spawn with a managed worktree, a completed first turn, and sessions.reset in a new Git workspace.

  • Current main: reset returned deleted: true, but the Incognito checkout, Git worktree registration, and branch survived.
  • Candidate: reset removed the checkout, Git registration, and branch; the registry retained the removal receipt and snapshot. Reading unsaved.txt from the snapshot returned its original contents.
  • Non-Incognito control on both builds: reset retained the same session ID, managed worktree binding, checkout, Git registration, and branch.
  • Candidate core tsgo passed. A separate real gpt-5-mini CLI turn with low reasoning and a 4096-token output budget returned LIVE_GATE_OK.

The lifecycle reproduction uses a local model stub; the separate provider gate uses the real provider. The patch does not change transcript handling or expand reset deletion beyond the session-owned managed worktree and its branch. The broader issue remains related, not closed by this partial repair.

Merge danger: a one-way filesystem cleanup for affected Incognito resets, mitigated by the existing retained snapshots. Reverting stops future cleanup but does not recreate removed checkouts. Blast radius is Incognito sessions owning managed worktrees; durable reset behavior is unchanged.

@clawsweeper

clawsweeper Bot commented Oct 4, 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 Oct 4, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 4, 2026
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 7, 2026, 2:02 PM ET / 18:02 UTC (Revision 12).

ClawSweeper review

What this changes

Resetting an Incognito session now removes its managed Git checkout safely and returns recovery details when cleanup preserves it.

Merge readiness

✅ Ready for maintainer review

This PR remains necessary: current main and the latest stable release still omit Incognito reset worktree cleanup. The bounded repair has sufficient runtime proof and no blocking findings.

Priority: P2
Reviewed head: 109f8b97f14d0b4246107841fe32fa783868a699

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful real Gateway proof, safety-preserving reuse, and no blocking findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The supplied terminal trace exercises real Gateway spawn, first-turn worktree creation, and reset, observing checkout removal, branch removal, and a retained snapshot afterward. The proven service and regression blobs match the current head; the RPC refactor preserves their output. No stored schema or serialization contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The supplied terminal trace exercises real Gateway spawn, first-turn worktree creation, and reset, observing checkout removal, branch removal, and a retained snapshot afterward. The proven service and regression blobs match the current head; the RPC refactor preserves their output. No stored schema or serialization contract changes.
Evidence reviewed 10 items Pinned introduced change: The merge-base-to-head patch adds cleanup after successful Incognito deletion, propagates preservation details through the RPC response, and adds removal and busy-lease regressions.
Still missing on current main: The inspected Incognito branch deletes the row and publishes notifications without calling removeSessionWorktree. The merged neighboring worktree refactor did not implement this reset cleanup.
Latest stable release check: GitHub source inspection at v2026.9.8 confirmed its Incognito reset branch also omits worktree removal; the service contains no removeSessionWorktree reference.
Findings None None.
Security None None.

How this fits together

The Gateway coordinates session reset and deletion across runtime resources and stored session state. Managed worktree cleanup snapshots the session’s Git checkout before removal and reports any checkout retained for safety.

flowchart TD
 A[Incognito reset request] --> B[Session lifecycle fence]
 B --> C[Delete exact session row]
 C --> D[Managed checkout cleanup]
 D --> E{Safe to remove?}
 E -->|Yes| F[Snapshot and remove checkout]
 E -->|No| G[Preserve checkout and report details]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +20, Tests +114. Total +134 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 22 2 +20
Tests 1 115 1 +114
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 137 3 +134

Review metrics

Metric Value Why it matters
Reported regression-suite cost 66s before → 108s after; new cases 18.5s and 14.8s The real Git lifecycle regressions add measurable execution cost; CI seconds remain unmeasured in the supplied evidence.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #159304
Summary: This PR is a candidate fix for the worktree-cleanup portion of the broader Incognito lifecycle issue.

Members:

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

Technical review

Best possible solution:

Use the existing deletion cleanup owner for Incognito reset while preserving snapshot safety and visible recovery details.

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

Yes: current-main source exposes the missing cleanup, and the supplied before/after Gateway transcript exercises hidden Incognito spawn followed by reset. This reviewer did not execute a current-main reproduction.

Is this the best way to solve the issue?

Yes: the patch reuses the established cleanup owner and its safety checks, with additive preservation reporting and focused regressions.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs a bounded Incognito cleanup leak without changing durable-session reset 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. Sufficient (terminal): The supplied terminal trace exercises real Gateway spawn, first-turn worktree creation, and reset, observing checkout removal, branch removal, and a retained snapshot afterward. The proven service and regression blobs match the current head; the RPC refactor preserves their output. No stored schema or serialization contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied terminal trace exercises real Gateway spawn, first-turn worktree creation, and reset, observing checkout removal, branch removal, and a retained snapshot afterward. The proven service and regression blobs match the current head; the RPC refactor preserves their output. No stored schema or serialization contract changes.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head patch adds cleanup after successful Incognito deletion, propagates preservation details through the RPC response, and adds removal and busy-lease regressions. (src/gateway/session-reset-service.ts:1034, 109f8b97f14d)
  • Still missing on current main: The inspected Incognito branch deletes the row and publishes notifications without calling removeSessionWorktree. The merged neighboring worktree refactor did not implement this reset cleanup. (src/gateway/session-reset-service.ts:1028, 24d311dcf66d)
  • Latest stable release check: GitHub source inspection at v2026.9.8 confirmed its Incognito reset branch also omits worktree removal; the service contains no removeSessionWorktree reference. (src/gateway/session-reset-service.ts, fc23bc864e45)
  • Existing cleanup authority and snapshot safeguards: The shared cleanup owner checks exact session ownership and live registry generations, carries guards into Git effects, and supplies worker-side ownership predicates. Removal retains checkout custody, excludes live run leases, and refuses snapshot loss by default. Reset keeps its lifecycle fence through this call; expected-entry deletion binds the captured worktree to the deleted row. (src/sessions/session-worktree-lifecycle.ts:67, 109f8b97f14d)
  • Real Gateway before-and-after proof: The captured PR body records real Gateway calls creating an Incognito parent, spawning a hidden Incognito child with a managed worktree, running its first turn, and resetting it. Before the fix the checkout and branch survived; afterward the checkout and branch were removed and the registry recorded removedAt and snapshotRef. The local model stub does not replace the spawn, reset, registry, or Git owners. Busy preservation is supplemental regression coverage rather than a claimed live scenario. (src/gateway/session-reset-service.ts:1034, b89dde4cb611)
  • Proof continuity across updated head: GitHub blob identities show the proven reset service and regression file are byte-identical at the previous reviewed head and current head. The old RPC handler was read through GitHub and compared with the checkout: its response and delete-event behavior survive the current handler restructuring. The unavailable local older-head object was inspected through GitHub instead. (src/gateway/server-methods/sessions-mutations.ts:637, 109f8b97f14d)

Likely related people:

  • steipete: 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 (11 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-05T12:55:56.320Z sha 70334fc6b2fd204d81649ae372bb442a840a2f4f :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-05T13:22:11.463Z sha 2851b991654eb9658c86fc84e978cc0dbf89d751 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-05T22:15:48.516Z sha 0a43830548590e863216d34934a086afcdae7922 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-05T22:43:31.740Z sha b5792ef0cb6fec6329f32edba3ef1a74530f4333 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-05T23:24:29.350Z sha 40946f09e8050cf74e3f204f2247c025af461e2c :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-07T14:02:55.756Z sha b89dde4cb6112739452741ea49acf12400e4d225 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-07T14:29:20.458Z sha b89dde4cb6112739452741ea49acf12400e4d225 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-07T15:06:41.313Z sha b89dde4cb6112739452741ea49acf12400e4d225 :: needs maintainer review before merge. :: none

@chessing234 chessing234 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.

Reviewed commit 57b3973e47cb3393d392d9b28f898d5600101a73.

One correctness issue needs correction; see the inline finding.

Validation: source and contract inspection only; runtime tests were not run.

Comment thread src/gateway/session-reset-service.ts Outdated
@@ -1026,6 +1027,11 @@ export async function performGatewaySessionReset(params: {
return deleted;
}
handleSessionStateSessionDeleted(target.canonicalKey, agentId);
await removeSessionWorktree({

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] Return preserved-worktree details from Incognito reset

removeSessionWorktree() deliberately preserves the checkout and returns { id, branch, path, reason } when snapshot creation or removal fails. This call discards that result after deleting the Incognito session; the reset result and sessions.reset response then report deletion success without recovery details. A snapshot failure (for example, disk full) leaves the checkout behind without giving the caller its location/reason, and the deleted session cannot be used to retry cleanup. Capture and propagate worktreePreserved through the reset result and Incognito response, as sessions.delete already does, and add a preservation/failure-path regression.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 1a7532e9078.

  • The Incognito branch of performGatewaySessionReset now keeps the result of removeSessionWorktree and returns it as worktreePreserved (src/gateway/session-reset-service.ts). The sessions.reset handler adds it to the Incognito response the same way sessions.delete does (src/gateway/server-methods/sessions-mutations.ts). sessions.reset has no result schema, so this needs no protocol change.
  • New test sessions.reset reports a preserved Incognito worktree like sessions.delete holds a live run lease on the session's worktree and resets the session. Before the fix it failed because the response had no worktreePreserved. Now it passes, with reason busy, and the checkout and its registry record are still there. The existing removal test also asserts that a clean removal returns no worktreePreserved.
  • server.sessions.delete-worktree-lifecycle.test.ts passes (10 tests), and so do the 14 nearby reset, Incognito, and delete test files (121 tests). oxfmt --check, oxlint, git diff --check, tsgo core, and the src test-shard typecheck are clean.

Not verified: the snapshot-failure path through reset. It goes through the same removeSessionWorktree return value that the sessions.delete snapshot-failure test already covers.

🤖 Written and posted by an AI agent (Claude Code) on behalf of @jayzhou2309.

@jayzhou2309
jayzhou2309 force-pushed the fix/incognito-reset-worktree-removal branch 5 times, most recently from b5792ef to 40946f0 Compare October 5, 2026 23:09
@jayzhou2309
jayzhou2309 force-pushed the fix/incognito-reset-worktree-removal branch from 40946f0 to b89dde4 Compare October 7, 2026 13:55
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 7, 2026
@jayzhou2309
jayzhou2309 force-pushed the fix/incognito-reset-worktree-removal branch from b89dde4 to 109f8b9 Compare October 7, 2026 17:50
@obviyus
obviyus merged commit 3d399ac into openclaw:main Oct 8, 2026
123 checks passed
@obviyus

obviyus commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Landed in 3d399ac. Thanks @jayzhou2309! Verified on a built Gateway: resetting an Incognito session now removes its worktree checkout, git registration and branch, keeping a snapshot of unsaved work. A durable reset keeps its worktree.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 9, 2026
…behind (openclaw#165185)

Remove an Incognito session's managed worktree checkout, git registration, and branch when the session is reset, keeping a snapshot of unsaved work. A durable (non-Incognito) reset keeps its worktree binding as before.

Related: openclaw#159304

Co-authored-by: Ayaan Zaidi <[email protected]>
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. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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.

3 participants