feat(cli): add thread poke command
CI / check (pull_request) Successful in 3m43s

Re-runs the head step's agent with a supplementary prompt and replaces
the head step (rewires new step's prev to old head's prev) instead of
appending. Skips moderator re-route — the role of the head step is
reused.

Fixes #144
This commit is contained in:
2026-06-07 05:59:44 +00:00
parent 9d0c6df62c
commit e4c46c8150
4 changed files with 723 additions and 0 deletions
+21
View File
@@ -17,6 +17,7 @@ import {
cmdThreadCancel,
cmdThreadExec,
cmdThreadList,
cmdThreadPoke,
cmdThreadRead,
cmdThreadResume,
cmdThreadShow,
@@ -290,6 +291,26 @@ thread
});
});
thread
.command("poke")
.description("Re-run the head step's agent with a supplementary prompt (replaces head step)")
.argument("<thread-id>", "Thread ULID")
.requiredOption("-p, --prompt <text>", "Supplementary prompt for the agent")
.option("--agent <cmd>", "Override agent command (defaults to head step's agent)")
.action((threadId: string, opts: { prompt: string; agent: string | undefined }) => {
const storageRoot = resolveStorageRoot();
runAction(async () => {
const agentOverride = opts.agent ?? null;
const result = await cmdThreadPoke(
storageRoot,
threadId as ThreadId,
opts.prompt,
agentOverride,
);
writeOutput(result);
});
});
thread
.command("stop")
.description("Stop background execution of a thread (keep thread active)")