@rallycry/conveyor-agent 10.4.4 → 10.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -197,6 +197,8 @@ var AgentConnection = class _AgentConnection {
197
197
  earlyPullBranches = [];
198
198
  spawnReviewCallback = null;
199
199
  earlySpawnReviews = [];
200
+ spawnTuiCallback = null;
201
+ earlySpawnTuis = [];
200
202
  // PTY relay (S5 terminal). Single-slot callbacks, set per PtySession run.
201
203
  ptyInputCallback = null;
202
204
  ptyResizeCallback = null;
@@ -404,6 +406,10 @@ var AgentConnection = class _AgentConnection {
404
406
  if (this.spawnReviewCallback) this.spawnReviewCallback(data);
405
407
  else this.earlySpawnReviews.push(data);
406
408
  });
409
+ this.socket.on("session:spawnTui", (data) => {
410
+ if (this.spawnTuiCallback) this.spawnTuiCallback(data);
411
+ else this.earlySpawnTuis.push(data);
412
+ });
407
413
  this.socket.on("session:finalizeSnapshot", () => {
408
414
  this.finalizeSnapshotCallback?.();
409
415
  });
@@ -659,6 +665,25 @@ var AgentConnection = class _AgentConnection {
659
665
  }).catch(() => {
660
666
  });
661
667
  }
668
+ onSpawnTui(callback) {
669
+ this.spawnTuiCallback = callback;
670
+ for (const data of this.earlySpawnTuis) callback(data);
671
+ this.earlySpawnTuis = [];
672
+ }
673
+ /**
674
+ * Report that a same-pod TUI/shell child failed to spawn (fire-and-forget).
675
+ * The server Ends the orphaned session — no fallback pod (unlike review).
676
+ * sessionId is OUR (builder) session — the SEC-9 guard runs on it.
677
+ */
678
+ reportSessionSpawnFailure(spawnedSessionId, error) {
679
+ if (!this.socket) return;
680
+ void this.call("reportSessionSpawnFailure", {
681
+ sessionId: this.config.sessionId,
682
+ spawnedSessionId,
683
+ ...error ? { error: error.slice(0, 2e3) } : {}
684
+ }).catch(() => {
685
+ });
686
+ }
662
687
  onFinalizeSnapshot(callback) {
663
688
  this.finalizeSnapshotCallback = callback;
664
689
  }
@@ -2279,6 +2304,15 @@ var ReportReviewSpawnFailureRequestSchema = z.object({
2279
2304
  reviewSessionId: z.string(),
2280
2305
  error: z.string().max(2e3).optional()
2281
2306
  });
2307
+ var SpawnTaskSessionRequestSchema = z.object({
2308
+ taskId: z.string(),
2309
+ kind: z.enum(["tui", "shell"])
2310
+ });
2311
+ var ReportSessionSpawnFailureRequestSchema = z.object({
2312
+ sessionId: z.string(),
2313
+ spawnedSessionId: z.string(),
2314
+ error: z.string().max(2e3).optional()
2315
+ });
2282
2316
  var RefreshGithubTokenResponseSchema = z.object({
2283
2317
  token: z.string()
2284
2318
  });
@@ -2671,12 +2705,6 @@ var TASK_CHAT_HISTORY_LIMIT = 20;
2671
2705
  var PM_CHAT_HISTORY_LIMIT = 40;
2672
2706
  var AGENT_CHAT_HISTORY_FETCH_LIMIT = Math.max(TASK_CHAT_HISTORY_LIMIT, PM_CHAT_HISTORY_LIMIT) + 10;
2673
2707
  var PRE_BUILD_TASK_STATUSES = /* @__PURE__ */ new Set(["Planning", "Open"]);
2674
- function hasTaskPlan(plan) {
2675
- return !!plan?.trim();
2676
- }
2677
- function taskNeedsPlanning(task) {
2678
- return !hasTaskPlan(task.plan) && PRE_BUILD_TASK_STATUSES.has(task.status) && !task.githubPRUrl;
2679
- }
2680
2708
 
2681
2709
  // src/runner/mode-controller.ts
2682
2710
  var ModeController = class {
@@ -2763,28 +2791,19 @@ var ModeController = class {
2763
2791
  return this._mode;
2764
2792
  }
2765
2793
  /**
2766
- * An auto task that still NEEDS PLANNING (no plan saved, pre-build status, no
2767
- * PR see `taskNeedsPlanning` in @project/shared) runs the read-only plan turn
2768
- * first (`--permission-mode plan`): resolveInitialMode leaves it in `auto` with
2769
- * `_hasExitedPlanMode = false`, and once the agent finishes it calls
2770
- * ExitPlanMode building. Everything else bypasses planning and builds
2771
- * immediately with `--dangerously-skip-permissions`:
2772
- *
2773
- * - a plan already on the card (e.g. a Planning card planned by a human/PM),
2774
- * - a build already underway (status past `Planning`/`Open` — releases booted
2775
- * `InProgress`, pod restarts mid-build where DB `agentMode` stays `"auto"`),
2776
- * - a PR already open (safety net if status lags).
2777
- *
2778
- * Runtime Build-after-Discovery never reaches this gate as `auto` — the server's
2779
- * `resolveModeToSend` rewrites it to `"building"` for any task with a plan.
2794
+ * Auto mode always bypasses the plan turn: resolveInitialMode calls
2795
+ * transitionToBuilding() at boot, so the agent runs with
2796
+ * `--dangerously-skip-permissions` from turn 1 and documents its plan into
2797
+ * the card (via update_task_plan) as the approach firms up — non-blocking,
2798
+ * never a gate. Use discovery mode for a plan turn that stops for human
2799
+ * approval. Non-auto modes never bypass.
2780
2800
  */
2781
- canBypassPlanning(context) {
2782
- if (this._mode !== "auto") return false;
2783
- return !taskNeedsPlanning(context);
2801
+ canBypassPlanning(_context) {
2802
+ return this._mode === "auto";
2784
2803
  }
2785
2804
  // ── Mode transitions ───────────────────────────────────────────────
2786
2805
  /** Handle mode change from server */
2787
- handleModeChange(newMode, context) {
2806
+ handleModeChange(newMode, _context) {
2788
2807
  if (newMode === this._mode) return { type: "noop" };
2789
2808
  if (this._runnerMode === "task" && newMode === "review") {
2790
2809
  this._mode = newMode;
@@ -2799,7 +2818,7 @@ var ModeController = class {
2799
2818
  if (this._runnerMode === "task" && newMode === "auto") {
2800
2819
  this._mode = newMode;
2801
2820
  this._isAuto = true;
2802
- this._hasExitedPlanMode = !context || !taskNeedsPlanning(context);
2821
+ this._hasExitedPlanMode = true;
2803
2822
  return { type: "restart_query", newMode: "auto" };
2804
2823
  }
2805
2824
  if (this._mode === "auto" && this._hasExitedPlanMode && newMode === "building") {
@@ -5196,6 +5215,7 @@ function buildPackRunnerSystemPrompt(context, config, setupLog) {
5196
5215
  ``,
5197
5216
  `1. Call list_subtasks to see the current state of all child tasks.`,
5198
5217
  ` The response includes PR info, agent assignment, and **dependency info** (dependencies array + allDependenciesMet flag).`,
5218
+ ` If list_subtasks returns NO children, this is a fresh parent card: break the work down now \u2014 explore the codebase, save a parent-level plan with update_task_plan, then create child tasks with create_subtask, each with a detailed plan (file:line citations, verification steps) and dependsOn set for any child that blocks on another. Then fire the ready children and continue the loop.`,
5199
5219
  ``,
5200
5220
  `2. Evaluate children by status and dependency readiness:`,
5201
5221
  ` - "ReviewPR": Review and merge its PR with approve_and_merge_pr. (Highest priority)`,
@@ -5258,6 +5278,7 @@ function buildPackRunnerInstructions(context, scenario) {
5258
5278
  parts.push(
5259
5279
  `You are the Pack Runner for this task and its subtasks.`,
5260
5280
  `Begin your autonomous loop immediately: call list_subtasks to assess the current state.`,
5281
+ `If there are no children yet, create them first \u2014 save a parent-level plan with update_task_plan, then create child tasks with detailed plans and dependsOn set where one blocks on another. Then fire the ready ones.`,
5261
5282
  `If any child is in "ReviewPR" status, review and merge its PR first.`,
5262
5283
  `Then fire the next "Open" child task.`
5263
5284
  );
@@ -5692,15 +5713,15 @@ function buildPmAutoWithPlanRelaunchParts() {
5692
5713
  return [
5693
5714
  `
5694
5715
  You are in auto mode. A plan already exists for this task.`,
5695
- `Verify that story points, title, and tags are set via get_current_plan, then call ExitPlanMode immediately to transition to building.`,
5716
+ `Begin implementing it now \u2014 refine story points, title, and tags via update_task_properties if they look like placeholders.`,
5696
5717
  `Do NOT wait for team input \u2014 proceed autonomously.`
5697
5718
  ];
5698
5719
  }
5699
5720
  function buildPmAutoPlanningRelaunchParts() {
5700
5721
  return [
5701
5722
  `
5702
- You are in auto mode. Continue planning autonomously.`,
5703
- `When the plan and all required properties are set, call ExitPlanMode to transition to building.`,
5723
+ You are in auto mode. Continue building autonomously.`,
5724
+ `Save a concise plan with update_task_plan as your approach firms up \u2014 never pause or wait for approval.`,
5704
5725
  `Do NOT wait for team input \u2014 proceed autonomously.`
5705
5726
  ];
5706
5727
  }
@@ -5776,6 +5797,20 @@ function buildPropertyInstructions(context, runnerMode) {
5776
5797
  }
5777
5798
  return parts;
5778
5799
  }
5800
+ function buildPlanDocumentationSection(context) {
5801
+ const hasPlan = !!context?.plan?.trim();
5802
+ return [
5803
+ ``,
5804
+ `### Plan & Properties (non-blocking \u2014 do NOT pause the build for these)`,
5805
+ `- The card is already In Progress and advances automatically (In Progress \u2192 Review PR when you open the PR). There is no plan-approval step.`,
5806
+ ...hasPlan ? [
5807
+ `- A plan is already saved on the card. Keep it current with update_task_plan if your approach diverges materially from it.`
5808
+ ] : [
5809
+ `- No plan is saved yet: once your approach settles, save a concise implementation plan with update_task_plan (file:line citations). Fill it in as you go \u2014 never wait on it before writing code.`
5810
+ ],
5811
+ `- Identification auto-fills title, story points, and icon with quick AI guesses. After exploring, refine the title and story points with update_task_properties if they look like placeholders. Icons are automatic \u2014 never set them.`
5812
+ ];
5813
+ }
5779
5814
  function buildExplorationMethodology() {
5780
5815
  return [
5781
5816
  ``,
@@ -5875,23 +5910,10 @@ function buildAutoPrompt(context, runnerMode) {
5875
5910
  const parts = [
5876
5911
  `
5877
5912
  ## Mode: Auto`,
5878
- `You are in Auto mode \u2014 operating autonomously through planning \u2192 building \u2192 PR.`,
5879
- ``,
5880
- `### Phase 1: Discovery & Planning (current)`,
5881
- `- You are in the SDK's plan mode \u2014 read-only access is enforced automatically`,
5882
- `- You have MCP tools for task properties: update_task_plan, update_task_properties`,
5883
- ``,
5884
- `### Required before transitioning:`,
5885
- `Before calling ExitPlanMode, you MUST fill in ALL of these:`,
5886
- `1. **Plan** \u2014 Save a clear implementation plan using update_task_plan`,
5887
- `2. **Story Points** \u2014 Assign via update_task_properties`,
5888
- `3. **Title** \u2014 Set an accurate title via update_task_properties (if the current one is vague or "Untitled")`,
5889
- ``,
5890
- `### Transitioning to Building:`,
5891
- `When your plan is complete and all required properties are set, call the **ExitPlanMode** tool.`,
5892
- `- If any required properties are missing, ExitPlanMode will be denied with details on what's missing`,
5893
- `- Once ExitPlanMode succeeds, you will seamlessly transition to full build access within the same session`,
5894
- `- Continue directly with implementation \u2014 no restart or waiting is needed`,
5913
+ `You are in Auto mode \u2014 operating autonomously through building \u2192 PR.`,
5914
+ `- You have full coding access (read, write, edit, bash, git) from the start \u2014 there is no read-only planning phase`,
5915
+ `- Safety rules: no destructive operations, use --force-with-lease instead of --force`,
5916
+ ...buildPlanDocumentationSection(context),
5895
5917
  ``,
5896
5918
  `### Subtask Plan Requirements`,
5897
5919
  `When creating subtasks, each MUST include a detailed \`plan\` field:`,
@@ -5907,8 +5929,8 @@ function buildAutoPrompt(context, runnerMode) {
5907
5929
  ...context?.isParentTask ? [
5908
5930
  ``,
5909
5931
  `### Parent Task Guidance`,
5910
- `You are a parent task. Your plan should define child tasks with detailed plans, not direct implementation steps.`,
5911
- `After ExitPlanMode, you'll transition to Review mode to coordinate child task execution.`,
5932
+ `You are a parent task \u2014 coordinate child tasks instead of implementing directly.`,
5933
+ `If no children exist yet, break the work down now: save a parent-level plan with update_task_plan, then create child tasks with create_subtask (each with a detailed plan).`,
5912
5934
  `Child task status lifecycle: Open \u2192 InProgress \u2192 ReviewPR \u2192 ReviewDev \u2192 Complete.`,
5913
5935
  `Set child ordering with \`dependsOn\` (sibling ids/slugs) on \`create_subtask\` \u2014 explicit metadata the pack runner schedules off, not order described in plan text. Independent children get none and run in parallel.`
5914
5936
  ] : [],
@@ -5946,7 +5968,8 @@ function buildModePrompt(agentMode, context, runnerMode) {
5946
5968
  `2. \`bun run test:affected\` \u2014 runs only the tests your diff can affect (docs-only diffs run nothing; apps/api diffs run unit tests only since CI covers the int shards; shared/db diffs escalate to the full suite automatically)`,
5947
5969
  `Docs/markdown/.claude-only changes need NO local gates \u2014 open the PR and let CI validate.`,
5948
5970
  `If a gate fails, fix it before opening the PR. Do NOT open PRs with known failing gates. Never run the full \`bun run test\` for a diff confined to one package.`,
5949
- `For refactors: also run \`git diff ${context?.baseBranch ?? "dev"}..HEAD\` and confirm the public API surface (exports, function signatures) has no unintended breaking changes.`
5971
+ `For refactors: also run \`git diff ${context?.baseBranch ?? "dev"}..HEAD\` and confirm the public API surface (exports, function signatures) has no unintended breaking changes.`,
5972
+ ...context?.isAuto || !context?.plan?.trim() ? buildPlanDocumentationSection(context) : []
5950
5973
  ]
5951
5974
  ];
5952
5975
  return parts.join("\n");
@@ -6343,16 +6366,15 @@ CRITICAL: You are in Auto mode. Do NOT report status, ask for confirmation, or g
6343
6366
  if (context.plan?.trim()) {
6344
6367
  return [
6345
6368
  `You are operating autonomously. A plan already exists for this task.`,
6346
- `Verify that story points, title, and tags are set, then call ExitPlanMode immediately to transition to building.`,
6347
- `Do NOT re-plan or wait for team input \u2014 proceed autonomously.`
6369
+ `Begin implementing it now \u2014 do NOT re-plan or wait for team input.`,
6370
+ `Refine story points, title, and tags via update_task_properties if they look like placeholders.`
6348
6371
  ];
6349
6372
  }
6350
6373
  return [
6351
- `You are operating autonomously. Begin planning immediately.`,
6374
+ `You are operating autonomously. No plan is saved on this card yet \u2014 start building now.`,
6352
6375
  `1. Search the codebase (grep/glob) to locate relevant files, then read the critical ones`,
6353
- `2. Draft a clear implementation plan and save it with update_task_plan`,
6354
- `3. Set story points, tags, and title (update_task_properties)`,
6355
- `4. When the plan and all required properties are set, call ExitPlanMode to transition to building`,
6376
+ `2. Implement the work; as your approach firms up, save a concise plan with update_task_plan \u2014 never pause or wait for approval`,
6377
+ `3. Refine story points, tags, and title (update_task_properties) if they look like placeholders`,
6356
6378
  `Do NOT wait for team input \u2014 proceed autonomously.`
6357
6379
  ];
6358
6380
  }
@@ -6373,14 +6395,23 @@ CRITICAL: You are in Auto mode. Do NOT report status, ask for confirmation, or g
6373
6395
  `When you finish planning, save the plan with update_task_plan, post a summary of the plan for the team with post_to_chat (your turn output is NOT shown in chat), then end your turn. A separate task agent will execute the plan after review.`
6374
6396
  ];
6375
6397
  }
6376
- const parts = [
6398
+ return buildFreshLeafInstructions(context, isAutoMode);
6399
+ }
6400
+ function buildFreshLeafInstructions(context, isAutoMode) {
6401
+ const parts = context.plan?.trim() ? [
6377
6402
  `Begin executing the task plan above immediately.`,
6378
- `Your FIRST action should be reading the relevant source files mentioned in the plan, then writing code. Do NOT run install, build, lint, test, or dev server commands first \u2014 the environment is already set up.`,
6403
+ `Your FIRST action should be reading the relevant source files mentioned in the plan, then writing code. Do NOT run install, build, lint, test, or dev server commands first \u2014 the environment is already set up.`
6404
+ ] : [
6405
+ `No plan is saved on this card yet. Investigate the task briefly (search first, read only critical files), then implement.`,
6406
+ `As your approach firms up, save a concise implementation plan with update_task_plan (file:line citations) \u2014 do NOT pause or wait for approval; the card is already In Progress and advances automatically.`,
6407
+ `Do NOT run install, build, lint, test, or dev server commands first \u2014 the environment is already set up.`
6408
+ ];
6409
+ parts.push(
6379
6410
  `Work on the git branch "${context.githubBranch}". Stay on this branch for the entire task. Do not checkout or create other branches.`,
6380
6411
  `Use post_to_chat to keep the team informed (your turn output is NOT shown in chat \u2014 post_to_chat is the only way they see it): briefly post what you're doing when you begin meaningful implementation, and again when the PR is ready.`,
6381
6412
  `Before opening the PR, verify with \`bun run check\` (lint + typecheck) and \`bun run test:affected\` (tests scoped to your diff \u2014 docs-only changes need no local gates). Fix any failures. Do NOT open a PR with known failing gates. CI runs the full suite on the PR \u2014 never run the full \`bun run test\` for a diff confined to one package.`,
6382
6413
  `When finished, use the mcp__conveyor__create_pull_request tool to open a PR. Do NOT use gh CLI or any other method to create PRs.`
6383
- ];
6414
+ );
6384
6415
  if (isAutoMode) {
6385
6416
  parts.push(
6386
6417
  `
@@ -6429,8 +6460,7 @@ Your plan has been approved. Address the feedback above, then begin implementing
6429
6460
  } else if (isAuto) {
6430
6461
  parts2.push(
6431
6462
  `
6432
- You are in auto mode. Address the feedback above \u2014 update the plan accordingly using update_task_plan.`,
6433
- `When the plan and all required properties are set, call ExitPlanMode to transition to building.`,
6463
+ You are in auto mode. Address the feedback above and continue building \u2014 update the saved plan with update_task_plan if the feedback changes your approach.`,
6434
6464
  `Do NOT wait for additional team input \u2014 the messages above ARE the team's input. Proceed autonomously.`
6435
6465
  );
6436
6466
  } else {
@@ -6469,13 +6499,13 @@ function buildIdleRelaunchInstructions(context, isPm, agentMode, isAuto) {
6469
6499
  if (context.plan?.trim()) {
6470
6500
  return [
6471
6501
  `You were relaunched in auto mode. A plan already exists for this task.`,
6472
- `Verify that story points, title, and tags are set, then call ExitPlanMode immediately to transition to building.`,
6502
+ `Begin implementing it now \u2014 refine story points, title, and tags via update_task_properties if they look like placeholders.`,
6473
6503
  `Do NOT wait for instructions or go idle \u2014 you are in auto mode.`
6474
6504
  ];
6475
6505
  }
6476
6506
  return [
6477
- `You were relaunched in auto mode. Continue planning autonomously.`,
6478
- `When the plan and all required properties are set, call ExitPlanMode to transition to building.`,
6507
+ `You were relaunched in auto mode. Continue building autonomously.`,
6508
+ `Save a concise plan with update_task_plan as your approach firms up \u2014 never pause or wait for approval.`,
6479
6509
  `Do NOT wait for instructions or go idle \u2014 you are in auto mode.`
6480
6510
  ];
6481
6511
  }
@@ -6515,7 +6545,13 @@ function buildInstructions(mode, context, scenario, agentMode, isAuto) {
6515
6545
  const isCodeReview = mode === "code-review" || !isPm && agentMode === "review";
6516
6546
  if (scenario === "fresh") {
6517
6547
  parts.push(
6518
- ...buildFreshInstructions(isPm, isCodeReview, agentMode === "auto", context, agentMode)
6548
+ ...buildFreshInstructions(
6549
+ isPm,
6550
+ isCodeReview,
6551
+ agentMode === "auto" || !!isAuto,
6552
+ context,
6553
+ agentMode
6554
+ )
6519
6555
  );
6520
6556
  return parts;
6521
6557
  }
@@ -7389,7 +7425,7 @@ var DEPENDS_ON_DESCRIPTION = "Sibling subtask ids or slugs this subtask blocks o
7389
7425
  function buildUpdateTaskTool(connection) {
7390
7426
  return defineTool(
7391
7427
  "update_task_plan",
7392
- "Save the finalized plan and/or description to the current task. Use in Plan mode after alignment. For children use update_subtask; for title/tags/PR use update_task_properties.",
7428
+ "Save the plan and/or description to the current task. In auto/building mode, save the plan as your approach firms up \u2014 non-blocking, never pause the build for it. For children use update_subtask; for title/tags/PR use update_task_properties.",
7393
7429
  {
7394
7430
  plan: z9.string().optional().describe("The task plan in markdown"),
7395
7431
  description: z9.string().optional().describe("Updated task description")
@@ -7744,7 +7780,7 @@ ${issueLines}`;
7744
7780
 
7745
7781
  // src/tools/index.ts
7746
7782
  function getTaskModeTools(agentMode, connection) {
7747
- if (agentMode === "discovery" || agentMode === "auto") {
7783
+ if (agentMode === "discovery" || agentMode === "auto" || agentMode === "building") {
7748
7784
  return [buildUpdateTaskTool(connection)];
7749
7785
  }
7750
7786
  return [];
@@ -7772,7 +7808,7 @@ function buildConveyorTools(connection, config, context, agentMode) {
7772
7808
  const effectiveMode = agentMode ?? context?.agentMode ?? void 0;
7773
7809
  const commonTools = buildCommonTools(connection, config);
7774
7810
  const modeTools = getModeTools(effectiveMode, connection, config, context);
7775
- const discoveryTools = effectiveMode === "discovery" || effectiveMode === "auto" ? buildDiscoveryTools(connection) : [];
7811
+ const discoveryTools = effectiveMode === "discovery" || effectiveMode === "auto" || effectiveMode === "building" ? buildDiscoveryTools(connection) : [];
7776
7812
  const codeReviewTools = effectiveMode === "review" ? buildCodeReviewTools(connection) : [];
7777
7813
  const emergencyTools = [buildForceUpdateTaskStatusTool(connection)];
7778
7814
  return [...commonTools, ...modeTools, ...discoveryTools, ...codeReviewTools, ...emergencyTools];
@@ -8722,9 +8758,10 @@ function buildQueryOptions(host, context) {
8722
8758
  // the same text via `--append-system-prompt`. PTY-only: the SDK harness
8723
8759
  // already receives it through systemPrompt.append.
8724
8760
  ...host.harnessKind === "pty" && systemPromptText ? { appendSystemPrompt: systemPromptText } : {},
8725
- // Auto mode pre-exit: after the ExitPlanMode hook allows the call, the
8726
- // CLI's plan dialog still renders press Enter so the autonomous agent
8727
- // continues building in the same session (Conveyor validated in the hook).
8761
+ // Auto mode pre-exit (residual sessions only auto now boots post-exit):
8762
+ // after the ExitPlanMode hook allows the call, the CLI's plan dialog still
8763
+ // renders press Enter so the autonomous agent continues building in the
8764
+ // same session (Conveyor validated in the hook).
8728
8765
  planDialogAutoAccept: mode === "auto" && !host.hasExitedPlanMode,
8729
8766
  tools: { type: "preset", preset: "claude_code" },
8730
8767
  mcpServers: {
@@ -10595,9 +10632,9 @@ var SessionRunner = class _SessionRunner {
10595
10632
  /** The build-phase nudge (In Progress, no PR). Offers BOTH escape routes so
10596
10633
  * the agent never just goes idle. */
10597
10634
  static STUCK_PROMPT = "You are in Auto mode, your task is still In Progress, and there is no open pull request. Do ONE of these right now: (1) open a pull request with the create_pull_request tool, OR (2) call post_to_chat to explain exactly where you are stuck and what you need from a human. Do not finish or go idle silently.";
10598
- /** The planning-phase nudge (still Planning, identification/plan unfinished).
10599
- * Same two-escape-route shape, aimed at finishing discovery instead of a PR. */
10600
- static STUCK_PROMPT_PLANNING = "You are in Auto mode and still in the Planning phase \u2014 identification and/or the plan are not finished. Do ONE of these right now: (1) finish identifying the task (set the story points) and save the plan with the update_task_plan tool, then call ExitPlanMode to begin building, OR (2) call post_to_chat to explain exactly where you are stuck and what you need from a human. Do not finish or go idle silently.";
10635
+ /** The pre-build nudge (still Planning/Open, identification/plan unfinished).
10636
+ * Same two-escape-route shape, aimed at landing the plan + continuing to build. */
10637
+ static STUCK_PROMPT_PLANNING = "You are in Auto mode and the card is still in a pre-build status \u2014 identification and/or the plan are not finished. Do ONE of these right now: (1) set the story points, save the plan with the update_task_plan tool, and continue implementing, OR (2) call post_to_chat to explain exactly where you are stuck and what you need from a human. Do not finish or go idle silently.";
10601
10638
  /**
10602
10639
  * Classify how an auto task is "stuck" after its turn ended (call sites run
10603
10640
  * post-turn, so the TUI is no longer working), or null if it isn't. Shared
@@ -10607,11 +10644,12 @@ var SessionRunner = class _SessionRunner {
10607
10644
  *
10608
10645
  * - "pr": In Progress with no open PR (build finished without shipping).
10609
10646
  * - "planning": still in a pre-build status (Planning/Open) without
10610
- * (identified + saved plan). A fresh auto agent that finishes its plan turn
10611
- * WITHOUT ExitPlanMode would otherwise idle clean-exit its session Ends
10612
- * the workspace is reaped "agent_gone" before a plan ever landed. Nudging
10613
- * (and, on exhaustion, going dormant) keeps the session Active so the pod
10614
- * is never prematurely slept.
10647
+ * (identified + saved plan) e.g. the server-side InProgress bump failed
10648
+ * and the agent idled before documenting its plan. An agent that idles
10649
+ * here would otherwise clean-exit its session Ends the workspace is
10650
+ * reaped "agent_gone" before a plan ever landed. Nudging (and, on
10651
+ * exhaustion, going dormant) keeps the session Active so the pod is never
10652
+ * prematurely slept.
10615
10653
  */
10616
10654
  autoStuckKind() {
10617
10655
  if (!this.mode.isAuto || this.stopped) return null;
@@ -11077,6 +11115,7 @@ export {
11077
11115
  DEFAULT_LIFECYCLE_CONFIG,
11078
11116
  Lifecycle,
11079
11117
  cleanTerminalOutput,
11118
+ loadPtySpawn,
11080
11119
  inheritedEnv,
11081
11120
  buildPromptBytes,
11082
11121
  ClaudeTuiAdapter,
@@ -11110,4 +11149,4 @@ export {
11110
11149
  runStartCommand,
11111
11150
  unshallowRepo
11112
11151
  };
11113
- //# sourceMappingURL=chunk-VCXKVINO.js.map
11152
+ //# sourceMappingURL=chunk-5FRDOFI4.js.map