@rallycry/conveyor-agent 5.0.0 → 5.0.2

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.
@@ -646,13 +646,6 @@ function runStartCommand(cmd, cwd, onOutput) {
646
646
 
647
647
  // src/setup/codespace.ts
648
648
  import { execSync as execSync3 } from "child_process";
649
- function initRtk() {
650
- try {
651
- execSync3("rtk --version", { stdio: "ignore" });
652
- execSync3("rtk init --global --auto-patch", { stdio: "ignore" });
653
- } catch {
654
- }
655
- }
656
649
  function unshallowRepo(workspaceDir) {
657
650
  try {
658
651
  execSync3("git fetch --unshallow", {
@@ -2466,7 +2459,7 @@ function buildQueryOptions(host, context) {
2466
2459
  const mode = host.agentMode;
2467
2460
  const isCloud = host.config.mode === "pm";
2468
2461
  const isReadOnly = isReadOnlyMode(mode, host.hasExitedPlanMode);
2469
- const needsCanUseTool = isCloud && isReadOnly;
2462
+ const needsCanUseTool = isReadOnly;
2470
2463
  const systemPromptText = buildSystemPrompt(
2471
2464
  host.config.mode,
2472
2465
  context,
@@ -2498,7 +2491,7 @@ function buildQueryOptions(host, context) {
2498
2491
  disallowedTools: buildDisallowedTools(settings, mode, host.hasExitedPlanMode),
2499
2492
  enableFileCheckpointing: settings.enableFileCheckpointing
2500
2493
  };
2501
- if (needsCanUseTool) {
2494
+ if (isCloud && isReadOnly) {
2502
2495
  baseOptions.sandbox = buildSandboxConfig(host);
2503
2496
  }
2504
2497
  return baseOptions;
@@ -2911,41 +2904,6 @@ ${message}`);
2911
2904
  return false;
2912
2905
  }
2913
2906
  }
2914
- async function rebasePullBranch(runnerConfig, connection, callbacks, setupLog) {
2915
- const pullBranch = process.env.CONVEYOR_PULL_BRANCH;
2916
- if (!pullBranch) return true;
2917
- pushSetupLog(setupLog, `[conveyor] Rebasing onto latest ${pullBranch}...`);
2918
- connection.sendEvent({
2919
- type: "setup_output",
2920
- stream: "stdout",
2921
- data: `Rebasing onto latest ${pullBranch}...
2922
- `
2923
- });
2924
- try {
2925
- await runSetupCommand(
2926
- `git fetch origin ${pullBranch} && git rebase origin/${pullBranch}`,
2927
- runnerConfig.workspaceDir,
2928
- (stream, data) => {
2929
- connection.sendEvent({ type: "setup_output", stream, data });
2930
- for (const line of data.split("\n").filter(Boolean)) {
2931
- pushSetupLog(setupLog, `[${stream}] ${line}`);
2932
- }
2933
- }
2934
- );
2935
- pushSetupLog(setupLog, `[conveyor] Rebase complete`);
2936
- return true;
2937
- } catch (error) {
2938
- const message = `Failed to rebase onto ${pullBranch}: ${error instanceof Error ? error.message : "unknown error"}`;
2939
- connection.sendEvent({ type: "setup_error", message });
2940
- await callbacks.onEvent({ type: "setup_error", message });
2941
- connection.postChatMessage(
2942
- `Failed to rebase onto latest \`${pullBranch}\`. There may be conflicts between the task branch and dev.
2943
-
2944
- ${message}`
2945
- );
2946
- return false;
2947
- }
2948
- }
2949
2907
  async function runSetupSafe(runnerConfig, connection, callbacks, setupLog, effectiveAgentMode, setState) {
2950
2908
  await setState("setup");
2951
2909
  const ports = await loadForwardPorts(runnerConfig.workspaceDir);
@@ -2960,9 +2918,6 @@ async function runSetupSafe(runnerConfig, connection, callbacks, setupLog, effec
2960
2918
  if (!await checkoutTaskBranch(runnerConfig, connection, callbacks, setupLog)) {
2961
2919
  return { ok: false, deferredStartConfig: null };
2962
2920
  }
2963
- if (!await rebasePullBranch(runnerConfig, connection, callbacks, setupLog)) {
2964
- return { ok: false, deferredStartConfig: null };
2965
- }
2966
2921
  const taskBranch = process.env.CONVEYOR_TASK_BRANCH;
2967
2922
  if (taskBranch) {
2968
2923
  pushSetupLog(setupLog, `[conveyor] Switching to task branch ${taskBranch}...`);
@@ -3266,7 +3221,6 @@ var AgentRunner = class {
3266
3221
  }
3267
3222
  this.deferredStartConfig = result.deferredStartConfig;
3268
3223
  }
3269
- initRtk();
3270
3224
  this.tryInitWorktree();
3271
3225
  if (!await this.fetchAndInitContext()) return;
3272
3226
  if (process.env.CODESPACES === "true" && this.taskContext) {
@@ -3858,7 +3812,22 @@ var ProjectRunner = class {
3858
3812
  projectId: config.projectId
3859
3813
  });
3860
3814
  }
3815
+ async checkoutWorkspaceBranch() {
3816
+ const workspaceBranch = process.env.CONVEYOR_WORKSPACE_BRANCH;
3817
+ if (!workspaceBranch) return;
3818
+ try {
3819
+ execSync5(`git fetch origin ${workspaceBranch}`, { cwd: this.projectDir, stdio: "pipe" });
3820
+ execSync5(`git checkout ${workspaceBranch}`, { cwd: this.projectDir, stdio: "pipe" });
3821
+ logger4.info("Checked out workspace branch", { workspaceBranch });
3822
+ } catch (err) {
3823
+ logger4.warn("Failed to checkout workspace branch, continuing on current branch", {
3824
+ workspaceBranch,
3825
+ ...errorMeta(err)
3826
+ });
3827
+ }
3828
+ }
3861
3829
  async start() {
3830
+ await this.checkoutWorkspaceBranch();
3862
3831
  await this.connection.connect();
3863
3832
  this.connection.onTaskAssignment((assignment) => {
3864
3833
  this.handleAssignment(assignment);
@@ -4073,4 +4042,4 @@ export {
4073
4042
  ProjectRunner,
4074
4043
  FileCache
4075
4044
  };
4076
- //# sourceMappingURL=chunk-DODEEME6.js.map
4045
+ //# sourceMappingURL=chunk-7BQDIIDG.js.map