@rallycry/conveyor-agent 11.1.6 → 11.1.8

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.
@@ -14,14 +14,14 @@ import {
14
14
  readAgentVersion,
15
15
  refreshSkillsAfterCheckout,
16
16
  runPreReadyBinds
17
- } from "./chunk-V5WR2F2P.js";
17
+ } from "./chunk-VYE7XV6U.js";
18
18
  import "./chunk-76JCOHPE.js";
19
19
  import {
20
20
  GitPrepJob,
21
21
  defaultGit,
22
22
  ensureDir,
23
23
  reportBootMilestone
24
- } from "./chunk-VIUZS7V4.js";
24
+ } from "./chunk-74BAVQKD.js";
25
25
  import "./chunk-W4LZ7R6Z.js";
26
26
  import "./chunk-372R6E4C.js";
27
27
  import "./chunk-SQM2BQ7H.js";
@@ -617,9 +617,9 @@ var SEED_GATES = {
617
617
  }
618
618
  };
619
619
  var SEED_FABLE_OPTION = {
620
- value: "claude-fable-5-1[1m]",
620
+ value: "claude-fable-5-2[1m]",
621
621
  label: "Fable",
622
- description: "Fable 5.1 - most capable for your hardest and longest-running tasks"
622
+ description: "Fable 5.2 - most capable for your hardest and longest-running tasks"
623
623
  };
624
624
  function isPlainObject(value) {
625
625
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -955,6 +955,8 @@ function defaultWorkbenchBootDeps() {
955
955
  git: defaultGit,
956
956
  bundle,
957
957
  podImage: process.env.CONVEYOR_POD_IMAGE === "1",
958
+ partialClone: process.env.CONVEYOR_GIT_PARTIAL_CLONE === "1",
959
+ persistentRepo: (process.env.CONVEYOR_HOST_WORKSPACE ?? process.env.CONVEYOR_MAC_WORKSPACE) === "1",
958
960
  log: ctx.log
959
961
  }),
960
962
  bindsBeforeReady: (ctx, bundle) => runPreReadyBinds(WORKSPACE_DIR, bundle, defaultGit, ctx.log),
@@ -2,7 +2,7 @@ import {
2
2
  mapChatHistory,
3
3
  readAgentVersion,
4
4
  refreshSkillsAfterCheckout
5
- } from "./chunk-V5WR2F2P.js";
5
+ } from "./chunk-VYE7XV6U.js";
6
6
  import {
7
7
  MAX_BETWEEN_TURN_BUFFER,
8
8
  MAX_DIAGNOSTIC_OUTPUT,
@@ -100,10 +100,10 @@ import {
100
100
  toMemberMentionRows,
101
101
  updateRemoteToken,
102
102
  verifyGitCredential
103
- } from "./chunk-GNUXQJR6.js";
103
+ } from "./chunk-X4T2FN7E.js";
104
104
  import {
105
105
  reportBootMilestone
106
- } from "./chunk-VIUZS7V4.js";
106
+ } from "./chunk-74BAVQKD.js";
107
107
  import {
108
108
  describeTokenFile,
109
109
  ghHostsExternallyOwned,
@@ -119,7 +119,7 @@ import {
119
119
  import {
120
120
  LoopLagMonitor,
121
121
  loopStatusForRunnerStatus
122
- } from "./chunk-PIHFGSXB.js";
122
+ } from "./chunk-L2E4EMEP.js";
123
123
  import {
124
124
  getWorkbenchClient
125
125
  } from "./chunk-SQM2BQ7H.js";
@@ -3018,7 +3018,7 @@ function seedWorkspaceTrust(config, trustCwd) {
3018
3018
  var FABLE_MODEL_OPTION = {
3019
3019
  value: `${FABLE_MODEL}[1m]`,
3020
3020
  label: "Fable",
3021
- description: "Fable 5.1 - most capable for your hardest and longest-running tasks"
3021
+ description: "Fable 5.2 - most capable for your hardest and longest-running tasks"
3022
3022
  };
3023
3023
  function seedFableModelOption(config) {
3024
3024
  const cache = Array.isArray(config.additionalModelOptionsCache) ? config.additionalModelOptionsCache : [];
@@ -3350,6 +3350,12 @@ var PtySession = class {
3350
3350
  // type chat text into the questionnaire. Fail-safe — a stale flag only
3351
3351
  // costs a teardown + respawn (`--resume` recovers the conversation).
3352
3352
  questionnairePending = false;
3353
+ // The `aq-…` id of the questionnaire the PreToolUse hook saw last, until its
3354
+ // PostToolUse envelope (or teardown) consumes it. The id names the saved
3355
+ // card poll, and the envelope carries it so the runner can mark that poll
3356
+ // answered in the terminal. Deliberately NOT cleared per turn: the envelope
3357
+ // can arrive after a passive turn already began on the answer's records.
3358
+ openQuestionRequestId = null;
3353
3359
  // Parked-permission-dialog backstop (see handleHookNotification). The last
3354
3360
  // tool the PreToolUse hook saw over the socket, cleared once that tool runs:
3355
3361
  // a parked ExitPlanMode/AskUserQuestion dialog is an expected wait, not an
@@ -3873,9 +3879,8 @@ var PtySession = class {
3873
3879
  /** Render the question card in the web chat NOW — at hook time — instead of
3874
3880
  * whenever the CLI flushes the transcript records (which is only after the
3875
3881
  * questionnaire resolves; see the field comment). */
3876
- emitSyntheticQuestionCard(questions) {
3882
+ emitSyntheticQuestionCard(questions, id) {
3877
3883
  if (questions.length === 0 || typeof this.bridge?.sendChatEvent !== "function") return;
3878
- const id = `aq-${randomUUID()}`;
3879
3884
  this.pendingSyntheticQuestionIds.push(id);
3880
3885
  this.sendChatEvent({
3881
3886
  kind: "tool_use",
@@ -3926,6 +3931,7 @@ var PtySession = class {
3926
3931
  */
3927
3932
  injectIntoRunningTurn(text) {
3928
3933
  if (!this.pty || this._toreDown || this.exited) return false;
3934
+ if (this.questionnairePending) return false;
3929
3935
  if (this.activeQueue === null) return false;
3930
3936
  if (!this.adapter.capabilities.structuredEvents) return false;
3931
3937
  if (!text.trim()) return false;
@@ -3974,6 +3980,7 @@ var PtySession = class {
3974
3980
  if (this._toreDown) return;
3975
3981
  this._toreDown = true;
3976
3982
  this.questionnairePending = false;
3983
+ this.openQuestionRequestId = null;
3977
3984
  this.disarmPlanDialogAutoAccept();
3978
3985
  this.disarmSubmitNudge();
3979
3986
  this.closeSyntheticQuestionCards();
@@ -4269,7 +4276,12 @@ var PtySession = class {
4269
4276
  if (this.pendingPlanApproval && progress.tool_name === "ExitPlanMode") {
4270
4277
  this.disarmPlanDialogAutoAccept();
4271
4278
  }
4272
- if (progress.tool_name === "AskUserQuestion") this.questionnairePending = false;
4279
+ let answeredRequestId = null;
4280
+ if (progress.tool_name === "AskUserQuestion") {
4281
+ this.questionnairePending = false;
4282
+ answeredRequestId = this.openQuestionRequestId;
4283
+ this.openQuestionRequestId = null;
4284
+ }
4273
4285
  this.permissionAlertArmed = false;
4274
4286
  if (progress.tool_name !== void 0 && progress.tool_name === this.lastPreToolUseTool) {
4275
4287
  this.lastPreToolUseTool = null;
@@ -4278,7 +4290,8 @@ var PtySession = class {
4278
4290
  this.pushEvent({
4279
4291
  type: "tool_progress",
4280
4292
  ...progress.tool_name === void 0 ? {} : { tool_name: progress.tool_name },
4281
- ...progress.elapsed_time_seconds === void 0 ? {} : { elapsed_time_seconds: progress.elapsed_time_seconds }
4293
+ ...progress.elapsed_time_seconds === void 0 ? {} : { elapsed_time_seconds: progress.elapsed_time_seconds },
4294
+ ...answeredRequestId ? { requestId: answeredRequestId } : {}
4282
4295
  });
4283
4296
  }
4284
4297
  /**
@@ -4297,8 +4310,10 @@ var PtySession = class {
4297
4310
  this.disarmPlanDialogAutoAccept();
4298
4311
  this.questionnairePending = true;
4299
4312
  const questions = parseUserQuestions(request.tool_input);
4300
- this.pushEvent({ type: "user_question", questions });
4301
- this.emitSyntheticQuestionCard(questions);
4313
+ const requestId = `aq-${randomUUID()}`;
4314
+ this.openQuestionRequestId = requestId;
4315
+ this.pushEvent({ type: "user_question", questions, requestId });
4316
+ this.emitSyntheticQuestionCard(questions, requestId);
4302
4317
  return { decision: "allow" };
4303
4318
  }
4304
4319
  const canUseTool = this.turn.canUseTool;
@@ -5114,9 +5129,9 @@ async function seedOpenCodeOauth(env) {
5114
5129
 
5115
5130
  // src/harness/openai-model.ts
5116
5131
  var DEFAULT_OPENAI_CODING_MODEL = DEFAULT_CODEX_CODING_MODEL;
5117
- function resolveOpenAiCodingModel(model2) {
5132
+ function resolveOpenAiCodingModel(model2, fallback = DEFAULT_OPENAI_CODING_MODEL) {
5118
5133
  if (!model2 || model2.startsWith("claude-") || model2.includes("/") && !model2.startsWith("openai/")) {
5119
- return DEFAULT_OPENAI_CODING_MODEL;
5134
+ return fallback;
5120
5135
  }
5121
5136
  return model2.replace(/^openai\//, "");
5122
5137
  }
@@ -5154,11 +5169,12 @@ function buildOpenCodeChildEnv(source, configContent) {
5154
5169
  if (configContent) env.OPENCODE_CONFIG_CONTENT = configContent;
5155
5170
  return env;
5156
5171
  }
5172
+ var DEFAULT_OPENCODE_OPENAI_MODEL = "gpt-5.6-terra";
5157
5173
  function resolveOpenCodeModel(source, optionsModel) {
5158
5174
  const model2 = source.CONVEYOR_AGENT_MODEL ?? optionsModel;
5159
5175
  const configuredProvider = source.CONVEYOR_AGENT_PROVIDER;
5160
5176
  if (configuredProvider === "openai" || !configuredProvider && !model2) {
5161
- return `openai/${resolveOpenAiCodingModel(model2)}`;
5177
+ return `openai/${resolveOpenAiCodingModel(model2, DEFAULT_OPENCODE_OPENAI_MODEL)}`;
5162
5178
  }
5163
5179
  if (!model2) return void 0;
5164
5180
  if (model2.startsWith("zen/")) return `opencode/${model2.slice("zen/".length)}`;
@@ -6046,7 +6062,6 @@ import {
6046
6062
  closeSync,
6047
6063
  existsSync,
6048
6064
  openSync,
6049
- readFileSync as readFileSync3,
6050
6065
  readSync,
6051
6066
  renameSync as renameSync2,
6052
6067
  statSync as statSync2,
@@ -6400,7 +6415,8 @@ function buildHarnessContracts(context) {
6400
6415
  ] : []
6401
6416
  ];
6402
6417
  }
6403
- function buildDiscoveryPrompt(context, runnerMode) {
6418
+ function buildDiscoveryPrompt(context, runnerMode, runtimeTui) {
6419
+ const usesClaudePlanGate = !runtimeTui || runtimeTui === "claude-code";
6404
6420
  const parts = [
6405
6421
  `
6406
6422
  ## Mode: Discovery`,
@@ -6411,11 +6427,15 @@ function buildDiscoveryPrompt(context, runnerMode) {
6411
6427
  ] : [],
6412
6428
  ``,
6413
6429
  `### Contracts this environment enforces`,
6414
- `- You are READ-ONLY. File writes are denied outside \`.claude/plans/\` and \`/tmp/\`, and so are the commands that would start the work: git commit/push/merge/rebase/checkout, git apply, gh pr create, package publish. Everything else runs without an approval prompt \u2014 the pod is a sandbox, so investigate freely (build, test, query the dev DB, read logs).`,
6430
+ usesClaudePlanGate ? `- You are READ-ONLY. File writes are denied outside \`.claude/plans/\` and \`/tmp/\`, and so are the commands that would start the work: git commit/push/merge/rebase/checkout, git apply, gh pr create, package publish. Everything else runs without an approval prompt \u2014 the pod is a sandbox, so investigate freely (build, test, query the dev DB, read logs).` : `- Keep the repository READ-ONLY. Use \`/tmp/\` for scratch files. Do not edit, commit, push, publish, open a PR, or start implementation.`,
6415
6431
  `- Research deliverables the team should keep (a diagram, an HTML report, a screenshot, a data export) go on the card with \`mcp__conveyor__upload_attachment\`: write the file under \`/tmp/\` first, and pass \`title\` as the caption so it shows in the thread. Never publish one as a Claude artifact.`,
6416
6432
  `- A plan file on disk is NOT the plan. Only \`update_task\` saves it to the card.`,
6417
- `- **ExitPlanMode is the LAST step and it validates.** It fails until the card has a plan, story points, risk, and a title \u2014 the plan comes from \`update_task\`, and story points, risk and title from \`update_task_properties\`. Calling it early wastes a turn on a denial.`,
6418
- `- ExitPlanMode does NOT start building. It parks this session for human review; the team decides when to build.`,
6433
+ `- Set story points, risk, and title with \`update_task_properties\` before saving the final plan. If this is a pack, save all child plans first.`,
6434
+ ...usesClaudePlanGate ? [
6435
+ `- After saving the plan and posting the \`plan_ready\` milestone, call ExitPlanMode. It validates the saved plan and required properties, then parks the Planner for review. It does NOT start building.`
6436
+ ] : [
6437
+ `- After saving the plan with \`update_task\`, post \`milestone: "plan_ready"\` using \`mcp__conveyor__post_to_chat\` and end the turn. Conveyor handles the card transition from the saved plan. This is the finish line for this runtime, even if a skill describes a native plan-exit tool. Stay in the Planner role.`
6438
+ ],
6419
6439
  ...runnerMode === "plan" ? [
6420
6440
  `- You are the Planner half of this card's lifecycle. When the team presses Build, a separate **Builder** session starts on THIS pod and takes over \u2014 you never become it. So the plan has to stand on its own: the Builder inherits this repo checkout, but none of your reasoning.`
6421
6441
  ] : [],
@@ -6448,10 +6468,10 @@ function buildBuildingPrompt(context) {
6448
6468
  if (context) parts.push(...buildPropertyInstructions(context));
6449
6469
  return parts.join("\n");
6450
6470
  }
6451
- function buildModePrompt(agentMode, context, runnerMode) {
6471
+ function buildModePrompt(agentMode, context, runnerMode, runtimeTui) {
6452
6472
  switch (agentMode) {
6453
6473
  case "discovery":
6454
- return buildDiscoveryPrompt(context, runnerMode);
6474
+ return buildDiscoveryPrompt(context, runnerMode, runtimeTui);
6455
6475
  case "building":
6456
6476
  return buildBuildingPrompt(context);
6457
6477
  case "review":
@@ -7157,7 +7177,7 @@ ${HUMAN_PROSE_WRITING_STYLE}`
7157
7177
  `Use the mcp__conveyor__create_pull_request tool to open PRs \u2014 it automatically stages, commits, and pushes changes before creating the PR. Do NOT use gh CLI or shell commands for PR creation.`
7158
7178
  );
7159
7179
  }
7160
- const modePrompt = buildModePrompt(agentMode, context, mode);
7180
+ const modePrompt = buildModePrompt(agentMode, context, mode, config.runtimeTui);
7161
7181
  if (modePrompt) {
7162
7182
  parts.push(modePrompt);
7163
7183
  }
@@ -7359,6 +7379,11 @@ function buildFreshInstructions(isPlanning, context) {
7359
7379
  `You are the Planner on this card \u2014 scope and plan it with the team. A separate Builder session implements it.`
7360
7380
  ) : builderKickoff(context, `You are the Builder on this card \u2014 implement its plan.`);
7361
7381
  }
7382
+ function buildResumedPlannerInstructions() {
7383
+ return plannerKickoff(
7384
+ `You are resuming your own planning conversation on this card. What you researched before the pause is earlier in this conversation: do not repeat it. Anything new since you paused, including answers to your questions, is in New Messages above. Fold it into the plan and continue the workflow from where you stopped.`
7385
+ );
7386
+ }
7362
7387
  function buildFreshCodeReviewInstructions(context) {
7363
7388
  const parts = [...buildSkillInvocation("/conveyor-review"), branchRule(context, true)];
7364
7389
  if (context.githubPRUrl) {
@@ -7387,7 +7412,7 @@ function buildIdleRelaunchInstructions(context, isPlanning) {
7387
7412
  ...builderKickoff(context, `You are the Builder on this card \u2014 pick up where you left off.`)
7388
7413
  ];
7389
7414
  }
7390
- function buildInstructions(mode, context, scenario, agentMode, isAuto) {
7415
+ function buildInstructions(mode, context, scenario, agentMode, isAuto, resumed) {
7391
7416
  const parts = [`
7392
7417
  ## Instructions`];
7393
7418
  const isPm = mode === "pm";
@@ -7402,7 +7427,9 @@ function buildInstructions(mode, context, scenario, agentMode, isAuto) {
7402
7427
  return parts;
7403
7428
  }
7404
7429
  if (scenario === "fresh") {
7405
- parts.push(...buildFreshInstructions(isPlanning, context));
7430
+ parts.push(
7431
+ ...isPlanning && resumed ? buildResumedPlannerInstructions() : buildFreshInstructions(isPlanning, context)
7432
+ );
7406
7433
  return parts;
7407
7434
  }
7408
7435
  const newBatch = relaunchMessageBatch(context);
@@ -7422,7 +7449,7 @@ function buildInstructions(mode, context, scenario, agentMode, isAuto) {
7422
7449
  parts.push(...buildFeedbackInstructions(context, isPlanning));
7423
7450
  return parts;
7424
7451
  }
7425
- async function buildInitialPrompt(mode, context, isAuto, agentMode) {
7452
+ async function buildInitialPrompt(mode, context, isAuto, agentMode, opts) {
7426
7453
  const isPackRunner = isPackRunnerSession(mode);
7427
7454
  if (!isPackRunner) {
7428
7455
  const sessionRelaunch = buildRelaunchWithSession(mode, context, agentMode, isAuto);
@@ -7436,7 +7463,7 @@ async function buildInitialPrompt(mode, context, isAuto, agentMode) {
7436
7463
  scenario = "fresh";
7437
7464
  }
7438
7465
  const body = await buildTaskBody(context, mode);
7439
- const instructions = isPackRunner ? buildSinglePodPackInstructions(scenario) : buildInstructions(mode, context, scenario, agentMode, isAuto);
7466
+ const instructions = isPackRunner ? buildSinglePodPackInstructions(scenario) : buildInstructions(mode, context, scenario, agentMode, isAuto, opts?.resumed);
7440
7467
  return [...body, ...instructions].join("\n");
7441
7468
  }
7442
7469
 
@@ -10745,8 +10772,10 @@ function buildUploadAttachmentTool(connection, config) {
10745
10772
  ...supersedes ? { supersedes } : {}
10746
10773
  });
10747
10774
  const isShowcase = result.showcase === true;
10775
+ const localPrVideo = isShowcase && config.conveyorApiUrl === "http://conveyor.local-conveyor.svc.cluster.local:7090" && ["video/mp4", "video/quicktime", "video/webm"].includes(mimeType);
10776
+ const publication = localPrVideo ? " The Local Conveyor desktop app will publish this video and link it on the card once a GitHub PR is linked and GitHub CLI is signed in on the host." : describeEmbed(fileName, result.downloadUrl, isShowcase);
10748
10777
  return textResult(
10749
- `${isShowcase ? "Showcase attachment. " : ""}Uploaded ${fileName} (${info.size} bytes) and posted it to the task chat${caption ? ` with caption "${caption}"` : ""}. File ID: ${result.fileId}${describeTags(result.appliedTags, result.unknownTags)}${describeSupersede(result.superseded, result.supersedeError)}${describeEmbed(fileName, result.downloadUrl, isShowcase)}`
10778
+ `${isShowcase ? "Showcase attachment. " : ""}Uploaded ${fileName} (${info.size} bytes) and posted it to the task chat${caption ? ` with caption "${caption}"` : ""}. File ID: ${result.fileId}${describeTags(result.appliedTags, result.unknownTags)}${describeSupersede(result.superseded, result.supersedeError)}${publication}`
10750
10779
  );
10751
10780
  } catch (error) {
10752
10781
  return textResult(
@@ -13039,15 +13068,18 @@ function questionTextFromEvent(event) {
13039
13068
  async function armQuestionPending(host, state, event) {
13040
13069
  state.questionPending = true;
13041
13070
  const questionText = questionTextFromEvent(event);
13042
- host.callbacks.onUserQuestion?.({
13043
- kind: "armed",
13044
- ...questionText === void 0 ? {} : { questionText }
13045
- });
13046
13071
  await host.connection.emitStatus(
13047
13072
  "waiting_for_input",
13048
13073
  AGENT_STATUS_REASON_USER_QUESTION,
13049
13074
  questionText
13050
13075
  );
13076
+ const persisted = event.requestId !== void 0 && event.questions.length > 0 ? await host.connection.recordAgentQuestion(event.requestId, event.questions) : false;
13077
+ host.callbacks.onUserQuestion?.({
13078
+ kind: "armed",
13079
+ ...questionText === void 0 ? {} : { questionText },
13080
+ questions: event.questions,
13081
+ persisted
13082
+ });
13051
13083
  await host.callbacks.onStatusChange("waiting_for_input");
13052
13084
  }
13053
13085
  async function clearQuestionPending(host, state, options) {
@@ -13071,6 +13103,7 @@ async function applyQuestionTransitions(event, host, state) {
13071
13103
  return;
13072
13104
  case "tool_progress":
13073
13105
  if (event.tool_name === "AskUserQuestion") {
13106
+ if (event.requestId) host.connection.markAgentQuestionAnswered(event.requestId);
13074
13107
  await clearQuestionPending(host, state, { emitRunning: true });
13075
13108
  }
13076
13109
  return;
@@ -13813,37 +13846,79 @@ function transcriptHasConversation(path) {
13813
13846
  }
13814
13847
  }
13815
13848
  }
13849
+ var REPAIR_TAIL_WINDOW_BYTES = 1024 * 1024;
13850
+ var NEWLINE = 10;
13816
13851
  function repairTornSessionFile(path) {
13852
+ let fd;
13817
13853
  try {
13818
13854
  if (!existsSync(path)) return false;
13819
- const content = readFileSync3(path, "utf8");
13820
- if (content.length === 0) return false;
13821
- let keepEnd = content.length;
13822
- if (!content.endsWith("\n")) {
13823
- keepEnd = content.lastIndexOf("\n") + 1;
13824
- }
13825
- while (keepEnd > 0) {
13826
- const prevNewline = content.lastIndexOf("\n", keepEnd - 2);
13827
- const line = content.slice(prevNewline + 1, keepEnd - 1).trim();
13828
- if (line.length > 0) {
13829
- try {
13830
- JSON.parse(line);
13831
- break;
13832
- } catch {
13833
- }
13834
- }
13835
- keepEnd = prevNewline + 1;
13836
- }
13837
- if (keepEnd === content.length) return false;
13838
- truncateSync(path, Buffer.byteLength(content.slice(0, keepEnd), "utf8"));
13855
+ const size = statSync2(path).size;
13856
+ if (size === 0) return false;
13857
+ fd = openSync(path, "r");
13858
+ const keepEnd = findLastWholeLineEnd(fd, size);
13859
+ if (keepEnd === size) return false;
13860
+ truncateSync(path, keepEnd);
13839
13861
  logger6.warn("Repaired torn transcript before resume", {
13840
13862
  path,
13841
- trimmedBytes: content.length - keepEnd
13863
+ trimmedBytes: size - keepEnd
13842
13864
  });
13843
13865
  return true;
13844
13866
  } catch {
13845
13867
  return false;
13868
+ } finally {
13869
+ if (fd !== void 0) {
13870
+ try {
13871
+ closeSync(fd);
13872
+ } catch {
13873
+ }
13874
+ }
13875
+ }
13876
+ }
13877
+ function findLastWholeLineEnd(fd, size) {
13878
+ let window = Math.min(size, REPAIR_TAIL_WINDOW_BYTES);
13879
+ for (; ; ) {
13880
+ const windowStart = size - window;
13881
+ const buffer = Buffer.alloc(window);
13882
+ let read = 0;
13883
+ while (read < window) {
13884
+ const n = readSync(fd, buffer, read, window - read, windowStart + read);
13885
+ if (n === 0) break;
13886
+ read += n;
13887
+ }
13888
+ const tail = buffer.subarray(0, read);
13889
+ const result = lastWholeLineEndInWindow(tail, windowStart);
13890
+ if (result !== null) return result;
13891
+ if (window === size) return 0;
13892
+ window = Math.min(size, window * 2);
13893
+ }
13894
+ }
13895
+ function lastWholeLineEndInWindow(tail, windowStart) {
13896
+ const end = windowStart + tail.length;
13897
+ let keepEnd = end;
13898
+ if (tail[tail.length - 1] !== NEWLINE) {
13899
+ const lastNewline = tail.lastIndexOf(NEWLINE);
13900
+ if (lastNewline === -1) {
13901
+ if (windowStart > 0) return null;
13902
+ return 0;
13903
+ }
13904
+ keepEnd = windowStart + lastNewline + 1;
13905
+ }
13906
+ while (keepEnd > 0) {
13907
+ const searchFrom = keepEnd - 2 - windowStart;
13908
+ const prevNewline = searchFrom >= 0 ? tail.lastIndexOf(NEWLINE, searchFrom) : -1;
13909
+ if (prevNewline === -1 && windowStart > 0) return null;
13910
+ const lineStart = prevNewline + 1;
13911
+ const line = tail.subarray(lineStart, keepEnd - 1 - windowStart).toString("utf8").trim();
13912
+ if (line.length > 0) {
13913
+ try {
13914
+ JSON.parse(line);
13915
+ break;
13916
+ } catch {
13917
+ }
13918
+ }
13919
+ keepEnd = windowStart + lineStart;
13846
13920
  }
13921
+ return keepEnd;
13847
13922
  }
13848
13923
  function resolvePromptDelivery(inputs) {
13849
13924
  if (inputs.harnessKind !== "pty") return "submit";
@@ -14299,7 +14374,8 @@ async function runInitialQuery(host, context, options, resume, promptDelivery) {
14299
14374
  host.config.mode,
14300
14375
  context,
14301
14376
  host.isAuto,
14302
- host.agentMode
14377
+ host.agentMode,
14378
+ { resumed: !!resume }
14303
14379
  );
14304
14380
  const { prompt, appendSystemPrompt } = selectInitialPromptInput(
14305
14381
  promptDelivery,
@@ -15565,6 +15641,52 @@ function findLiveChild(sources) {
15565
15641
  return null;
15566
15642
  }
15567
15643
 
15644
+ // src/runner/question-timeout-prompt.ts
15645
+ function formatGrace(ms) {
15646
+ if (ms >= 6e4) {
15647
+ const minutes = Math.round(ms / 6e4);
15648
+ return `${minutes} ${minutes === 1 ? "minute" : "minutes"}`;
15649
+ }
15650
+ const seconds = Math.max(1, Math.round(ms / 1e3));
15651
+ return `${seconds} ${seconds === 1 ? "second" : "seconds"}`;
15652
+ }
15653
+ function questionLines(questions) {
15654
+ if (questions.length === 0) return [];
15655
+ const noun = questions.length === 1 ? "Your question was" : "Your questions were";
15656
+ return [
15657
+ `${noun}:`,
15658
+ ...questions.map((q) => {
15659
+ const header = q.header.trim();
15660
+ return header ? `- ${header}: ${q.question}` : `- ${q.question}`;
15661
+ })
15662
+ ];
15663
+ }
15664
+ function buildQuestionTimeoutPrompt(input) {
15665
+ const grace = formatGrace(input.graceMs);
15666
+ const asked = questionLines(input.questions);
15667
+ if (!input.persisted) {
15668
+ return [
15669
+ `No one answered your clarifying questions within ${grace}.`,
15670
+ ...asked,
15671
+ 'Do this now: (1) Save your findings-so-far as the card plan (`update_task`). (2) Post the unanswered questions to chat with `post_to_chat` using `milestone: "blocked"`, stating the assumption you would make for each (this is a parking note \u2014 the question already paged them). (3) If you can safely proceed on your best-judgment answers, state the assumptions and continue; otherwise end your turn \u2014 answers posted in chat will be delivered when you resume.'
15672
+ ].join("\n");
15673
+ }
15674
+ const steps = input.isPlanner ? [
15675
+ "Save a checkpoint plan with `update_task`: what you verified (cite file:line), the open questions, and your next steps.",
15676
+ 'Post one line with `post_to_chat` and `milestone: "blocked"` that says you are waiting on the question on the card. Do not repeat the question.'
15677
+ ] : [
15678
+ 'Post a short progress note with `post_to_chat` and `milestone: "blocked"`: what is done, and what the open question decides. Do not repeat the question.'
15679
+ ];
15680
+ steps.push(
15681
+ "If you can safely proceed on stated assumptions, state them and continue. Otherwise end your turn: an answer on the card or in chat wakes you, even after this workspace sleeps, and you continue this conversation."
15682
+ );
15683
+ return [
15684
+ `No one answered your question within ${grace}.`,
15685
+ ...asked,
15686
+ `It is saved as a poll on the card and stays open there, so do not post it again. Do this now: ${steps.map((step, i) => `(${i + 1}) ${step}`).join(" ")}`
15687
+ ].join("\n");
15688
+ }
15689
+
15568
15690
  // src/runner/session-runner.ts
15569
15691
  var AUTO_RUN_MODES = /* @__PURE__ */ new Set(["building", "auto", "review", "discovery", "chat"]);
15570
15692
  var CHILD_DEFER_RECHECK_MS = 60 * 1e3;
@@ -15577,7 +15699,6 @@ function resolveQuestionGraceMs() {
15577
15699
  }
15578
15700
  var QUESTION_TYPING_RECENT_MS = 6e4;
15579
15701
  var QUESTION_TYPING_DEFER_MS = 2 * 6e4;
15580
- var QUESTION_TIMEOUT_PROMPT = 'No one answered your clarifying questions within 10 minutes. Do this now: (1) Save your findings-so-far as the card plan (`update_task`). (2) Post the unanswered questions to chat with `post_to_chat` using `milestone: "blocked"`, stating the assumption you would make for each (this is a parking note \u2014 the question already paged them). (3) If you can safely proceed on your best-judgment answers, state the assumptions and continue; otherwise end your turn \u2014 answers posted in chat will be delivered when you resume.';
15581
15702
  var SessionRunner = class _SessionRunner {
15582
15703
  connection;
15583
15704
  mode;
@@ -15650,6 +15771,10 @@ var SessionRunner = class _SessionRunner {
15650
15771
  * liveness hold above is bounded by timestamp arithmetic, so a lost timer
15651
15772
  * still expires the hold — it just skips the un-park injection. */
15652
15773
  questionGraceTimer = null;
15774
+ /** What the parked questionnaire asked, and whether the API saved it as a
15775
+ * card poll — read when the grace expires, to word the timeout prompt.
15776
+ * Cleared with the hold. */
15777
+ pendingQuestion = null;
15653
15778
  constructor(config, callbacks, deps = {}) {
15654
15779
  this.config = config;
15655
15780
  this.callbacks = callbacks;
@@ -16998,6 +17123,10 @@ ${outcome.failures.join("\n")}
16998
17123
  handleUserQuestionSignal(signal) {
16999
17124
  if (signal.kind === "armed") {
17000
17125
  this.questionPendingSince = Date.now();
17126
+ this.pendingQuestion = {
17127
+ questions: signal.questions ?? [],
17128
+ persisted: signal.persisted === true
17129
+ };
17001
17130
  this.armQuestionGraceTimer(resolveQuestionGraceMs());
17002
17131
  this.refreshLoopStatus();
17003
17132
  } else if (signal.kind === "answered") {
@@ -17014,6 +17143,7 @@ ${outcome.failures.join("\n")}
17014
17143
  clearTimeout(this.questionGraceTimer);
17015
17144
  this.questionGraceTimer = null;
17016
17145
  }
17146
+ this.pendingQuestion = null;
17017
17147
  if (this.questionPendingSince === null) return;
17018
17148
  this.questionPendingSince = null;
17019
17149
  this.refreshLoopStatus();
@@ -17041,11 +17171,13 @@ ${outcome.failures.join("\n")}
17041
17171
  process.stderr.write(
17042
17172
  "[conveyor-agent] Question grace expired with no answer \u2014 un-parking the agent\n"
17043
17173
  );
17044
- this.injectMessage({
17045
- content: QUESTION_TIMEOUT_PROMPT,
17046
- userId: "system",
17047
- source: "question_timeout"
17174
+ const content = buildQuestionTimeoutPrompt({
17175
+ graceMs: resolveQuestionGraceMs(),
17176
+ questions: this.pendingQuestion?.questions ?? [],
17177
+ persisted: this.pendingQuestion?.persisted ?? false,
17178
+ isPlanner: this.mode.effectiveMode === "discovery"
17048
17179
  });
17180
+ this.injectMessage({ content, userId: "system", source: "question_timeout" });
17049
17181
  }
17050
17182
  /** Mirror the resolved status into the loop-lag buffer so the starvation-proof
17051
17183
  * heartbeat worker reports it too. Returns what it wrote. */
@@ -138,11 +138,11 @@ async function syncTaskBranchToRepo(deps, paths) {
138
138
  log.error(`[boot] ERROR: remote set-url failed: ${errText(err)}`);
139
139
  return { state: "failed", reason: "remote set-url failed" };
140
140
  }
141
- const credentialFailure = await persistCredentialHelper(deps, paths);
142
- if (credentialFailure) return credentialFailure;
141
+ const configFailure = await configureWorkspaceGit(deps, paths);
142
+ if (configFailure) return configFailure;
143
143
  const [, resetSucceeded] = await Promise.all([
144
144
  warmBaseBranch(deps, paths),
145
- resetTrackedChanges(deps, paths)
145
+ deps.persistentRepo ? Promise.resolve(true) : resetTrackedChanges(deps, paths)
146
146
  ]);
147
147
  if (!resetSucceeded) return { state: "failed", reason: "pre-checkout reset failed" };
148
148
  log.info(`[boot] Repo remote ready; agent will checkout ${branch}`);
@@ -178,21 +178,33 @@ async function resetTrackedChanges(deps, paths) {
178
178
  log.info(`[boot] step=gitResetTracked ms=${Math.round(performance.now() - started)}`);
179
179
  }
180
180
  }
181
- async function persistCredentialHelper(deps, paths) {
181
+ async function configureWorkspaceGit(deps, paths) {
182
182
  try {
183
183
  await deps.git(["config", "--local", "credential.helper", paths.credentialHelper], {
184
184
  cwd: paths.repoDir,
185
185
  timeoutMs: QUICK_GIT_TIMEOUT_MS
186
186
  });
187
- return null;
188
187
  } catch (err) {
189
188
  deps.log.error(`[boot] ERROR: credential helper config failed: ${errText(err)}`);
190
189
  return { state: "failed", reason: "credential helper config failed" };
191
190
  }
191
+ if (deps.persistentRepo) {
192
+ try {
193
+ await deps.git(["config", "--local", "core.checkStat", "minimal"], {
194
+ cwd: paths.repoDir,
195
+ timeoutMs: QUICK_GIT_TIMEOUT_MS
196
+ });
197
+ } catch (err) {
198
+ deps.log.error(`[boot] ERROR: shared workspace Git config failed: ${errText(err)}`);
199
+ return { state: "failed", reason: "shared workspace Git config failed" };
200
+ }
201
+ }
202
+ return null;
192
203
  }
193
204
  async function clonePostAssignment(deps, paths) {
194
205
  const { git, log } = deps;
195
- const { branch, baseBranch, checkoutRef } = deps.bundle.gitPlan;
206
+ const { branch, baseBranch, checkoutRef, provider } = deps.bundle.gitPlan;
207
+ const filter = deps.partialClone && provider === "github" ? ["--filter=blob:none"] : [];
196
208
  log.info("[boot] Cloning repo post-assignment (pre-clone was missing)...");
197
209
  if (checkoutRef) {
198
210
  try {
@@ -201,6 +213,7 @@ async function clonePostAssignment(deps, paths) {
201
213
  "-c",
202
214
  `credential.helper=${paths.credentialHelper}`,
203
215
  "clone",
216
+ ...filter,
204
217
  "--depth",
205
218
  "1",
206
219
  "--single-branch",
@@ -215,8 +228,8 @@ async function clonePostAssignment(deps, paths) {
215
228
  log.error(`[boot] ERROR: post-assignment clone failed: ${errText(err)}`);
216
229
  return { state: "failed", reason: "post-assignment clone failed" };
217
230
  }
218
- const credentialFailure = await persistCredentialHelper(deps, paths);
219
- if (credentialFailure) return credentialFailure;
231
+ const configFailure = await configureWorkspaceGit(deps, paths);
232
+ if (configFailure) return configFailure;
220
233
  try {
221
234
  await git(["fetch", "origin", `+${checkoutRef}:refs/remotes/origin/pr-checkout`], {
222
235
  cwd: paths.repoDir,
@@ -243,6 +256,7 @@ async function clonePostAssignment(deps, paths) {
243
256
  "-c",
244
257
  `credential.helper=${paths.credentialHelper}`,
245
258
  "clone",
259
+ ...filter,
246
260
  "--single-branch",
247
261
  "--branch",
248
262
  baseBranch,
@@ -10631,15 +10631,23 @@ function conveyorReconnectOptions() {
10631
10631
  extraHeaders: { "ngrok-skip-browser-warning": "true" }
10632
10632
  };
10633
10633
  }
10634
+ function conveyorSocketEndpoint(apiUrl) {
10635
+ const endpoint = new URL(apiUrl);
10636
+ if (!["http:", "https:", "ws:", "wss:"].includes(endpoint.protocol) || endpoint.username || endpoint.password) {
10637
+ throw new Error("Conveyor API URL must be an HTTP or WebSocket URL without credentials.");
10638
+ }
10639
+ return { url: endpoint.origin, path: endpoint.pathname.replace(/\/+$/, "") + "/socket.io" };
10640
+ }
10634
10641
 
10635
10642
  // src/connection/quickdraw-transport.ts
10636
10643
  var AGENT_SESSION_SERVICE = "agentSessionService";
10637
10644
  function createAgentSessionConnection(options) {
10645
+ const endpoint = conveyorSocketEndpoint(options.apiUrl);
10638
10646
  return createQuickdrawConnection({
10639
- url: options.apiUrl,
10647
+ url: endpoint.url,
10640
10648
  auth: options.auth,
10641
10649
  transports: ["websocket"],
10642
- socketOptions: conveyorReconnectOptions(),
10650
+ socketOptions: { ...conveyorReconnectOptions(), path: endpoint.path },
10643
10651
  timeoutMs: options.timeoutMs,
10644
10652
  // The default reloads a browser page; a pod has none. An API that refuses
10645
10653
  // this protocol answers nothing the agent can use, so say why, loudly.
@@ -8,10 +8,10 @@ import {
8
8
  readWorkspaceBytes,
9
9
  statWorkspacePath,
10
10
  workspacePathExists
11
- } from "./chunk-GNUXQJR6.js";
11
+ } from "./chunk-X4T2FN7E.js";
12
12
  import {
13
13
  reportBootMilestone
14
- } from "./chunk-VIUZS7V4.js";
14
+ } from "./chunk-74BAVQKD.js";
15
15
  import {
16
16
  runSetupCommand,
17
17
  runStartCommand,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  redactToken
3
- } from "./chunk-VIUZS7V4.js";
3
+ } from "./chunk-74BAVQKD.js";
4
4
 
5
5
  // src/boot/graphify.ts
6
6
  var USER_HOME_MOUNT = "/mnt/conveyor-users";
@@ -3,7 +3,7 @@ import {
3
3
  DEFAULT_RETRY_DELAY_MS,
4
4
  FETCH_TIMEOUT_MS,
5
5
  GIT_PREP_MAX_RETRIES
6
- } from "./chunk-VIUZS7V4.js";
6
+ } from "./chunk-74BAVQKD.js";
7
7
  import {
8
8
  gitCredentialHelper,
9
9
  sleep,
@@ -28,7 +28,7 @@ import {
28
28
  query,
29
29
  transportFailureOf,
30
30
  waitForConnection
31
- } from "./chunk-PIHFGSXB.js";
31
+ } from "./chunk-L2E4EMEP.js";
32
32
  import {
33
33
  WorkbenchError,
34
34
  getWorkbenchClient
@@ -37,13 +37,13 @@ import {
37
37
  workbenchEnabled
38
38
  } from "./chunk-KMB3BU4S.js";
39
39
 
40
- // ../shared/dist/chunk-E75VFMFL.js
40
+ // ../shared/dist/chunk-OOU3YSMM.js
41
41
  import { z } from "zod";
42
42
  import { z as z2 } from "zod";
43
43
  var DEFAULT_SONNET_MODEL = "claude-sonnet-5-5";
44
44
  var DEFAULT_OPUS_MODEL = "claude-opus-5-5";
45
45
  var DEFAULT_HAIKU_MODEL = "claude-haiku-5-5";
46
- var FABLE_MODEL = "claude-fable-5-1";
46
+ var FABLE_MODEL = "claude-fable-5-2";
47
47
  var PREVIOUS_SONNET_MODEL = "claude-sonnet-5";
48
48
  var PREVIOUS_OPUS_MODEL = "claude-opus-5";
49
49
  var MODEL_PROVIDERS = ["anthropic", "zen", "typesafe"];
@@ -1369,6 +1369,15 @@ var AskUserQuestionRequestSchema = z5.object({
1369
1369
  requestId: z5.string().min(1),
1370
1370
  questions: z5.array(AgentQuestionSchema).min(1)
1371
1371
  });
1372
+ var RecordAgentQuestionRequestSchema = z5.object({
1373
+ sessionId: z5.string(),
1374
+ requestId: z5.string().min(1),
1375
+ questions: z5.array(AgentQuestionSchema).min(1)
1376
+ });
1377
+ var MarkAgentQuestionAnsweredRequestSchema = z5.object({
1378
+ sessionId: z5.string(),
1379
+ requestId: z5.string().min(1)
1380
+ });
1372
1381
  var PostAgentMessageRequestSchema = z5.object({
1373
1382
  sessionId: z5.string().min(1),
1374
1383
  content: z5.string(),
@@ -2253,6 +2262,11 @@ var CRITICAL_AUTOMATED_SOURCES = /* @__PURE__ */ new Set([
2253
2262
  // clear the completion guard.
2254
2263
  "ci_result"
2255
2264
  ]);
2265
+ var CODEX_REASONING_EFFORTS = ["low", "medium", "high", "xhigh", "max"];
2266
+ var DEFAULT_CODEX_CODING_MODEL = "gpt-6.1-terra";
2267
+ function isCodexReasoningEffort(value) {
2268
+ return typeof value === "string" && CODEX_REASONING_EFFORTS.includes(value);
2269
+ }
2256
2270
  var AGENT_MODES = [
2257
2271
  "discovery",
2258
2272
  "building",
@@ -2321,6 +2335,8 @@ var SessionSpawnBuilderPushSchema = z12.object({
2321
2335
  branch: z12.string().nullable(),
2322
2336
  /** The agent whose model, settings and instructions the Builder runs under. */
2323
2337
  agentName: z12.string().nullable(),
2338
+ // Older servers omit this; the child then reads its own task settings.
2339
+ codex: z12.object({ model: z12.string(), effort: z12.enum(CODEX_REASONING_EFFORTS) }).optional(),
2324
2340
  timestamp: z12.string()
2325
2341
  });
2326
2342
  var SessionSpawnTuiPushSchema = z12.object({
@@ -2841,13 +2857,8 @@ var ANTHROPIC_CATALOG = [
2841
2857
  anthropicEntry(PREVIOUS_SONNET_MODEL, "Sonnet 5", 2, 10),
2842
2858
  // Haiku 5.5 has two rate cards; this is the ≤100K-prompt one (>100K bills $0.50/$2.50).
2843
2859
  anthropicEntry(DEFAULT_HAIKU_MODEL, "Haiku 5.5", 0.1, 0.5),
2844
- anthropicEntry(FABLE_MODEL, "Fable 5.1", 10, 50)
2860
+ anthropicEntry(FABLE_MODEL, "Fable 5.2", 8, 40)
2845
2861
  ];
2846
- var CODEX_REASONING_EFFORTS = ["low", "medium", "high", "xhigh", "max"];
2847
- var DEFAULT_CODEX_CODING_MODEL = "gpt-5.6-terra";
2848
- function isCodexReasoningEffort(value) {
2849
- return typeof value === "string" && CODEX_REASONING_EFFORTS.includes(value);
2850
- }
2851
2862
  var HUMAN_PROSE_WRITING_STYLE = `## Writing style for humans
2852
2863
  When you write prose a person will read \u2014 chat messages, plan updates, PR titles and bodies, review comments \u2014 follow these rules (based on ASD-STE100 Simplified Technical English):
2853
2864
  - Use active voice. Say who does what ("The API rejects the request", not "the request is rejected").
@@ -2900,6 +2911,7 @@ function toMemberMentionRows(members, query28) {
2900
2911
  }));
2901
2912
  }
2902
2913
  var POSTGRES_ENV = {
2914
+ PGDATA: "/var/lib/postgresql/data",
2903
2915
  POSTGRES_HOST_AUTH_METHOD: "trust",
2904
2916
  POSTGRES_DB: "conveyor"
2905
2917
  };
@@ -2915,10 +2927,11 @@ var FIREBASE_EMULATOR_ENV = {
2915
2927
  METADATA_SERVER_DETECTION: "none",
2916
2928
  GOOGLE_APPLICATION_CREDENTIALS: "/dev/null"
2917
2929
  };
2930
+ var UNITY_WORKSPACE_PATH = "/workspaces/unity";
2918
2931
  var CATALOG = {
2919
2932
  postgresql: {
2920
2933
  name: "postgresql",
2921
- image: "postgres:16-alpine",
2934
+ image: "postgres:18-alpine",
2922
2935
  command: [
2923
2936
  "sh",
2924
2937
  "-c",
@@ -2928,7 +2941,7 @@ var CATALOG = {
2928
2941
  // WAL flush. fsync=off + synchronous_commit=off + full_page_writes=off
2929
2942
  // remove all blocking storage I/O — without them, per-commit flushes on
2930
2943
  // the node's network boot disk dominated int-test wall time (~100ms/commit).
2931
- "if [ ! -s /var/lib/postgresql/data/PG_VERSION ] && [ -d /var/lib/postgresql/pod-data ]; then cp -a /var/lib/postgresql/pod-data/. /var/lib/postgresql/data/; fi; chown -R postgres:postgres /var/lib/postgresql/data; docker-entrypoint.sh postgres -c fsync=off -c synchronous_commit=off -c full_page_writes=off & PID=$!; for i in $(seq 1 30); do pg_isready -U postgres && break; sleep 1; done; createdb -U postgres conveyor_test 2>/dev/null || true; wait $PID"
2944
+ 'if [ ! -s /var/lib/postgresql/data/PG_VERSION ]; then for seed in /opt/conveyor/postgresql/pod-data /var/lib/postgresql/pod-data; do if [ -s "$seed/PG_VERSION" ]; then cp -a "$seed/." /var/lib/postgresql/data/ || exit 1; break; fi; done; fi; chown -R postgres:postgres /var/lib/postgresql/data; docker-entrypoint.sh postgres -c fsync=off -c synchronous_commit=off -c full_page_writes=off & PID=$!; for i in $(seq 1 30); do pg_isready -U postgres && break; sleep 1; done; createdb -U postgres conveyor_test 2>/dev/null || true; wait $PID'
2932
2945
  ],
2933
2946
  ports: [5432],
2934
2947
  livenessProbe: {
@@ -2940,7 +2953,7 @@ var CATALOG = {
2940
2953
  },
2941
2954
  env: { ...POSTGRES_ENV },
2942
2955
  resources: {
2943
- // postgres runs from the baked seed at /var/lib/postgresql/pod-data via
2956
+ // postgres runs from the baked seed at /opt/conveyor/postgresql/pod-data via
2944
2957
  // overlayfs CoW (no emptyDir — see k8s-pod-spec.ts), so WAL + catalog +
2945
2958
  // re-seed churn charges the container's ephemeral-storage. It must exceed
2946
2959
  // the ~1Gi ceiling where pods evicted, but is bounded by TWO Autopilot rules:
@@ -3177,6 +3190,28 @@ var CATALOG = {
3177
3190
  retries: 20
3178
3191
  }
3179
3192
  }
3193
+ },
3194
+ "unity-editor": {
3195
+ name: "unity-editor",
3196
+ image: "unityci/editor:ubuntu-6000.6.8f1-base-3.2.2@sha256:63197c047ac7172d667e7ce71386b07e5d441ee798bd0d5c0827a8c1505b0523",
3197
+ command: [
3198
+ "sh",
3199
+ "-ec",
3200
+ [
3201
+ `install -d -m 2775 -o 1001 -g 1001 "${UNITY_WORKSPACE_PATH}/project" "${UNITY_WORKSPACE_PATH}/tmp"`,
3202
+ "if [ -x /opt/conveyor/unity-seed/restore ]; then /opt/conveyor/unity-seed/restore; fi",
3203
+ "exec sleep infinity"
3204
+ ].join("\n")
3205
+ ],
3206
+ ports: [],
3207
+ env: { TMPDIR: `${UNITY_WORKSPACE_PATH}/tmp` },
3208
+ resources: {
3209
+ // Project files, imports and temporary files use the shared pod volume.
3210
+ // Leave room for the other sidecars within Autopilot's 10 GiB pod cap.
3211
+ requests: { cpuMillicores: 1e3, memoryMi: 4096, ephemeralMi: 224 },
3212
+ limits: { cpuMillicores: 4e3, memoryMi: 4096, ephemeralMi: 224 }
3213
+ },
3214
+ statefulBake: false
3180
3215
  }
3181
3216
  };
3182
3217
  var SERVICE_DEFINITIONS = CATALOG;
@@ -7186,6 +7221,18 @@ var messageMetadataSchema = schemaOf()(
7186
7221
  answers: z43.record(z43.string(), z43.string()).optional(),
7187
7222
  agentName: z43.string().optional(),
7188
7223
  agentImage: z43.string().optional(),
7224
+ sessionId: z43.string().optional(),
7225
+ source: z43.enum(["pty", "sdk"]).optional(),
7226
+ answeredByUserId: z43.string().optional(),
7227
+ answeredAt: z43.string().optional(),
7228
+ answeredVia: z43.enum(["chat", "card", "terminal"]).optional(),
7229
+ answerMessageId: z43.string().optional(),
7230
+ forwards: z43.array(messageForwardSchema).optional()
7231
+ }),
7232
+ z43.object({
7233
+ type: z43.literal("question_answer"),
7234
+ requestId: z43.string(),
7235
+ questionMessageId: z43.string(),
7189
7236
  forwards: z43.array(messageForwardSchema).optional()
7190
7237
  }),
7191
7238
  z43.object({
@@ -9243,6 +9290,16 @@ var agentSessionContract = defineContract("agentSessionService", {
9243
9290
  output: standard(z60.object({ answers: z60.record(z60.string(), z60.string()) })),
9244
9291
  describe: "Lets a card's agent ask the team questions in the card's chat and wait for their answers. Alerts the team, and returns no answers if nobody replies within five minutes."
9245
9292
  }),
9293
+ recordAgentQuestion: mutation({
9294
+ input: RecordAgentQuestionRequestSchema,
9295
+ output: standard(z60.object({ messageId: z60.string().nullable() })),
9296
+ describe: "Lets a card's agent save a question it asked in its terminal as a poll in the card's chat, so the team can answer it after the agent's workspace sleeps. Repeat calls return the same poll."
9297
+ }),
9298
+ markAgentQuestionAnswered: mutation({
9299
+ input: MarkAgentQuestionAnsweredRequestSchema,
9300
+ output: standard(z60.object({ success: z60.boolean() })),
9301
+ describe: "Lets a card's agent mark one of its saved polls as answered in the terminal, so the card stops asking for an answer."
9302
+ }),
9246
9303
  reportApiOutage: mutation({
9247
9304
  input: ReportApiOutageRequestSchema,
9248
9305
  output: standard(reportApiOutageResponseSchema),
@@ -10293,7 +10350,7 @@ var agentSessionContract = defineContract("agentSessionService", {
10293
10350
  answerAgentQuestion: mutation({
10294
10351
  input: AnswerAgentQuestionRequestSchema,
10295
10352
  output: standard(z60.object({ success: z60.boolean() })),
10296
- describe: "Answers a question a card's agent asked in the card chat, saving the answers on the question and handing them to the waiting agent, unless the question is no longer pending."
10353
+ describe: "Answers a question a card's agent asked in the card chat. Saves the answers on the question, posts them as the caller's chat message and hands them to the agent, waking its sleeping workspace. Refuses a question that is already answered."
10297
10354
  }),
10298
10355
  clearAgentTodos: mutation({
10299
10356
  input: ClearAgentTodosRequestSchema,
@@ -11241,9 +11298,14 @@ var cardContract = defineContract("cardService", {
11241
11298
  }),
11242
11299
  countCards: query({
11243
11300
  input: countCardsSchema,
11244
- output: standard(z67.object({ total: z67.number() })),
11301
+ output: standard(
11302
+ z67.object({
11303
+ total: z67.number(),
11304
+ lanes: z67.partialRecord(z67.enum(taskStatusValues), z67.number())
11305
+ })
11306
+ ),
11245
11307
  watch: projectCardsWatch,
11246
- describe: "Counts the incidents and suggestions that match the Reports or card table filters, so the toolbar total agrees with the list."
11308
+ describe: "Counts the incidents and suggestions that match the Reports or card table filters, in total and per Reports status lane (legacy statuses folded into their lanes), so the toolbar total and each lane's count agree with the whole list, not only the loaded pages."
11247
11309
  }),
11248
11310
  addReviewer: mutation({
11249
11311
  input: addReviewerSchema,
@@ -13686,6 +13748,8 @@ var projectSettingsUpdateSchema = z97.record(z97.string(), z97.unknown()).superR
13686
13748
  }
13687
13749
  assertOptionalBoolean(ctx, settings, ["triage", "autoBuild"]);
13688
13750
  assertOptionalBoolean(ctx, settings, ["claudespace", "bakeLocal"]);
13751
+ assertOptionalBoolean(ctx, settings, ["claudespace", "localUnitySeed"]);
13752
+ assertOptionalBoolean(ctx, settings, ["claudespace", "localWorkspaceSeed"]);
13689
13753
  assertOptionalBoolean(ctx, settings, ["jev", "enabled"]);
13690
13754
  assertOptionalOneOf(ctx, settings, ["jev", "connection"], JEV_CONNECTIONS);
13691
13755
  assertOptionalOneOf(ctx, settings, ["claudespace", "reviewProfile"], REVIEW_PROFILES);
@@ -17236,6 +17300,36 @@ ${q.question}${q.options.length ? "\n" + q.options.map((o) => `- ${o.label}: ${o
17236
17300
  this.pendingAnswerResolvers.delete(requestId);
17237
17301
  }
17238
17302
  }
17303
+ /**
17304
+ * Save a terminal AskUserQuestion as a poll in the card's chat, so it stays
17305
+ * answerable after this pod sleeps. Resolves false on ANY failure, an API
17306
+ * that predates the method included: the caller then keeps the old
17307
+ * behavior (the question lives only in this pod).
17308
+ */
17309
+ async recordAgentQuestion(requestId, questions) {
17310
+ try {
17311
+ const { messageId } = await this.call("recordAgentQuestion", {
17312
+ sessionId: this.config.sessionId,
17313
+ requestId,
17314
+ questions
17315
+ });
17316
+ return messageId !== null;
17317
+ } catch (err) {
17318
+ logger.warn("could not save the question as a card poll", {
17319
+ requestId,
17320
+ error: err instanceof Error ? err.message : String(err)
17321
+ });
17322
+ return false;
17323
+ }
17324
+ }
17325
+ /** The human answered the saved poll in the terminal. Fire-and-forget. */
17326
+ markAgentQuestionAnswered(requestId) {
17327
+ void this.call("markAgentQuestionAnswered", {
17328
+ sessionId: this.config.sessionId,
17329
+ requestId
17330
+ }).catch(() => {
17331
+ });
17332
+ }
17239
17333
  // ── Typed service method wrappers ───────────────────────────────────
17240
17334
  getTaskProperties() {
17241
17335
  return this.call("getTaskProperties", { sessionId: this.config.sessionId });
@@ -18601,13 +18695,13 @@ export {
18601
18695
  TAG_OVERVIEW_MAX,
18602
18696
  TAG_REASON_MAX,
18603
18697
  CRITICAL_AUTOMATED_SOURCES,
18698
+ DEFAULT_CODEX_CODING_MODEL,
18699
+ isCodexReasoningEffort,
18604
18700
  formatEvaluateQuestionsResult,
18605
18701
  subProjectScopePaths,
18606
18702
  AGENT_STATUS_REASON_USER_QUESTION,
18607
18703
  TASK_CHAT_HISTORY_LIMIT,
18608
18704
  PM_CHAT_HISTORY_LIMIT,
18609
- DEFAULT_CODEX_CODING_MODEL,
18610
- isCodexReasoningEffort,
18611
18705
  HUMAN_PROSE_WRITING_STYLE,
18612
18706
  parseMentions,
18613
18707
  toMemberMentionRows,
package/dist/cli.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  WorkspaceCommandSupervisor,
8
8
  startWorkspaceCommandsAfterConnect,
9
9
  stopWorkspaceCommands
10
- } from "./chunk-YSIZHDN2.js";
10
+ } from "./chunk-R46A26AR.js";
11
11
  import {
12
12
  PtyHarness,
13
13
  SessionRunner,
@@ -25,8 +25,8 @@ import {
25
25
  resolveTuiKindFromEnv,
26
26
  sampleKeyUsage,
27
27
  usesNativeUsageReporting
28
- } from "./chunk-TFQKDNRY.js";
29
- import "./chunk-V5WR2F2P.js";
28
+ } from "./chunk-22BKWHPI.js";
29
+ import "./chunk-VYE7XV6U.js";
30
30
  import {
31
31
  inheritedEnv,
32
32
  resolvePtySpawn
@@ -41,14 +41,16 @@ import {
41
41
  createServiceLogger,
42
42
  loadAndAnnotateDiscoveredPorts,
43
43
  loadConveyorConfig
44
- } from "./chunk-GNUXQJR6.js";
45
- import "./chunk-VIUZS7V4.js";
44
+ } from "./chunk-X4T2FN7E.js";
45
+ import "./chunk-74BAVQKD.js";
46
46
  import "./chunk-W4LZ7R6Z.js";
47
47
  import "./chunk-372R6E4C.js";
48
- import "./chunk-PIHFGSXB.js";
48
+ import "./chunk-L2E4EMEP.js";
49
49
  import "./chunk-UP4XACLL.js";
50
50
  import "./chunk-SQM2BQ7H.js";
51
- import "./chunk-KMB3BU4S.js";
51
+ import {
52
+ workbenchEnabled
53
+ } from "./chunk-KMB3BU4S.js";
52
54
  import "./chunk-6Q6LQBWO.js";
53
55
  import "./chunk-JSBRDJBE.js";
54
56
 
@@ -1053,6 +1055,14 @@ function buildBuilderChildEnv(baseEnv, data) {
1053
1055
  delete env.CONVEYOR_GIT_READY_MARKER;
1054
1056
  delete env.CONVEYOR_AGENT_MODE;
1055
1057
  delete env.CONVEYOR_IS_AUTO;
1058
+ if (env.CONVEYOR_TUI === "codex") {
1059
+ delete env.CONVEYOR_AGENT_MODEL;
1060
+ delete env.CONVEYOR_AGENT_REASONING_EFFORT;
1061
+ if (data.codex) {
1062
+ env.CONVEYOR_AGENT_MODEL = data.codex.model;
1063
+ env.CONVEYOR_AGENT_REASONING_EFFORT = data.codex.effort;
1064
+ }
1065
+ }
1056
1066
  return env;
1057
1067
  }
1058
1068
  var BuilderChildSupervisor = class {
@@ -1092,7 +1102,7 @@ var BuilderChildSupervisor = class {
1092
1102
  let child;
1093
1103
  try {
1094
1104
  child = this.spawnFn(process.execPath, [cliPath], {
1095
- cwd: this.workspaceDir,
1105
+ cwd: workbenchEnabled() ? process.cwd() : this.workspaceDir,
1096
1106
  env: buildBuilderChildEnv(process.env, data),
1097
1107
  stdio: ["ignore", "pipe", "pipe"]
1098
1108
  });
@@ -1115,15 +1125,30 @@ var BuilderChildSupervisor = class {
1115
1125
  */
1116
1126
  watchForEarlyExit(child, sessionId) {
1117
1127
  const spawnedAt = Date.now();
1118
- child.on("exit", (code) => {
1119
- if (this.childSessionId === sessionId) {
1120
- this.child = null;
1121
- this.childSessionId = null;
1122
- }
1128
+ const reportFailure = (error) => {
1129
+ if (this.child !== child) return;
1130
+ this.child = null;
1131
+ this.childSessionId = null;
1132
+ this.connection.reportBuilderSpawnFailure(sessionId, error);
1133
+ };
1134
+ child.stdout?.on(
1135
+ "data",
1136
+ (chunk) => process.stdout.write(`[builder-child] ${chunk.toString()}`)
1137
+ );
1138
+ child.stderr?.on(
1139
+ "data",
1140
+ (chunk) => process.stderr.write(`[builder-child] ${chunk.toString()}`)
1141
+ );
1142
+ child.on("error", (error) => reportFailure(error.message));
1143
+ child.on("exit", (code, signal) => {
1144
+ if (this.child !== child) return;
1123
1145
  const early = Date.now() - spawnedAt < SPAWN_FAILURE_GRACE_MS;
1124
- if (early && code !== 0) {
1146
+ if (early && code !== null && code !== 0 && signal === null) {
1125
1147
  logger5.warn("Builder child exited inside the spawn grace window", { sessionId, code });
1126
- this.connection.reportBuilderSpawnFailure(sessionId, `child exited with code ${code}`);
1148
+ reportFailure(`child exited with code ${code}`);
1149
+ } else {
1150
+ this.child = null;
1151
+ this.childSessionId = null;
1127
1152
  }
1128
1153
  });
1129
1154
  }
@@ -1188,7 +1213,7 @@ function wireSpawnChildren(mode, connection, supervisors, logger7) {
1188
1213
 
1189
1214
  // src/cli.ts
1190
1215
  if (process.argv[2] === "boot") {
1191
- const { runBoot } = await import("./boot-6QUJHRWD.js");
1216
+ const { runBoot } = await import("./boot-KQ4UDUAI.js");
1192
1217
  process.exit(await runBoot(process.argv.slice(3)));
1193
1218
  }
1194
1219
  if (isLegacyEntrypointLaunch(process.env)) {
@@ -1399,7 +1424,7 @@ if (!RUNNER_MODES.includes(CONVEYOR_MODE)) {
1399
1424
  process.exit(1);
1400
1425
  }
1401
1426
  if (CONVEYOR_MODE === "serving") {
1402
- const { runServingSession } = await import("./serve-boot-FWARG2BW.js");
1427
+ const { runServingSession } = await import("./serve-boot-ZNDOATUL.js");
1403
1428
  exitContext.runnerMode = "serving";
1404
1429
  exitContext.sessionId = process.env.CONVEYOR_SESSION_ID ?? exitContext.sessionId;
1405
1430
  const outcome = await runServingSession({
@@ -6,7 +6,7 @@ import {
6
6
  lagFromBuffer,
7
7
  needsReopen,
8
8
  statusFromBuffer
9
- } from "./chunk-PIHFGSXB.js";
9
+ } from "./chunk-L2E4EMEP.js";
10
10
  import "./chunk-UP4XACLL.js";
11
11
  import "./chunk-JSBRDJBE.js";
12
12
 
package/dist/index.d.ts CHANGED
@@ -385,6 +385,15 @@ declare class AgentConnection {
385
385
  resetsAt: string;
386
386
  }>;
387
387
  askUserQuestion(questions: AgentQuestion[]): Promise<Record<string, string>>;
388
+ /**
389
+ * Save a terminal AskUserQuestion as a poll in the card's chat, so it stays
390
+ * answerable after this pod sleeps. Resolves false on ANY failure, an API
391
+ * that predates the method included: the caller then keeps the old
392
+ * behavior (the question lives only in this pod).
393
+ */
394
+ recordAgentQuestion(requestId: string, questions: AgentQuestion[]): Promise<boolean>;
395
+ /** The human answered the saved poll in the terminal. Fire-and-forget. */
396
+ markAgentQuestionAnswered(requestId: string): void;
388
397
  getTaskProperties(): Promise<{
389
398
  plan?: string;
390
399
  storyPointId?: string;
@@ -778,6 +787,10 @@ declare class SessionRunner {
778
787
  * liveness hold above is bounded by timestamp arithmetic, so a lost timer
779
788
  * still expires the hold — it just skips the un-park injection. */
780
789
  private questionGraceTimer;
790
+ /** What the parked questionnaire asked, and whether the API saved it as a
791
+ * card poll — read when the grace expires, to word the timeout prompt.
792
+ * Cleared with the hold. */
793
+ private pendingQuestion;
781
794
  constructor(config: SessionRunnerConfig, callbacks: SessionRunnerCallbacks, deps?: SessionRunnerDependencies);
782
795
  get state(): AgentRunnerStatus;
783
796
  /**
@@ -1187,7 +1200,8 @@ interface AgentRunnerConfig {
1187
1200
  * Question-pending transitions surfaced to the runner by the event loop
1188
1201
  * (`applyQuestionTransitions` in execution/event-processor.ts):
1189
1202
  * - `armed` — the PTY hook observed an AskUserQuestion; a questionnaire is
1190
- * parked on a human.
1203
+ * parked on a human. `questions` are what it asked, and `persisted` says
1204
+ * the API saved them as a card poll, which outlives this pod.
1191
1205
  * - `answered` — the questionnaire resolved (PostToolUse envelope, or a new
1192
1206
  * assistant record without the question block).
1193
1207
  * - `turn_ended` — the turn's `result` arrived while the questionnaire was
@@ -1198,6 +1212,8 @@ interface AgentRunnerConfig {
1198
1212
  type UserQuestionSignal = {
1199
1213
  kind: "armed";
1200
1214
  questionText?: string;
1215
+ questions?: _project_shared.AgentQuestion[];
1216
+ persisted?: boolean;
1201
1217
  } | {
1202
1218
  kind: "answered";
1203
1219
  } | {
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  SessionRunner,
3
3
  unshallowRepo
4
- } from "./chunk-TFQKDNRY.js";
5
- import "./chunk-V5WR2F2P.js";
4
+ } from "./chunk-22BKWHPI.js";
5
+ import "./chunk-VYE7XV6U.js";
6
6
  import "./chunk-76JCOHPE.js";
7
7
  import {
8
8
  AgentConnection,
@@ -17,15 +17,15 @@ import {
17
17
  stageAndCommit,
18
18
  updateRemoteToken,
19
19
  workspacePathExists
20
- } from "./chunk-GNUXQJR6.js";
21
- import "./chunk-VIUZS7V4.js";
20
+ } from "./chunk-X4T2FN7E.js";
21
+ import "./chunk-74BAVQKD.js";
22
22
  import {
23
23
  runAuthTokenCommand,
24
24
  runSetupCommand,
25
25
  runStartCommand
26
26
  } from "./chunk-W4LZ7R6Z.js";
27
27
  import "./chunk-372R6E4C.js";
28
- import "./chunk-PIHFGSXB.js";
28
+ import "./chunk-L2E4EMEP.js";
29
29
  import "./chunk-UP4XACLL.js";
30
30
  import {
31
31
  getWorkbenchClient
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  WorkspaceCommandSupervisor
3
- } from "./chunk-YSIZHDN2.js";
3
+ } from "./chunk-R46A26AR.js";
4
4
  import {
5
5
  AgentConnection,
6
6
  DEFAULT_LIFECYCLE_CONFIG,
@@ -11,10 +11,10 @@ import {
11
11
  ensureOnTaskBranch,
12
12
  loadAndAnnotateDiscoveredPorts,
13
13
  loadConveyorConfig
14
- } from "./chunk-GNUXQJR6.js";
15
- import "./chunk-VIUZS7V4.js";
14
+ } from "./chunk-X4T2FN7E.js";
15
+ import "./chunk-74BAVQKD.js";
16
16
  import "./chunk-W4LZ7R6Z.js";
17
- import "./chunk-PIHFGSXB.js";
17
+ import "./chunk-L2E4EMEP.js";
18
18
  import "./chunk-UP4XACLL.js";
19
19
  import "./chunk-SQM2BQ7H.js";
20
20
  import "./chunk-KMB3BU4S.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rallycry/conveyor-agent",
3
- "version": "11.1.6",
3
+ "version": "11.1.8",
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",
@@ -37,7 +37,7 @@
37
37
  "typecheck": "bash ../../scripts/typecheck.sh"
38
38
  },
39
39
  "dependencies": {
40
- "@anthropic-ai/claude-agent-sdk": "^0.3.301",
40
+ "@anthropic-ai/claude-agent-sdk": "^0.3.321",
41
41
  "@modelcontextprotocol/sdk": "^1.32.1",
42
42
  "node-pty": "^1.1.0",
43
43
  "socket.io-client": "^4.8.4",
@@ -14,10 +14,11 @@ The research and drafting below are identical everywhere. Only the two ends
14
14
  differ — resolving which project you are in, and where the finished plan lands
15
15
  — and both carry an **Environment** note.
16
16
 
17
- The division of labor is fixed: **you research and recommend; Conveyor's
18
- identification decides.** Moving the card to Open fires identification
19
- automatically (story points, icon, agent, and tags if you set none). Never set
20
- icon or story points yourself, and never `start_task` unless the user asks.
17
+ Conveyor identifies the card when it opens, assigning the icon, agent, and
18
+ tags if you set none. When creating a card from a local session, recommend
19
+ story points in chat and let identification set them. In a pod, set the
20
+ initial estimate before saving the plan. Never set the icon or call
21
+ `start_task` unless the user asks.
21
22
 
22
23
  ## Goal and finish line
23
24
 
@@ -25,8 +26,11 @@ icon or story points yourself, and never `start_task` unless the user asks.
25
26
  batched round of questions for a human when scope is genuinely ambiguous.
26
27
  **Finish line:** the plan is saved with `mcp__conveyor__update_task` AND the
27
28
  recommendation is posted with `mcp__conveyor__post_to_chat` and
28
- `milestone: "plan_ready"`. In a pod, story points and risk are also set
29
- (`mcp__conveyor__update_task_properties`) and plan mode is exited.
29
+ `milestone: "plan_ready"`. In a pod, set story points, risk, and title with
30
+ `mcp__conveyor__update_task_properties` before saving the final plan. Follow
31
+ the runner's completion instructions: Claude's Discovery planner also calls
32
+ its native plan-exit tool after posting the milestone. Codex and OpenCode end
33
+ the turn after the milestone. Conveyor handles the card transition.
30
34
  **A turn may end only when:** (a) the finish line above is true, or (b) an
31
35
  `AskUserQuestion` is pending. Nothing else. Anything else is a stalled run, not
32
36
  a paused one.
@@ -197,15 +201,13 @@ touching Conveyor, unless they asked you to just ship it.
197
201
  > does not exist in a pod. In a pod, the card exists and you are on it: save
198
202
  > the plan with `mcp__conveyor__update_task` (`plan`, and `description` if it
199
203
  > needs sharpening), post the same recommendation message to chat with
200
- > `milestone: "plan_ready"`, and stop. "Stop" means end the turn with no
201
- > question about starting work — per *Goal and finish line*, the Builder is a
204
+ > `milestone: "plan_ready"`, and follow the runtime-specific finish line
205
+ > above. End the turn without asking about starting work. The Builder is a
202
206
  > separate session the system spawns, and every later turn here is a plan
203
207
  > iteration. A pod does not promote its own card to
204
208
  > Open. A parked plan is never `blocked`: that milestone means you cannot
205
209
  > continue until a human acts, and it pages nobody. To page a person, ask them
206
- > with AskUserQuestion. If the pod also has to leave
207
- > plan mode, note that `update_task` carries no story points or risk; those go
208
- > through `mcp__conveyor__update_task_properties`. Everything in Phases 1-3 is
210
+ > with AskUserQuestion. Everything in Phases 1-3 is
209
211
  > identical in both environments. To break a large pod card into a pack, use
210
212
  > `mcp__conveyor__create_subtask` rather than `create_task`, and set child→child
211
213
  > ordering through its `dependsOn` field — `mcp__conveyor__add_dependency` is