You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2f9688d
Browse filesBrowse the repository at this point in the historyBrowse files
fix(mothership): refuse desktop claims for unapproved or stopped calls
The desktop authorize route claimed any pending call, so a gated terminal
run that was still awaiting approval, or a call on a run the user had
stopped, could be claimed and executed. The claim now locks the run row and
refuses once tool admission has closed (Stop, a newer turn, or the run's
end), and refuses a call held for the user's decision until they allow it.
Whether a call is gated depends on the turn, so pre-persist records it on
the row (permission_requested_at).
Stop now settles the stopped runs' open desktop calls in the transaction
that closes admission: unclaimed calls as never started, claimed calls as
outcome unknown. A result for an already-settled call (a retry, or one that
lost to Stop) is acknowledged with the stored outcome instead of 404/500.
/** Every tool that acts on the user's machine through the desktop app. */
20
+
exportconstDESKTOP_TOOL_NAMES=[
21
+
...CURRENT_BROWSER_TOOL_NAMES,
22
+
TERMINAL_TOOL_NAME,
23
+
'import_local_files',
24
+
'read_local_file',
25
+
]asconst
26
+
27
+
/** What the model learns about a desktop call that Stop cancelled before the desktop picked it up. */
28
+
exportconstSTOPPED_BEFORE_START_MESSAGE=
29
+
'Not run: the user stopped the chat before the Sim desktop app started this action. Nothing happened on their computer.'
30
+
31
+
/** What the model learns about a desktop call that Stop cancelled after the desktop picked it up. */
32
+
exportconstSTOPPED_WHILE_RUNNING_MESSAGE=
33
+
'Stopped by the user while the Sim desktop app was running this action. It may already have taken effect; inspect the current state before repeating it.'
0 commit comments