@@ -2,7 +2,10 @@ import { consume } from "@lit/context";
22import { initialState , Task , TaskStatus } from "@lit/task" ;
33import { html , nothing } from "lit" ;
44import { state } from "lit/decorators.js" ;
5- import type { WorktreeRecord } from "../../../../packages/gateway-protocol/src/index.js" ;
5+ import type {
6+ WorktreeRecord ,
7+ WorktreesRemoveResult ,
8+ } from "../../../../packages/gateway-protocol/src/index.js" ;
69import type { GatewayBrowserClient } from "../../api/gateway.ts" ;
710import { subtitleForRoute , titleForRoute } from "../../app-navigation.ts" ;
811import { applicationContext , type ApplicationContext } from "../../app/context.ts" ;
@@ -32,7 +35,6 @@ import { OpenClawLightDomElement } from "../../lit/openclaw-element.ts";
3235const WORKTREES_DOCS_URL = "https://docs.openclaw.ai/concepts/managed-worktrees" ;
3336
3437type WorktreesListResult = { worktrees : WorktreeRecord [ ] } ;
35- type WorktreesRemoveResult = { removed : boolean ; snapshotError ?: string } ;
3638type WorktreeBranchesResult = {
3739 branches : Array < { name : string } > ;
3840 defaultBranch ?: string ;
@@ -184,7 +186,13 @@ class WorktreesPage extends OpenClawLightDomElement {
184186 return ;
185187 }
186188 try {
187- await scope . client . request ( "worktrees.remove" , { id : record . id , force : true } ) ;
189+ const forced = await scope . client . request < WorktreesRemoveResult > ( "worktrees.remove" , {
190+ id : record . id ,
191+ force : true ,
192+ } ) ;
193+ if ( this . gateway . isCurrent ( scope ) ) {
194+ this . error = forced . snapshotError ?? null ;
195+ }
188196 } catch ( forceError ) {
189197 if ( this . gateway . isCurrent ( scope ) ) {
190198 this . error = String ( forceError ) ;
0 commit comments