@rallycry/conveyor-agent 11.0.15 → 11.0.17

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  startWorkbenchServer
3
- } from "./chunk-IBAIJY7V.js";
3
+ } from "./chunk-7TSQXIN3.js";
4
4
  import {
5
5
  TOMBSTONE_MESSAGE,
6
6
  isLegacyEntrypointLaunch
@@ -12,7 +12,7 @@ import {
12
12
  refreshSkillsAfterCheckout,
13
13
  runPreReadyBinds
14
14
  } from "./chunk-SR66HQKB.js";
15
- import "./chunk-JG3VMWRQ.js";
15
+ import "./chunk-QLMNQSJL.js";
16
16
  import {
17
17
  GitPrepJob,
18
18
  defaultGit,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  loadPtySpawn
3
- } from "./chunk-JG3VMWRQ.js";
3
+ } from "./chunk-QLMNQSJL.js";
4
4
  import {
5
5
  terminateProcessGroup
6
6
  } from "./chunk-W4LZ7R6Z.js";
@@ -38,6 +38,36 @@ var RemoteProcessHandle = class extends EventEmitter {
38
38
  };
39
39
 
40
40
  // src/workbench/client.ts
41
+ var WORKBENCH_COMMAND_ENV_DENYLIST = /* @__PURE__ */ new Set([
42
+ "POD_BOOTSTRAP_TOKEN",
43
+ "CONVEYOR_BOOTSTRAP_TOKEN",
44
+ "CONVEYOR_WORKBENCH_TOKEN",
45
+ "CONVEYOR_TASK_TOKEN",
46
+ "CONVEYOR_PROJECT_TOKEN",
47
+ "CONVEYOR_GIT_SECRET",
48
+ "CONVEYOR_GIT_CREDENTIAL_DIR",
49
+ "CONVEYOR_GITHUB_TOKEN",
50
+ "CONVEYOR_GITHUB_TOKEN_FILE",
51
+ "GH_TOKEN",
52
+ "GITHUB_TOKEN",
53
+ "GH_CONFIG_DIR",
54
+ "ANTHROPIC_API_KEY",
55
+ "CLAUDE_CODE_OAUTH_TOKEN",
56
+ "CONVEYOR_AGENT_KEY",
57
+ "CONVEYOR_CLAUDE_OAUTH",
58
+ "CONVEYOR_CODEX_OAUTH",
59
+ "CONVEYOR_OPENCODE_OAUTH",
60
+ "CLOUDSDK_AUTH_ACCESS_TOKEN"
61
+ ]);
62
+ function serializableEnv(env) {
63
+ const result = {};
64
+ for (const [key, value] of Object.entries(env)) {
65
+ if (typeof value === "string" && !WORKBENCH_COMMAND_ENV_DENYLIST.has(key)) {
66
+ result[key] = value;
67
+ }
68
+ }
69
+ return result;
70
+ }
41
71
  function frameError(frame) {
42
72
  return new WorkbenchError(frame.message, frame.code);
43
73
  }
@@ -158,7 +188,7 @@ var WorkbenchClient = class {
158
188
  }
159
189
  /** Mirrors setup/commands.ts runSetupCommand (shell form, streamed output,
160
190
  * abort → graceful term-group kill, non-zero exit rejects). */
161
- runSetupCommand(cmd, cwd, onOutput, signal) {
191
+ runSetupCommand(cmd, cwd, onOutput, signal, env = process.env) {
162
192
  return new Promise((resolve, reject) => {
163
193
  if (signal?.aborted) {
164
194
  const error = new Error("Operation aborted");
@@ -170,7 +200,7 @@ var WorkbenchClient = class {
170
200
  let exited = false;
171
201
  let aborting = false;
172
202
  const socket = this.open(
173
- { op: "exec", command: cmd, cwd },
203
+ { op: "exec", command: cmd, cwd, env: serializableEnv(env) },
174
204
  (frame) => {
175
205
  if (frame.t === "out" && !aborting) {
176
206
  onOutput(frame.s, Buffer.from(frame.d, "base64").toString("utf8"));
@@ -204,14 +234,14 @@ var WorkbenchClient = class {
204
234
  }
205
235
  /** Mirrors setup/commands.ts runStartCommand: returns a live handle that
206
236
  * emits exit/error and whose kill() runs the graceful term-group stop. */
207
- runStartCommand(cmd, cwd, onOutput) {
237
+ runStartCommand(cmd, cwd, onOutput, env = process.env) {
208
238
  let socket;
209
239
  const handle = new RemoteProcessHandle(() => {
210
240
  if (socket) writeFrame(socket, { t: "signal", mode: "term-group" });
211
241
  });
212
242
  let exited = false;
213
243
  socket = this.open(
214
- { op: "exec", command: cmd, cwd },
244
+ { op: "exec", command: cmd, cwd, env: serializableEnv(env) },
215
245
  (frame) => {
216
246
  if (frame.t === "out") {
217
247
  onOutput(frame.s, Buffer.from(frame.d, "base64").toString("utf8"));
@@ -29,7 +29,7 @@ import {
29
29
  spawnOptionsFingerprint,
30
30
  transcriptSize,
31
31
  turnOptionsFrom
32
- } from "./chunk-JG3VMWRQ.js";
32
+ } from "./chunk-QLMNQSJL.js";
33
33
  import {
34
34
  AgentConnection,
35
35
  CodespacePortVisibility,
@@ -59,7 +59,7 @@ import {
59
59
  statWorkspacePath,
60
60
  updateRemoteToken,
61
61
  verifyGitCredential
62
- } from "./chunk-YMZ6Q55T.js";
62
+ } from "./chunk-M4SD2ESQ.js";
63
63
  import {
64
64
  registerBootMilestoneSocketFallback,
65
65
  reportBootMilestone
@@ -80,7 +80,7 @@ import {
80
80
  } from "./chunk-IA45XHOA.js";
81
81
  import {
82
82
  getWorkbenchClient
83
- } from "./chunk-TOTCEWJD.js";
83
+ } from "./chunk-B54XFOXL.js";
84
84
  import {
85
85
  workbenchEnabled
86
86
  } from "./chunk-KMB3BU4S.js";
@@ -8517,7 +8517,7 @@ Workflow:`,
8517
8517
  `- If you toggled into active mode temporarily, mention when you're done so the team can switch you back to planning mode.`
8518
8518
  ].filter(Boolean);
8519
8519
  }
8520
- function buildTaskAgentPreamble(context, workspaceDir) {
8520
+ function buildTaskAgentPreamble(context, workspaceDir, runtimeTui) {
8521
8521
  const managedStack = repoHasScript(workspaceDir, "web:rebuild");
8522
8522
  const stackLines = managedStack ? [
8523
8523
  `- The web app is served on port 3050, the API on port 7090.`,
@@ -8543,8 +8543,8 @@ Working rules:`,
8543
8543
  `- Read a file before your first Write/Edit to it, and batch multiple changes to the same file into a single call instead of many sequential edits.`,
8544
8544
  `- To learn what calls a symbol or where it lives, query the prebuilt code graph before grepping: \`graphify query "<SymbolName>"\` from the repo root. Query a SYMBOL, never a sentence \u2014 \`graphify query "resolveTaskBaseBranch"\` returns the definition plus every call site, while "how does a task get its base branch" seeds unrelated start nodes and returns test files and loggers. Don't know the symbol yet? Grep for the name first, then query it: grep finds names, the graph finds relationships. \`No matching nodes found\` means "not in this graph" (it is prebuilt, so very recent code is absent), NOT "not in the codebase" \u2014 fall back to \`git grep\`. Skip all of this if \`graphify-out/graph.json\` is not present.`,
8545
8545
  `- When a build/lint/test run fails, capture its output to a file once and grep the file \u2014 never re-run the suite just to re-filter the same output.`,
8546
- `- Waiting on long-running commands: if a gate finishes in under ~2 minutes, run it in the foreground with a timeout. For a longer one, launch it with run_in_background and STOP; a completion notification arrives when it finishes, and the workspace stays awake for as long as background work is outstanding, so a backgrounded gate will not be killed by an idle sleep. For the final pre-PR gate a bounded foreground run (\`timeout 590 <gate>\` with Bash \`timeout: 600000\`) is still preferred as defense in depth \u2014 it survives a pod resume, which a background job does not. Never busy-wait with sleep/pgrep/tail loops, and never re-run the suite to escape a wait that looks stalled.`,
8547
- `- Ending your turn with NO tool call is the correct way to wait, and it is safe: the pod stays alive and the next notification re-invokes you. Never emit filler commands (\`echo waiting\`, \`true\`, \`sleep N; echo done\`) to "stay alive" \u2014 they are detected and blocked. The proven long-wait shape: start the job with run_in_background, then end the turn. Arm a ScheduleWakeup (delaySeconds 900-1500, prompt restating your next steps) only when nothing will notify you \u2014 an external CI run, a deploy, a remote queue \u2014 never as insurance against a background job's own notification, which does fire.`,
8546
+ runtimeTui === "codex" ? `- Waiting on long-running commands: retain and resume the command session until it returns an exit result. Finish each required gate before ending the task. Never pretend a completion notification will resume you, and never start another gate while the current one is running.` : `- Waiting on long-running commands: if a gate finishes in under ~2 minutes, run it in the foreground with a timeout. For a longer one, launch it with run_in_background and STOP; a completion notification arrives when it finishes, and the workspace stays awake for as long as background work is outstanding, so a backgrounded gate will not be killed by an idle sleep. For the final pre-PR gate a bounded foreground run (\`timeout 590 <gate>\` with Bash \`timeout: 600000\`) is still preferred as defense in depth \u2014 it survives a pod resume, which a background job does not. Never busy-wait with sleep/pgrep/tail loops, and never re-run the suite to escape a wait that looks stalled.`,
8547
+ runtimeTui === "codex" ? `- Do not end your turn to wait on a required gate. Resume its command session, inspect its exit result, and then continue the checklist.` : `- Ending your turn with NO tool call is the correct way to wait, and it is safe: the pod stays alive and the next notification re-invokes you. Never emit filler commands (\`echo waiting\`, \`true\`, \`sleep N; echo done\`) to "stay alive" \u2014 they are detected and blocked. The proven long-wait shape: start the job with run_in_background, then end the turn. Arm a ScheduleWakeup (delaySeconds 900-1500, prompt restating your next steps) only when nothing will notify you \u2014 an external CI run, a deploy, a remote queue \u2014 never as insurance against a background job's own notification, which does fire.`,
8548
8548
  `
8549
8549
  Git:`,
8550
8550
  `- Stay on \`${context.githubBranch}\` for the whole task: do not check out another branch and do not create one. It was cut from \`${context.baseBranch}\`, and PRs target that automatically.`,
@@ -8561,7 +8561,7 @@ function buildSystemPrompt(mode, context, config, setupLog, agentMode) {
8561
8561
  if (isPackRunner) {
8562
8562
  return buildPackPrompt(mode, context, config, setupLog);
8563
8563
  }
8564
- const parts = isPmActive ? buildActivePreamble(context, config.workspaceDir) : isPm ? buildPmPreamble(context) : buildTaskAgentPreamble(context, config.workspaceDir);
8564
+ const parts = isPmActive ? buildActivePreamble(context, config.workspaceDir) : isPm ? buildPmPreamble(context) : buildTaskAgentPreamble(context, config.workspaceDir, config.runtimeTui);
8565
8565
  if (setupLog.length > 0) {
8566
8566
  parts.push(
8567
8567
  `
@@ -13656,10 +13656,14 @@ var ToolLoopTracker = class {
13656
13656
  };
13657
13657
  function buildRepeatLoopMessage(repeatCount, heavyGateActive) {
13658
13658
  const head = `Conveyor blocked this call: you have run the exact same command ${repeatCount} times in a row with nothing different in between. Repeating it again will return the same result.`;
13659
- const advice = heavyGateActive ? `A build gate (test/typecheck/build) is running on this pod right now. Do NOT poll its log. End your turn \u2014 the completion notification re-invokes you when the gate finishes.` : `If you are waiting on a background job, end your turn instead of polling; the completion notification re-invokes you. If you are stuck, change your approach: read a different file, run a different command, or post to chat and ask the team.`;
13659
+ const codex = process.env.CONVEYOR_TUI === "codex";
13660
+ const advice = codex ? heavyGateActive ? `A build gate is running. Resume its command session for the exit result, then continue the required gates.` : `If a command is still running, resume its session for the result. Otherwise change your approach or post to chat.` : heavyGateActive ? `A build gate (test/typecheck/build) is running on this pod right now. Do NOT poll its log. End your turn \u2014 the completion notification re-invokes you when the gate finishes.` : `If you are waiting on a background job, end your turn instead of polling; the completion notification re-invokes you. If you are stuck, change your approach: read a different file, run a different command, or post to chat and ask the team.`;
13660
13661
  return `${head} ${advice} Call a different tool now.`;
13661
13662
  }
13662
13663
  function buildNoOpKeepAliveMessage(noOpCount) {
13664
+ if (process.env.CONVEYOR_TUI === "codex") {
13665
+ return `Conveyor blocked this call: it is a no-op keep-alive (${noOpCount} this session). If a required command is running, resume its session for the exit result. Otherwise do real work or end the turn.`;
13666
+ }
13663
13667
  return `Conveyor blocked this call: it is a no-op keep-alive (${noOpCount} this session). You do not need to emit tool calls to stay alive. Ending your turn with NO tool call is safe and expected while waiting: the pod stays up and the completion notification re-invokes you. If nothing is running, do real work or end the turn. For a long wait with no notification source, use Monitor or ScheduleWakeup instead of filler commands.`;
13664
13668
  }
13665
13669
  function buildRepeatLoopChatMessage(repeatCount, forceStopped) {
@@ -14110,7 +14114,7 @@ function buildQueryOptions(host, context) {
14110
14114
  const systemPromptText = buildSystemPrompt(
14111
14115
  host.config.mode,
14112
14116
  context,
14113
- { ...host.config, isAuto: host.isAuto },
14117
+ { ...host.config, isAuto: host.isAuto, runtimeTui: process.env.CONVEYOR_TUI },
14114
14118
  host.setupLog,
14115
14119
  mode
14116
14120
  );
@@ -16038,6 +16042,7 @@ var SessionRunner = class _SessionRunner {
16038
16042
  `);
16039
16043
  }
16040
16044
  }
16045
+ this.workspaceCommands?.notifyWorkspaceReady();
16041
16046
  this.mode.applyServerMode(this.fullContext?.agentMode, this.fullContext?.isAuto);
16042
16047
  this.mode.resolveInitialMode(this.taskContext);
16043
16048
  if (this.fullContext?.isAuto && PRE_BUILD_TASK_STATUSES.has(this.taskContext.status) && this.mode.isBuildCapable && hasTaskPlan(this.fullContext.plan)) {
@@ -16070,7 +16075,6 @@ var SessionRunner = class _SessionRunner {
16070
16075
  `
16071
16076
  );
16072
16077
  }
16073
- this.workspaceCommands?.notifyLoopReady();
16074
16078
  while (!this.stopped) {
16075
16079
  if (this._state !== "idle") await this.setState("idle");
16076
16080
  await this.coreLoop();
@@ -16238,7 +16242,6 @@ var SessionRunner = class _SessionRunner {
16238
16242
  }
16239
16243
  if (delivery === "prefill") {
16240
16244
  await this.setState("waiting_for_input");
16241
- this.workspaceCommands?.notifyLoopReady();
16242
16245
  await this.callbacks.onEvent({ type: "execute_mode", mode: effectiveMode, delivery });
16243
16246
  if (this.pendingMessages.length > 0) {
16244
16247
  if (!this.stopped) await this.setState("idle");
@@ -16381,7 +16384,6 @@ var SessionRunner = class _SessionRunner {
16381
16384
  */
16382
16385
  async runPrefilledMessage(msg, effectiveMode) {
16383
16386
  await this.setState("waiting_for_input");
16384
- this.workspaceCommands?.notifyLoopReady();
16385
16387
  await this.callbacks.onEvent({
16386
16388
  type: "execute_mode",
16387
16389
  mode: effectiveMode,
@@ -16718,7 +16720,6 @@ var SessionRunner = class _SessionRunner {
16718
16720
  return this.callbacks.onStatusChange(status);
16719
16721
  },
16720
16722
  onEvent: (event) => {
16721
- this.workspaceCommands?.notifyLoopReady();
16722
16723
  if (!this.agentLiveReported) {
16723
16724
  this.agentLiveReported = true;
16724
16725
  void reportBootMilestone({ key: "agent_live" });
@@ -20,7 +20,7 @@ import {
20
20
  import {
21
21
  WorkbenchError,
22
22
  getWorkbenchClient
23
- } from "./chunk-TOTCEWJD.js";
23
+ } from "./chunk-B54XFOXL.js";
24
24
  import {
25
25
  workbenchEnabled
26
26
  } from "./chunk-KMB3BU4S.js";
@@ -200,7 +200,7 @@ async function loadPtySpawn() {
200
200
  async function resolvePtySpawn() {
201
201
  const { workbenchEnabled } = await import("./mode-ZJSOSLGU.js");
202
202
  if (!workbenchEnabled()) return loadPtySpawn();
203
- const { getWorkbenchClient } = await import("./client-6AUPKKMV.js");
203
+ const { getWorkbenchClient } = await import("./client-DVVHMIOO.js");
204
204
  return (file, args, options) => getWorkbenchClient().spawnPty(file, args, options);
205
205
  }
206
206
  function sessionTempBase() {
@@ -5,7 +5,7 @@ import {
5
5
  readWorkspaceBytes,
6
6
  statWorkspacePath,
7
7
  workspacePathExists
8
- } from "./chunk-YMZ6Q55T.js";
8
+ } from "./chunk-M4SD2ESQ.js";
9
9
  import {
10
10
  reportBootMilestone
11
11
  } from "./chunk-GL2DIQEQ.js";
@@ -16,7 +16,7 @@ import {
16
16
  } from "./chunk-W4LZ7R6Z.js";
17
17
  import {
18
18
  getWorkbenchClient
19
- } from "./chunk-TOTCEWJD.js";
19
+ } from "./chunk-B54XFOXL.js";
20
20
  import {
21
21
  workbenchEnabled
22
22
  } from "./chunk-KMB3BU4S.js";
@@ -197,8 +197,12 @@ async function runDepsSync(options) {
197
197
  let plan = null;
198
198
  try {
199
199
  plan = await resolveDepsSyncPlan(options);
200
- } catch {
201
- return { outcome: "skipped" };
200
+ } catch (error) {
201
+ const cause = error instanceof Error ? error.message : String(error);
202
+ const message = `Dependency state inspection failed before install could start: ${cause}.`;
203
+ options.onOutput("stderr", `[deps] ${message}
204
+ `);
205
+ return { outcome: "failed", message };
202
206
  }
203
207
  if (!plan) return { outcome: "skipped" };
204
208
  const { onOutput, runCommand, env } = options;
@@ -449,16 +453,14 @@ var WorkspaceCommandSupervisor = class {
449
453
  startCommandLaunchRequested = false;
450
454
  started = false;
451
455
  stopped = false;
452
- /** Resolved by notifyLoopReady() once the PTY is live — the runner fires it
453
- * on the first harness event of the initial query (or when a prefill
454
- * parks), NOT after the first turn completes, so the app's start command
455
- * isn't held behind a long working turn. Also resolved by stop() if
456
- * shutdown arrives first either way unblocks the awaiter in
457
- * runSetupAndStart so a supervisor stopped before the loop ever signals
458
- * doesn't hang its background task (and therefore stop()) forever. */
459
- resolveLoopReady;
460
- loopReady = new Promise((resolve) => {
461
- this.resolveLoopReady = resolve;
456
+ /** Resolved once SessionRunner has finished the authoritative task-branch
457
+ * checkout and WIP restore. Those operations can change bun.lock and the
458
+ * schema, so dependency repair and preview startup must not read the tree
459
+ * before this boundary. stop() also resolves it so a failed early boot
460
+ * cannot leave its background task parked forever. */
461
+ resolveWorkspaceReady;
462
+ workspaceReady = new Promise((resolve) => {
463
+ this.resolveWorkspaceReady = resolve;
462
464
  });
463
465
  constructor(options) {
464
466
  this.config = options.config;
@@ -508,17 +510,20 @@ var WorkspaceCommandSupervisor = class {
508
510
  );
509
511
  }
510
512
  }
511
- /** Release the start-command launch called once the runner's core loop
512
- * (the PTY) is live. Idempotent; resolving an already-settled promise is a
513
- * no-op, so a late/duplicate call (or one after stop() already resolved
514
- * it) is harmless. */
513
+ /** Release dependency reconciliation and preview startup after the runner
514
+ * has made the workspace authoritative. Idempotent by Promise semantics. */
515
+ notifyWorkspaceReady() {
516
+ this.resolveWorkspaceReady();
517
+ }
518
+ /** @deprecated Call notifyWorkspaceReady once checkout and WIP restore
519
+ * finish. Kept for simplified callers while they adopt that boundary. */
515
520
  notifyLoopReady() {
516
- this.resolveLoopReady();
521
+ this.notifyWorkspaceReady();
517
522
  }
518
523
  stop() {
519
524
  if (this.shutdownPromise) return this.shutdownPromise;
520
525
  this.stopped = true;
521
- this.resolveLoopReady();
526
+ this.resolveWorkspaceReady();
522
527
  this.abortController.abort();
523
528
  const backgroundTasks = [...this.backgroundTasks];
524
529
  const termination = this.terminateAllStartCommands();
@@ -549,7 +554,7 @@ var WorkspaceCommandSupervisor = class {
549
554
  });
550
555
  if (this.stopped) return;
551
556
  this.reportBootMilestoneFn("sidecars_ready");
552
- await this.loopReady;
557
+ await this.workspaceReady;
553
558
  if (this.stopped) return;
554
559
  await this.reportTurboCacheFn({
555
560
  onOutput: (stream, data) => this.forwardSetupOutput(stream, data)
package/dist/cli.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  WorkspaceCommandSupervisor,
8
8
  startWorkspaceCommandsAfterConnect,
9
9
  stopWorkspaceCommands
10
- } from "./chunk-DDECZOAT.js";
10
+ } from "./chunk-X2MKHJBZ.js";
11
11
  import {
12
12
  DEFAULT_SONNET_MODEL,
13
13
  PtyHarness,
@@ -27,13 +27,13 @@ import {
27
27
  resolveTuiKindFromEnv,
28
28
  runUsageProbe,
29
29
  sampleKeyUsage
30
- } from "./chunk-UP5CGWRY.js";
30
+ } from "./chunk-GVDQQZCO.js";
31
31
  import "./chunk-SR66HQKB.js";
32
32
  import {
33
33
  inheritedEnv,
34
34
  resolvePtySpawn,
35
35
  sessionTempBase
36
- } from "./chunk-JG3VMWRQ.js";
36
+ } from "./chunk-QLMNQSJL.js";
37
37
  import {
38
38
  AgentConnection,
39
39
  CodespacePortVisibility,
@@ -44,12 +44,12 @@ import {
44
44
  createServiceLogger,
45
45
  fetchBootstrap,
46
46
  loadConveyorConfig
47
- } from "./chunk-YMZ6Q55T.js";
47
+ } from "./chunk-M4SD2ESQ.js";
48
48
  import "./chunk-GL2DIQEQ.js";
49
49
  import "./chunk-W4LZ7R6Z.js";
50
50
  import "./chunk-7P6QZHXZ.js";
51
51
  import "./chunk-IA45XHOA.js";
52
- import "./chunk-TOTCEWJD.js";
52
+ import "./chunk-B54XFOXL.js";
53
53
  import "./chunk-KMB3BU4S.js";
54
54
  import "./chunk-6Q6LQBWO.js";
55
55
 
@@ -462,7 +462,11 @@ var AdhocSessionRunner = class {
462
462
  return;
463
463
  }
464
464
  this.commandSupervisor.start();
465
- this.commandSupervisor.notifyLoopReady?.();
465
+ if (this.commandSupervisor.notifyWorkspaceReady) {
466
+ this.commandSupervisor.notifyWorkspaceReady();
467
+ } else {
468
+ this.commandSupervisor.notifyLoopReady?.();
469
+ }
466
470
  await this.connection.emitStatus("running");
467
471
  this.callbacks.onEvent?.({ type: "adhoc_runner_started", projectId: this.config.projectId });
468
472
  this.lifecycle.startIdleTimer();
@@ -1201,7 +1205,7 @@ function wireSpawnChildren(mode, connection, supervisors, logger7) {
1201
1205
 
1202
1206
  // src/cli.ts
1203
1207
  if (process.argv[2] === "boot") {
1204
- const { runBoot } = await import("./boot-V3DNJ3MV.js");
1208
+ const { runBoot } = await import("./boot-CCRZMY2P.js");
1205
1209
  process.exit(await runBoot(process.argv.slice(3)));
1206
1210
  }
1207
1211
  if (isLegacyEntrypointLaunch(process.env)) {
@@ -1303,7 +1307,7 @@ process.on("unhandledRejection", (reason) => {
1303
1307
  process.exit(1);
1304
1308
  });
1305
1309
  if (process.env.CONVEYOR_MODE === "workbench") {
1306
- const { startWorkbenchServer } = await import("./server-2IZBKD3Q.js");
1310
+ const { startWorkbenchServer } = await import("./server-WM23BC5C.js");
1307
1311
  const { oomWatchdogOptionsFromEnv } = await import("./oom-watchdog-PAC5OJJG.js");
1308
1312
  const { DEFAULT_WORKBENCH_PORT } = await import("./protocol-QBCYO4GI.js");
1309
1313
  const port = Number(process.env.CONVEYOR_WORKBENCH_PORT) || DEFAULT_WORKBENCH_PORT;
@@ -1454,7 +1458,7 @@ if (!RUNNER_MODES.includes(CONVEYOR_MODE)) {
1454
1458
  process.exit(1);
1455
1459
  }
1456
1460
  if (CONVEYOR_MODE === "serving") {
1457
- const { runServingSession } = await import("./serve-boot-FJSZE737.js");
1461
+ const { runServingSession } = await import("./serve-boot-VJR6J5PL.js");
1458
1462
  exitContext.runnerMode = "serving";
1459
1463
  exitContext.sessionId = process.env.CONVEYOR_SESSION_ID ?? exitContext.sessionId;
1460
1464
  const outcome = await runServingSession({
@@ -4,7 +4,7 @@ import {
4
4
  WorkbenchError,
5
5
  getWorkbenchClient,
6
6
  resetWorkbenchClient
7
- } from "./chunk-TOTCEWJD.js";
7
+ } from "./chunk-B54XFOXL.js";
8
8
  import "./chunk-KMB3BU4S.js";
9
9
  import "./chunk-6Q6LQBWO.js";
10
10
  export {
package/dist/index.d.ts CHANGED
@@ -683,11 +683,11 @@ interface SessionRunnerPortDiscovery {
683
683
  start(): Promise<void>;
684
684
  stop(): void;
685
685
  }
686
- /** Duck-typed handle onto the boot supervisor just enough surface for the
687
- * runner to release the app's start command once the core loop is live.
688
- * Avoids importing the concrete WorkspaceCommandSupervisor class here. */
686
+ /** Duck-typed handle onto the boot supervisor. The runner releases setup only
687
+ * after its task-branch checkout and WIP restore have made the workspace
688
+ * authoritative. Avoids importing the concrete supervisor here. */
689
689
  interface SessionRunnerWorkspaceCommands {
690
- notifyLoopReady(): void;
690
+ notifyWorkspaceReady(): void;
691
691
  }
692
692
  interface SessionRunnerDependencies {
693
693
  portDiscovery?: SessionRunnerPortDiscovery;
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  SessionRunner,
3
3
  unshallowRepo
4
- } from "./chunk-UP5CGWRY.js";
4
+ } from "./chunk-GVDQQZCO.js";
5
5
  import "./chunk-SR66HQKB.js";
6
- import "./chunk-JG3VMWRQ.js";
6
+ import "./chunk-QLMNQSJL.js";
7
7
  import {
8
8
  AgentConnection,
9
9
  GIT_TIMEOUT_MS,
@@ -17,7 +17,7 @@ import {
17
17
  stageAndCommit,
18
18
  updateRemoteToken,
19
19
  workspacePathExists
20
- } from "./chunk-YMZ6Q55T.js";
20
+ } from "./chunk-M4SD2ESQ.js";
21
21
  import "./chunk-GL2DIQEQ.js";
22
22
  import {
23
23
  runAuthTokenCommand,
@@ -28,7 +28,7 @@ import "./chunk-7P6QZHXZ.js";
28
28
  import "./chunk-IA45XHOA.js";
29
29
  import {
30
30
  getWorkbenchClient
31
- } from "./chunk-TOTCEWJD.js";
31
+ } from "./chunk-B54XFOXL.js";
32
32
  import {
33
33
  workbenchEnabled
34
34
  } from "./chunk-KMB3BU4S.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  WorkspaceCommandSupervisor
3
- } from "./chunk-DDECZOAT.js";
3
+ } from "./chunk-X2MKHJBZ.js";
4
4
  import {
5
5
  AgentConnection,
6
6
  CodespacePortVisibility,
@@ -11,11 +11,11 @@ import {
11
11
  createServiceLogger,
12
12
  ensureOnTaskBranch,
13
13
  loadConveyorConfig
14
- } from "./chunk-YMZ6Q55T.js";
14
+ } from "./chunk-M4SD2ESQ.js";
15
15
  import "./chunk-GL2DIQEQ.js";
16
16
  import "./chunk-W4LZ7R6Z.js";
17
17
  import "./chunk-IA45XHOA.js";
18
- import "./chunk-TOTCEWJD.js";
18
+ import "./chunk-B54XFOXL.js";
19
19
  import "./chunk-KMB3BU4S.js";
20
20
  import "./chunk-6Q6LQBWO.js";
21
21
 
@@ -123,7 +123,11 @@ var ServeSessionRunner = class {
123
123
  );
124
124
  }
125
125
  this.commandSupervisor.start();
126
- this.commandSupervisor.notifyLoopReady?.();
126
+ if (this.commandSupervisor.notifyWorkspaceReady) {
127
+ this.commandSupervisor.notifyWorkspaceReady();
128
+ } else {
129
+ this.commandSupervisor.notifyLoopReady?.();
130
+ }
127
131
  await this.connection.emitStatus("idle");
128
132
  this.callbacks.onEvent?.({ type: "serve_runner_started", taskId: this.config.taskId });
129
133
  await this.waitUntilStopped();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  startWorkbenchServer
3
- } from "./chunk-IBAIJY7V.js";
4
- import "./chunk-JG3VMWRQ.js";
3
+ } from "./chunk-7TSQXIN3.js";
4
+ import "./chunk-QLMNQSJL.js";
5
5
  import "./chunk-W4LZ7R6Z.js";
6
6
  import "./chunk-6Q6LQBWO.js";
7
7
  import "./chunk-6W6UZ4SJ.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rallycry/conveyor-agent",
3
- "version": "11.0.15",
3
+ "version": "11.0.17",
4
4
  "description": "Conveyor Agent Runner v10 - PTY harness for the task chat (SDK harness for audit/project-chat). Agent-as-User architecture with BaseService patterns. Works locally too.",
5
5
  "keywords": [
6
6
  "agent",