fix: bare prompt with esc-to-interrupt is active, not idle; persist runtimeHandle in spawn metadata
This commit is contained in:
parent
ec36f3b3a7
commit
4c4f85172e
|
|
@ -202,7 +202,7 @@ describe("spawn command", () => {
|
|||
|
||||
const content = readFileSync(metaFile, "utf-8");
|
||||
expect(content).toContain("branch=feat/INT-100");
|
||||
expect(content).toContain("status=spawning");
|
||||
expect(content).toContain("status=working");
|
||||
expect(content).toContain("project=my-app");
|
||||
expect(content).toContain("issue=INT-100");
|
||||
});
|
||||
|
|
|
|||
|
|
@ -164,7 +164,8 @@ async function spawnSession(
|
|||
writeMetadata(join(sessionDir, sessionName), {
|
||||
worktree: worktreePath,
|
||||
branch: liveBranch || branch || "detached",
|
||||
status: "spawning",
|
||||
status: "working",
|
||||
runtimeHandle: JSON.stringify({ id: sessionName, runtimeName: "tmux" }),
|
||||
project: projectId,
|
||||
...(issueId ? { issue: issueId } : {}),
|
||||
createdAt: new Date().toISOString(),
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
*/
|
||||
|
||||
import { randomUUID } from "node:crypto";
|
||||
import { join } from "node:path";
|
||||
import { existsSync } from "node:fs";
|
||||
import type {
|
||||
LifecycleManager,
|
||||
SessionManager,
|
||||
|
|
|
|||
|
|
@ -498,7 +498,8 @@ function classifyTerminalOutput(terminalOutput: string): ActivityState {
|
|||
// Check the last line FIRST — if the prompt is visible, the agent is idle
|
||||
// regardless of historical output (e.g. "Reading file..." from earlier).
|
||||
// The ❯ is Claude Code's prompt character.
|
||||
if (/^[❯>$#]\s*$/.test(lastLine)) return "idle";
|
||||
// Bare prompt is idle ONLY when not actively processing (no "esc to interrupt")
|
||||
if (/^[❯>$#]\s*$/.test(lastLine) && !hasEscToInterrupt) return "idle";
|
||||
|
||||
// Claude Code shows inline suggestions after the prompt when idle, e.g.
|
||||
// "❯ check CI status on the PR". Distinguish from active processing by
|
||||
|
|
|
|||
Loading…
Reference in New Issue