Skip to content

Commit bb6f537

Browse files
committed
chore(mothership): name sign-out in desktop tool lease docs and say "not run" once
Follow-ups from the #8673 review: the lease docs now name sign-out (`stopAllDesktopTools`) alongside the user's Stop as what cancels a desktop tool, and the stale-observation message no longer says it was not run twice.
1 parent 81e8be0 commit bb6f537

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎apps/sim/app/workspace/[workspaceId]/home/hooks/desktop-tool-lifetimes.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@ const runningTurns = new Map<string, RunningTurnTools>()
1717

1818
/** A running desktop tool's hold on its turn. */
1919
interface DesktopToolLease {
20-
/** Aborted only by the user's Stop of the turn. */
20+
/** Aborted only by the user's Stop of the turn, or by signing out. */
2121
signal: AbortSignal
2222
/** Called once when the tool settles. */
2323
release(): void
2424
}
2525

2626
/**
2727
* Starts a desktop tool (a browser action, a local file read or import) for a turn. Only the
28-
* user's Stop of that turn cancels it: replacing the stream reader, leaving the chat view, or
29-
* stopping another chat's turn leaves it running to finish and report its own result.
28+
* user's Stop of that turn, or signing out (`stopAllDesktopTools`), cancels it: replacing the
29+
* stream reader, leaving the chat view, or stopping another chat's turn leaves it running to
30+
* finish and report its own result.
3031
*/
3132
export function leaseDesktopTool(streamId: string): DesktopToolLease {
3233
let turn = runningTurns.get(streamId)

‎apps/sim/lib/mothership/tools/client/browser-tool-execution.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,7 @@ describe('pre-dispatch drops still resolve the waiter', () => {
14701470
expect(mockReportCompletion).toHaveBeenCalledWith(
14711471
'stale-call-1',
14721472
'error',
1473-
expect.stringContaining('not run this time'),
1473+
expect.stringContaining('too late to run safely'),
14741474
expect.objectContaining({ staleEvent: true })
14751475
)
14761476
const [, , message] = mockReportCompletion.mock.calls[0] ?? []

‎apps/sim/lib/mothership/tools/client/browser-tool-execution.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const OUTCOME_UNKNOWN_MESSAGE =
110110
const REPLAY_OUTCOME_UNKNOWN_MESSAGE =
111111
'This browser action was recorded before the Sim page reloaded, but its terminal result could not be recovered. It may already have taken effect. Do not retry it automatically; take a fresh browser snapshot before deciding what to do.'
112112
const STALE_OBSERVATION_NOT_RUN_MESSAGE =
113-
'Not run: this browser observation reached the Sim desktop app too late to run safely, so it was not run this time and has no result. An observation changes nothing in the browser. Do not retry it in this turn; tell the user to keep this chat open in the Sim desktop app, or to ask again later.'
113+
'Not run: this browser observation reached the Sim desktop app too late to run safely, so it has no result. An observation changes nothing in the browser. Do not retry it in this turn; tell the user to keep this chat open in the Sim desktop app, or to ask again later.'
114114
const STALE_STATEFUL_OUTCOME_UNKNOWN_MESSAGE =
115115
'This browser action was delivered too late to recover its exact result. It may already have taken effect. Do not retry it automatically; take a fresh browser snapshot before deciding what to do.'
116116
const REPLAY_GUARD_CAPACITY_MESSAGE =

0 commit comments

Comments
 (0)