Repository navigation
t3 thread start --worktree-path and t3 thread interrupt: let a CLI caller use its own worktree and stop the run it started
#23945
Replies: 2 comments
|
I would also like interrupt as a cli command (mirroring the MCP) 🙏 |
|
Same need here, for lotar's agent jobs: lotar makes a worktree per ticket with One more reason the |
Uh oh!
There was an error while loading. Please reload this page.
Problem or use case
I run an orchestrator on the same machine as my T3 server. It prepares a git worktree for each task (hooks, a trust mark, task files), then starts a thread there so I can watch and steer the agent in the app. When a task is cancelled or the orchestrator shuts down, it stops that thread's run.
t3 thread startcovers the start, but only in the project folder or a new worktree T3 creates, so the orchestrator can't use the worktree it prepared. There's no CLI command to stop a run either. For both, the orchestrator has to mint a session witht3 auth session issue --subject mcp-clientand call/mcpdirectly. That relies on an internal subject name and is the kind of driftt3 threadwas added to avoid.The server already does both:
t3_thread_launchtakesworkspaceStrategy: { type: "existing_worktree", worktreePath, branch }, andt3_thread_interruptstops the newest running turn. Only the CLI is missing them.Proposed solution
t3 thread start <project> <message> --worktree-path <path> [--branch <name>]passes theexisting_worktreestrategy tot3_thread_launch. A relative path resolves from the caller's directory, like the project argument. It can't be combined with--worktree <base-ref>.t3 thread interrupt <thread> [--json]callst3_thread_interruptwith the thread id and prints whether a turn was stopped. An idle thread is left as it is.Both only forward to the existing tools, as
start,sendandshowdo, so they add no server, contract or client changes and no new permission. A start with no way to stop it is a one-way door.A working branch with a focused test and a runtime check: https://github.com/Tanner-Scadden/t3code/tree/feat/cli-thread-worktree-interrupt
Related
#19071 added
t3 thread start; this extends it. #17328 asks for per-thread environment ont3_thread_launchfor outside orchestrators, the same kind of caller. #16759 covers stopping a turn from the app.Drafted with Claude Code from the orchestrator I'm building.
All reactions