@rallycry/conveyor-agent 10.13.68 → 10.13.69

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.
@@ -9,14 +9,14 @@ import {
9
9
  readAgentVersion,
10
10
  redactToken,
11
11
  reportBootMilestone
12
- } from "./chunk-KG4ORL3Y.js";
12
+ } from "./chunk-QU53HND5.js";
13
13
  import {
14
14
  workbenchPort
15
15
  } from "./chunk-KMB3BU4S.js";
16
16
  import {
17
17
  startWorkbenchServer
18
- } from "./chunk-E2SHIH6Y.js";
19
- import "./chunk-LE6ZUDZT.js";
18
+ } from "./chunk-DOB2XE2I.js";
19
+ import "./chunk-GJXAAPJ6.js";
20
20
  import {
21
21
  DEFAULT_WORKBENCH_PORT
22
22
  } from "./chunk-6Q6LQBWO.js";
@@ -7,7 +7,7 @@ import {
7
7
  readAgentVersion,
8
8
  registerBootMilestoneSocketFallback,
9
9
  reportBootMilestone
10
- } from "./chunk-KG4ORL3Y.js";
10
+ } from "./chunk-QU53HND5.js";
11
11
  import {
12
12
  LoopLagMonitor,
13
13
  buildConveyorSocketOptions,
@@ -55,7 +55,7 @@ import {
55
55
  transcriptSize,
56
56
  turnOptionsFrom,
57
57
  writeGitCredential
58
- } from "./chunk-LE6ZUDZT.js";
58
+ } from "./chunk-GJXAAPJ6.js";
59
59
 
60
60
  // src/setup/bootstrap.ts
61
61
  var BOOTSTRAP_TIMEOUT_MS = 3e4;
@@ -1507,6 +1507,28 @@ async function verifyGitCredential(cwd) {
1507
1507
 
1508
1508
  // src/runner/git-utils.ts
1509
1509
  import { realpathSync } from "fs";
1510
+
1511
+ // src/runner/force-fresh-cooldown.ts
1512
+ var FORCE_FRESH_COOLDOWN_MS = 30 * 60 * 1e3;
1513
+ var blockedUntil = 0;
1514
+ function forceFreshCooldownRemainingMs() {
1515
+ return Math.max(0, blockedUntil - Date.now());
1516
+ }
1517
+ function forceFreshMintBlocked() {
1518
+ return forceFreshCooldownRemainingMs() > 0;
1519
+ }
1520
+ function recordForceFreshFailure() {
1521
+ blockedUntil = Date.now() + FORCE_FRESH_COOLDOWN_MS;
1522
+ }
1523
+ function clearForceFreshCooldown() {
1524
+ blockedUntil = 0;
1525
+ }
1526
+ function forceFreshCooldownNotice() {
1527
+ const minutes = Math.ceil(forceFreshCooldownRemainingMs() / 6e4);
1528
+ return `- the force-fresh retry was SKIPPED: one already failed against this pod, so it is on a ${Math.round(FORCE_FRESH_COOLDOWN_MS / 6e4)}-minute cooldown (${minutes} min left). Re-minting cannot fix a credential the pod cannot serve.`;
1529
+ }
1530
+
1531
+ // src/runner/git-utils.ts
1510
1532
  async function ensureOnTaskBranch(cwd, taskBranch, baseBranch) {
1511
1533
  if (!taskBranch) return true;
1512
1534
  try {
@@ -1776,14 +1798,20 @@ async function pushToOrigin(cwd, refreshToken, skipVerify = false) {
1776
1798
  } catch {
1777
1799
  }
1778
1800
  }
1779
- if (await tryPush(cwd, currentBranch, skipVerify)) return true;
1780
- if (refreshToken && await isAuthError(cwd)) {
1801
+ if (await tryPush(cwd, currentBranch, skipVerify)) {
1802
+ clearForceFreshCooldown();
1803
+ return true;
1804
+ }
1805
+ if (refreshToken && !forceFreshMintBlocked() && await isAuthError(cwd)) {
1781
1806
  const token = await refreshToken({ forceFresh: true });
1782
1807
  if (token) {
1783
1808
  await updateRemoteToken(cwd, token);
1784
1809
  process.env.GITHUB_TOKEN = token;
1785
1810
  process.env.GH_TOKEN = token;
1786
- return await tryPush(cwd, currentBranch, skipVerify);
1811
+ const pushed = await tryPush(cwd, currentBranch, skipVerify);
1812
+ if (pushed) clearForceFreshCooldown();
1813
+ else recordForceFreshFailure();
1814
+ return pushed;
1787
1815
  }
1788
1816
  }
1789
1817
  return false;
@@ -11287,10 +11315,18 @@ import { z as z13 } from "zod";
11287
11315
  // src/runner/refresh-verify-heal.ts
11288
11316
  async function refreshAndVerifyGithubCredential(cwd, mint) {
11289
11317
  const first = await mintWriteProbe(cwd, mint, false);
11290
- if (first.probe.ok) return first;
11318
+ if (first.probe.ok) {
11319
+ clearForceFreshCooldown();
11320
+ return first;
11321
+ }
11291
11322
  if (first.probe.outcome !== "denied") return first;
11292
11323
  if (!first.written) return first;
11324
+ if (forceFreshMintBlocked()) {
11325
+ return { ...first, failures: [...first.failures, forceFreshCooldownNotice()] };
11326
+ }
11293
11327
  const healed = await mintWriteProbe(cwd, mint, true);
11328
+ if (healed.probe.ok) clearForceFreshCooldown();
11329
+ else if (healed.probe.outcome === "denied") recordForceFreshFailure();
11294
11330
  return { ...healed, healAttempted: true };
11295
11331
  }
11296
11332
  async function mintWriteProbe(cwd, mint, forceFresh) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  loadPtySpawn,
3
3
  terminateProcessGroup
4
- } from "./chunk-LE6ZUDZT.js";
4
+ } from "./chunk-GJXAAPJ6.js";
5
5
  import {
6
6
  FrameReader,
7
7
  timingSafeTokenEqual,
@@ -86,7 +86,7 @@ import {
86
86
  import { homedir } from "os";
87
87
  import { dirname, join } from "path";
88
88
  function credentialDir(cwd) {
89
- return join(dirname(cwd), ".conveyor-git-credentials");
89
+ return process.env.CONVEYOR_GIT_CREDENTIAL_DIR || join(dirname(cwd), ".conveyor-git-credentials");
90
90
  }
91
91
  function credentialKey(cwd) {
92
92
  return createHash("sha256").update(cwd).digest("hex").slice(0, 16);
@@ -2,7 +2,7 @@ import {
2
2
  gitCredentialHelper,
3
3
  syncGithubTokenFiles,
4
4
  writeGitCredential
5
- } from "./chunk-LE6ZUDZT.js";
5
+ } from "./chunk-GJXAAPJ6.js";
6
6
 
7
7
  // src/runner/session-runner-helpers.ts
8
8
  import { readFileSync } from "fs";
package/dist/cli.js CHANGED
@@ -35,10 +35,10 @@ import {
35
35
  sampleKeyUsage,
36
36
  statWorkspacePath,
37
37
  workspacePathExists
38
- } from "./chunk-E3QHGYZ2.js";
38
+ } from "./chunk-2KZV6I5Z.js";
39
39
  import {
40
40
  reportBootMilestone
41
- } from "./chunk-KG4ORL3Y.js";
41
+ } from "./chunk-QU53HND5.js";
42
42
  import "./chunk-IA45XHOA.js";
43
43
  import {
44
44
  getWorkbenchClient
@@ -53,7 +53,7 @@ import {
53
53
  runStartCommand,
54
54
  sessionTempBase,
55
55
  terminateProcessGroup
56
- } from "./chunk-LE6ZUDZT.js";
56
+ } from "./chunk-GJXAAPJ6.js";
57
57
  import "./chunk-6Q6LQBWO.js";
58
58
 
59
59
  // src/cli.ts
@@ -1715,7 +1715,7 @@ function hostsSpawnedChildren(mode) {
1715
1715
 
1716
1716
  // src/cli.ts
1717
1717
  if (process.argv[2] === "boot") {
1718
- const { runBoot } = await import("./boot-UUPTBQ6R.js");
1718
+ const { runBoot } = await import("./boot-7UWVK777.js");
1719
1719
  process.exit(await runBoot(process.argv.slice(3)));
1720
1720
  }
1721
1721
  if (isLegacyEntrypointLaunch(process.env)) {
@@ -1817,7 +1817,7 @@ process.on("unhandledRejection", (reason) => {
1817
1817
  process.exit(1);
1818
1818
  });
1819
1819
  if (process.env.CONVEYOR_MODE === "workbench") {
1820
- const { startWorkbenchServer } = await import("./server-US2DDQSW.js");
1820
+ const { startWorkbenchServer } = await import("./server-CC7KUJOK.js");
1821
1821
  const { oomWatchdogOptionsFromEnv } = await import("./oom-watchdog-PAC5OJJG.js");
1822
1822
  const { DEFAULT_WORKBENCH_PORT } = await import("./protocol-QBCYO4GI.js");
1823
1823
  const port = Number(process.env.CONVEYOR_WORKBENCH_PORT) || DEFAULT_WORKBENCH_PORT;
package/dist/index.js CHANGED
@@ -13,8 +13,8 @@ import {
13
13
  unshallowRepo,
14
14
  updateRemoteToken,
15
15
  workspacePathExists
16
- } from "./chunk-E3QHGYZ2.js";
17
- import "./chunk-KG4ORL3Y.js";
16
+ } from "./chunk-2KZV6I5Z.js";
17
+ import "./chunk-QU53HND5.js";
18
18
  import "./chunk-IA45XHOA.js";
19
19
  import {
20
20
  getWorkbenchClient
@@ -26,7 +26,7 @@ import {
26
26
  runAuthTokenCommand,
27
27
  runSetupCommand,
28
28
  runStartCommand
29
- } from "./chunk-LE6ZUDZT.js";
29
+ } from "./chunk-GJXAAPJ6.js";
30
30
  import "./chunk-6Q6LQBWO.js";
31
31
 
32
32
  // src/runner/worktree.ts
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  startWorkbenchServer
3
- } from "./chunk-E2SHIH6Y.js";
4
- import "./chunk-LE6ZUDZT.js";
3
+ } from "./chunk-DOB2XE2I.js";
4
+ import "./chunk-GJXAAPJ6.js";
5
5
  import "./chunk-6Q6LQBWO.js";
6
6
  import "./chunk-6W6UZ4SJ.js";
7
7
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rallycry/conveyor-agent",
3
- "version": "10.13.68",
3
+ "version": "10.13.69",
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",