@rallycry/conveyor-agent 7.1.5 → 7.1.7

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.
@@ -7,7 +7,7 @@ import {
7
7
  createHarness,
8
8
  createServiceLogger,
9
9
  defineTool
10
- } from "./chunk-U6AYNVS7.js";
10
+ } from "./chunk-RRXX6DTB.js";
11
11
 
12
12
  // src/connection/agent-connection.ts
13
13
  import { io } from "socket.io-client";
@@ -684,7 +684,11 @@ function ensureOnTaskBranch(cwd, taskBranch) {
684
684
  return false;
685
685
  }
686
686
  try {
687
- execSync(`git checkout ${taskBranch}`, { cwd, stdio: "ignore", timeout: 3e4 });
687
+ execSync(`git checkout -B ${taskBranch} origin/${taskBranch}`, {
688
+ cwd,
689
+ stdio: "ignore",
690
+ timeout: 3e4
691
+ });
688
692
  } catch {
689
693
  process.stderr.write(`[conveyor-agent] Warning: git checkout ${taskBranch} failed
690
694
  `);
@@ -923,6 +927,9 @@ var PlanSync = class {
923
927
  }
924
928
  };
925
929
 
930
+ // src/execution/query-executor.ts
931
+ import { createHash } from "crypto";
932
+
926
933
  // src/execution/pack-runner-prompt.ts
927
934
  function findLastAgentMessageIndex(history) {
928
935
  for (let i = history.length - 1; i >= 0; i--) {
@@ -5018,6 +5025,10 @@ function buildHooks(host) {
5018
5025
  ]
5019
5026
  };
5020
5027
  }
5028
+ function taskIdToSessionUuid(taskId) {
5029
+ const hash = createHash("sha256").update(taskId).digest("hex");
5030
+ return `${hash.slice(0, 8)}-${hash.slice(8, 12)}-8${hash.slice(13, 16)}-a${hash.slice(17, 20)}-${hash.slice(20, 32)}`;
5031
+ }
5021
5032
  function isReadOnlyMode(mode, hasExitedPlanMode) {
5022
5033
  return mode === "discovery" || mode === "help" || mode === "auto" && !hasExitedPlanMode;
5023
5034
  }
@@ -5066,6 +5077,7 @@ function buildQueryOptions(host, context) {
5066
5077
  abortController: host.abortController ?? void 0,
5067
5078
  disallowedTools: buildDisallowedTools(settings, mode, host.hasExitedPlanMode),
5068
5079
  enableFileCheckpointing: settings.enableFileCheckpointing,
5080
+ sessionId: taskIdToSessionUuid(context.taskId),
5069
5081
  stderr: (data) => {
5070
5082
  logger2.warn("Claude Code stderr", { data: data.trimEnd() });
5071
5083
  }
@@ -5139,7 +5151,7 @@ async function runSdkQuery(host, context, followUpContent) {
5139
5151
  host.snapshotPlanFiles();
5140
5152
  }
5141
5153
  const options = buildQueryOptions(host, context);
5142
- const resume = context.claudeSessionId ?? void 0;
5154
+ const resume = taskIdToSessionUuid(context.taskId);
5143
5155
  if (followUpContent) {
5144
5156
  const prompt = await buildFollowUpPrompt(host, context, followUpContent);
5145
5157
  const agentQuery = host.harness.executeQuery({
@@ -5976,6 +5988,9 @@ var SessionRunner = class _SessionRunner {
5976
5988
  if (this.fullContext && action.newMode === "review") {
5977
5989
  this.fullContext.claudeSessionId = null;
5978
5990
  }
5991
+ if (this.fullContext && action.newMode === "building") {
5992
+ void this.refreshBranchForBuilding();
5993
+ }
5979
5994
  this.connection.emitModeChanged(action.newMode);
5980
5995
  this.softStop();
5981
5996
  }
@@ -5990,6 +6005,23 @@ var SessionRunner = class _SessionRunner {
5990
6005
  }
5991
6006
  });
5992
6007
  }
6008
+ /** Re-fetch task context to pick up a newly created branch and check it out. */
6009
+ async refreshBranchForBuilding() {
6010
+ try {
6011
+ const ctx = await this.connection.call("getTaskContext", {
6012
+ sessionId: this.sessionId,
6013
+ includeHistory: false
6014
+ });
6015
+ if (ctx?.githubBranch && this.fullContext) {
6016
+ this.fullContext.githubBranch = ctx.githubBranch;
6017
+ ensureOnTaskBranch(this.config.workspaceDir, ctx.githubBranch);
6018
+ }
6019
+ } catch {
6020
+ process.stderr.write(
6021
+ "[conveyor-agent] Warning: failed to refresh branch for building transition\n"
6022
+ );
6023
+ }
6024
+ }
5993
6025
  async setState(status) {
5994
6026
  this._state = status;
5995
6027
  await this.connection.emitStatus(status);
@@ -7051,7 +7083,7 @@ var ProjectRunner = class {
7051
7083
  async handleAuditTags(request) {
7052
7084
  this.connection.emitStatus("busy");
7053
7085
  try {
7054
- const { handleTagAudit } = await import("./tag-audit-handler-BM6MMS5T.js");
7086
+ const { handleTagAudit } = await import("./tag-audit-handler-WPGSBNXO.js");
7055
7087
  await handleTagAudit(request, this.connection, this.projectDir);
7056
7088
  } catch (error) {
7057
7089
  const msg = error instanceof Error ? error.message : String(error);
@@ -7074,7 +7106,7 @@ var ProjectRunner = class {
7074
7106
  async handleAuditTasks(request) {
7075
7107
  this.connection.emitStatus("busy");
7076
7108
  try {
7077
- const { handleTaskAudit } = await import("./task-audit-handler-URD2BOC4.js");
7109
+ const { handleTaskAudit } = await import("./task-audit-handler-AOYSFO5B.js");
7078
7110
  await handleTaskAudit(request, this.connection, this.projectDir);
7079
7111
  } catch (error) {
7080
7112
  const msg = error instanceof Error ? error.message : String(error);
@@ -7514,4 +7546,4 @@ export {
7514
7546
  loadForwardPorts,
7515
7547
  loadConveyorConfig
7516
7548
  };
7517
- //# sourceMappingURL=chunk-36TKGT6T.js.map
7549
+ //# sourceMappingURL=chunk-N3365TFE.js.map