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 58e3294
Browse filesBrowse the repository at this point in the historyBrowse files
fix(server): moving a thread mid-turn no longer fails the turn
t3_thread_select_project and t3_worktree_handoff change the thread's
workspace from inside the agent's own turn. The orchestrator detached the
provider session right away, which for Claude closed the event stream while
the tool call was still running: the run failed with a provider error and the
queued continuation stayed stuck behind the unfinished tool call.
A workspace change while a run is active now leaves the session alone. The
tool call returns, the turn ends normally, and the next turn start replaces a
session whose working directory no longer matches the thread's workspace,
resuming the native conversation there. Idle workspace changes still detach
immediately.
The scratch folder is no longer removed after a project selection: on Windows
the live provider process holds it as its working directory, and an empty
folder is harmless, like the ones deleted threads leave behind.
// Serializes workspace changes per thread: two concurrent handoffs could
81
78
// otherwise both pass the worktreePath === null check and each create a
@@ -405,8 +402,8 @@ const make = Effect.gen(function* () {
405
402
continuation,
406
403
note:
407
404
continuation.status==="scheduled"
408
-
? "Handoff recorded. Changing the workspace detaches this provider session, so the current turn ends shortly after this call; the queued continuation prompt then starts the next turn inside the worktree with the conversation preserved. The worktree is not removed automatically when the thread is deleted."
409
-
: "Handoff recorded. Changing the workspace detaches this provider session, so the current turn ends shortly after this call; the conversation continues inside the worktree when the thread receives its next message. Pass continuationPrompt to resume automatically. The worktree is not removed automatically when the thread is deleted.",
405
+
? "Handoff recorded. This turn still runs in the previous workspace, so end it now; the queued continuation prompt then starts the next turn inside the worktree with the conversation preserved. The worktree is not removed automatically when the thread is deleted."
406
+
: "Handoff recorded. This turn still runs in the previous workspace, so end it now; the conversation continues inside the worktree when the thread receives its next message. Pass continuationPrompt to resume automatically. The worktree is not removed automatically when the thread is deleted.",
410
407
};
411
408
returnresult;
412
409
}),
@@ -459,32 +456,6 @@ const make = Effect.gen(function* () {
459
456
asOperationFailed(`Unable to read the thread's folder '${folder}'`),
460
457
);
461
458
462
-
// Removes the thread's own scratch folder once it has moved out. A fork can
463
-
// share the folder, and rmdir keeps anything written there meanwhile.
? "Thread moved to the project's root. Changing the workspace detaches this provider session, so the current turn ends shortly after this call; the queued continuation then starts the next turn in the project with the conversation preserved. Use t3_worktree_handoff there if the work needs its own worktree."
593
-
: "Thread moved to the project's root. Changing the workspace detaches this provider session, so the current turn ends shortly after this call; the conversation continues in the project when the thread receives its next message.",
557
+
? "Thread moved to the project's root. This turn still runs in the scratch folder, so end it now without touching files; the queued continuation then starts the next turn in the project with the conversation preserved. Use t3_worktree_handoff there if the work needs its own worktree."
558
+
: "Thread moved to the project's root. This turn still runs in the scratch folder, so end it now without touching files; the conversation continues in the project when the thread receives its next message.",
"Needs an agent running inside a T3 thread. Move this agent thread into a new git worktree. To launch a separate agent already bound to a new or existing worktree, use t3_thread_launch with workspaceStrategy instead. Creates the worktree branch (optionally from the base branch's remote), re-points the thread at the worktree, and by default runs the project's setup script there. Changing the workspace detaches the live provider session, so the current turn ends shortly after the handoff is recorded; call this as the last action of the turn. To keep working after the handoff, pass continuationPrompt with the remaining work: it is queued as the thread's next message and starts a new turn inside the worktree with the conversation preserved. Without it the thread stays idle until the next message. The worktree is not removed automatically when the thread is deleted. Fails if the thread is already attached to a worktree.",
32
+
"Needs an agent running inside a T3 thread. Move this agent thread into a new git worktree. To launch a separate agent already bound to a new or existing worktree, use t3_thread_launch with workspaceStrategy instead. Creates the worktree branch (optionally from the base branch's remote), re-points the thread at the worktree, and by default runs the project's setup script there. The current turn keeps the previous workspace, so call this as the last action of the turn. To keep working after the handoff, pass continuationPrompt with the remaining work: it is queued as the thread's next message and starts a new turn inside the worktree with the conversation preserved. Without it the thread stays idle until the next message. The worktree is not removed automatically when the thread is deleted. Fails if the thread is already attached to a worktree.",
"Needs an agent running inside a T3 thread without a project (its working directory is a T3 Code scratch folder). When the user names one of their projects, find it with t3_project_list and call this as your FIRST action, before reading or editing any files: it moves this thread into the project so its work gets the project's branch, diffs, and checkpoints. The thread lands in the project's root; call t3_worktree_handoff afterwards if the work needs its own worktree. Changing the workspace detaches the live provider session, so the current turn ends shortly after this call; end your turn after it. A continuation is queued as the thread's next message and resumes the conversation in the project; pass continuationPrompt to word it yourself. Fails once the thread's scratch folder has files in it: then start a thread in the project with t3_thread_launch instead.",
65
+
"Needs an agent running inside a T3 thread without a project (its working directory is a T3 Code scratch folder). When the user names one of their projects, find it with t3_project_list and call this as your FIRST action, before reading or editing any files: it moves this thread into the project so its work gets the project's branch, diffs, and checkpoints. The thread lands in the project's root; call t3_worktree_handoff afterwards if the work needs its own worktree. The current turn keeps the scratch folder as its working directory, so end your turn right after this call. A continuation is queued as the thread's next message and resumes the conversation in the project; pass continuationPrompt to word it yourself. Fails once the thread's scratch folder has files in it: then start a thread in the project with t3_thread_launch instead.",
0 commit comments