@rallycry/conveyor-agent 7.2.2 → 7.2.3

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.
@@ -628,6 +628,7 @@ var Lifecycle = class {
628
628
  // ── Token refresh ─────────────────────────────────────────────────
629
629
  startTokenRefresh() {
630
630
  this.stopTokenRefresh();
631
+ this.callbacks.onTokenRefresh();
631
632
  this.tokenRefreshTimer = setInterval(() => {
632
633
  this.callbacks.onTokenRefresh();
633
634
  }, this.config.tokenRefreshIntervalMs);
@@ -782,13 +783,18 @@ function stageAndCommit(cwd, message) {
782
783
  }
783
784
  function tryPush(cwd, branch) {
784
785
  try {
785
- execSync(`git push origin ${branch}`, { cwd, stdio: ["ignore", "pipe", "pipe"] });
786
+ execSync(`git push origin ${branch}`, {
787
+ cwd,
788
+ stdio: ["ignore", "pipe", "pipe"],
789
+ timeout: 3e4
790
+ });
786
791
  return true;
787
792
  } catch {
788
793
  try {
789
794
  execSync(`git push --force-with-lease origin ${branch}`, {
790
795
  cwd,
791
- stdio: ["ignore", "pipe", "pipe"]
796
+ stdio: ["ignore", "pipe", "pipe"],
797
+ timeout: 3e4
792
798
  });
793
799
  return true;
794
800
  } catch {
@@ -798,9 +804,10 @@ function tryPush(cwd, branch) {
798
804
  }
799
805
  function isAuthError(cwd) {
800
806
  try {
801
- execSync("git push --dry-run", { cwd, stdio: ["ignore", "pipe", "pipe"] });
807
+ execSync("git push --dry-run", { cwd, stdio: ["ignore", "pipe", "pipe"], timeout: 3e4 });
802
808
  return false;
803
809
  } catch (err) {
810
+ if (err.killed) return true;
804
811
  const stderr = err.stderr?.toString() ?? "";
805
812
  const stdout = err.stdout?.toString() ?? "";
806
813
  const msg = stderr || stdout || (err instanceof Error ? err.message : "");
@@ -847,6 +854,17 @@ async function pushToOrigin(cwd, refreshToken) {
847
854
  try {
848
855
  const currentBranch = getCurrentBranch(cwd);
849
856
  if (!currentBranch) return false;
857
+ if (refreshToken) {
858
+ try {
859
+ const token = await refreshToken();
860
+ if (token) {
861
+ updateRemoteToken(cwd, token);
862
+ process.env.GITHUB_TOKEN = token;
863
+ process.env.GH_TOKEN = token;
864
+ }
865
+ } catch {
866
+ }
867
+ }
850
868
  if (tryPush(cwd, currentBranch)) return true;
851
869
  if (refreshToken && isAuthError(cwd)) {
852
870
  const token = await refreshToken();
@@ -4943,7 +4961,13 @@ async function handleExitPlanMode(host, input) {
4943
4961
  );
4944
4962
  return { behavior: "allow", updatedInput: input };
4945
4963
  }
4946
- await host.connection.triggerIdentification();
4964
+ try {
4965
+ await host.connection.triggerIdentification();
4966
+ } catch (triggerErr) {
4967
+ host.connection.postChatMessage(
4968
+ `Identification trigger encountered an issue (${triggerErr instanceof Error ? triggerErr.message : "unknown error"}). Proceeding to build phase \u2014 identification will use fallbacks.`
4969
+ );
4970
+ }
4947
4971
  host.hasExitedPlanMode = true;
4948
4972
  const newMode = host.isParentTask ? "review" : "building";
4949
4973
  host.connection.sendEvent({ type: "mode_transition", from: "auto", to: newMode });
@@ -7702,4 +7726,4 @@ export {
7702
7726
  loadForwardPorts,
7703
7727
  loadConveyorConfig
7704
7728
  };
7705
- //# sourceMappingURL=chunk-5HTCDNOK.js.map
7729
+ //# sourceMappingURL=chunk-N66QQFXY.js.map