@integrity-labs/agt-cli 0.28.1257 → 0.28.1259

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.
Files changed (31) hide show
  1. package/dist/{api-client-6W27Z5SN.js → api-client-ATRLQZOU.js} +3 -3
  2. package/dist/bin/agt.js +7 -7
  3. package/dist/{chunk-AMZ5XSTY.js → chunk-5433KPH4.js} +2 -2
  4. package/dist/{chunk-HXM2V3VK.js → chunk-BOITSKCM.js} +3 -3
  5. package/dist/{chunk-ZRQWRXGK.js → chunk-F6U3ZJCG.js} +2 -2
  6. package/dist/{chunk-MXDVYW5G.js → chunk-NRNPYXG6.js} +14 -1
  7. package/dist/chunk-NRNPYXG6.js.map +1 -0
  8. package/dist/{chunk-GSNAPMCA.js → chunk-RBC22FRC.js} +75 -9
  9. package/dist/chunk-RBC22FRC.js.map +1 -0
  10. package/dist/{chunk-W6NQLEKG.js → chunk-UAO5VMYK.js} +15 -12
  11. package/dist/chunk-UAO5VMYK.js.map +1 -0
  12. package/dist/{claude-code-updater-3YFSB22P.js → claude-code-updater-SUL3OSGB.js} +3 -3
  13. package/dist/{claude-pair-runtime-W4XS6BR2.js → claude-pair-runtime-D6ZRO2FC.js} +3 -3
  14. package/dist/lib/manager-worker.js +103 -65
  15. package/dist/lib/manager-worker.js.map +1 -1
  16. package/dist/{persistent-session-BBEOA3TR.js → persistent-session-UC56OJVB.js} +4 -4
  17. package/dist/{responsiveness-probe-X32GL24W.js → responsiveness-probe-KGBRCJQW.js} +4 -4
  18. package/dist/{session-auth-dead-5F3NEK57.js → session-auth-dead-AVYJASOL.js} +3 -3
  19. package/package.json +1 -1
  20. package/dist/chunk-GSNAPMCA.js.map +0 -1
  21. package/dist/chunk-MXDVYW5G.js.map +0 -1
  22. package/dist/chunk-W6NQLEKG.js.map +0 -1
  23. /package/dist/{api-client-6W27Z5SN.js.map → api-client-ATRLQZOU.js.map} +0 -0
  24. /package/dist/{chunk-AMZ5XSTY.js.map → chunk-5433KPH4.js.map} +0 -0
  25. /package/dist/{chunk-HXM2V3VK.js.map → chunk-BOITSKCM.js.map} +0 -0
  26. /package/dist/{chunk-ZRQWRXGK.js.map → chunk-F6U3ZJCG.js.map} +0 -0
  27. /package/dist/{claude-code-updater-3YFSB22P.js.map → claude-code-updater-SUL3OSGB.js.map} +0 -0
  28. /package/dist/{claude-pair-runtime-W4XS6BR2.js.map → claude-pair-runtime-D6ZRO2FC.js.map} +0 -0
  29. /package/dist/{persistent-session-BBEOA3TR.js.map → persistent-session-UC56OJVB.js.map} +0 -0
  30. /package/dist/{responsiveness-probe-X32GL24W.js.map → responsiveness-probe-KGBRCJQW.js.map} +0 -0
  31. /package/dist/{session-auth-dead-5F3NEK57.js.map → session-auth-dead-AVYJASOL.js.map} +0 -0
@@ -13,9 +13,9 @@ import {
13
13
  probeClaudeInstalls,
14
14
  readsAsNativeInstall,
15
15
  shouldRunClaudeCodeUpdater
16
- } from "./chunk-AMZ5XSTY.js";
16
+ } from "./chunk-5433KPH4.js";
17
17
  import "./chunk-XWVM4KPK.js";
18
- import "./chunk-MXDVYW5G.js";
18
+ import "./chunk-NRNPYXG6.js";
19
19
  import "./chunk-AIUIMEUS.js";
20
20
  import "./chunk-DGUM43GV.js";
21
21
  export {
@@ -34,4 +34,4 @@ export {
34
34
  readsAsNativeInstall,
35
35
  shouldRunClaudeCodeUpdater
36
36
  };
37
- //# sourceMappingURL=claude-code-updater-3YFSB22P.js.map
37
+ //# sourceMappingURL=claude-code-updater-SUL3OSGB.js.map
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  redactPaneFrame,
10
10
  sanitizeTerminalFrame
11
- } from "./chunk-MXDVYW5G.js";
11
+ } from "./chunk-NRNPYXG6.js";
12
12
  import {
13
13
  CLAUDE_CONFIG_DIR_ENV,
14
14
  claudeConfigDirFor,
@@ -321,7 +321,7 @@ async function spawnPairSession(session) {
321
321
  return { ok: true };
322
322
  } catch {
323
323
  }
324
- const { resolveClaudeBinary } = await import("./persistent-session-BBEOA3TR.js");
324
+ const { resolveClaudeBinary } = await import("./persistent-session-UC56OJVB.js");
325
325
  const claudeBin = resolveClaudeBinary();
326
326
  const pairEnv = {
327
327
  ...process.env,
@@ -836,4 +836,4 @@ export {
836
836
  startClaudePair,
837
837
  submitClaudePairCode
838
838
  };
839
- //# sourceMappingURL=claude-pair-runtime-W4XS6BR2.js.map
839
+ //# sourceMappingURL=claude-pair-runtime-D6ZRO2FC.js.map
@@ -69,7 +69,7 @@ import {
69
69
  tripClass,
70
70
  writeEtcEnvironment,
71
71
  writeProfileDScript
72
- } from "../chunk-W6NQLEKG.js";
72
+ } from "../chunk-UAO5VMYK.js";
73
73
  import {
74
74
  ApiError,
75
75
  adoptHostKeyInProcess,
@@ -87,7 +87,7 @@ import {
87
87
  probeHostKey,
88
88
  requireHost,
89
89
  setConfigHash
90
- } from "../chunk-HXM2V3VK.js";
90
+ } from "../chunk-BOITSKCM.js";
91
91
  import {
92
92
  BLOCKED_ON_PROMPT_DECISION,
93
93
  CHANNEL_SECRET_ENV_KEYS,
@@ -132,6 +132,7 @@ import {
132
132
  opencodeTmuxSession,
133
133
  paneLogPath,
134
134
  parseEnvIntegrations,
135
+ parseGatewayToken,
135
136
  parseModelPolicy,
136
137
  policyResolvedModel,
137
138
  prepareForRespawn,
@@ -171,7 +172,7 @@ import {
171
172
  webFetchBaselineValue,
172
173
  webFetchRestartNeeded,
173
174
  writeEgressAllowlist
174
- } from "../chunk-GSNAPMCA.js";
175
+ } from "../chunk-RBC22FRC.js";
175
176
  import {
176
177
  isAgentIdle,
177
178
  isStaleForToday,
@@ -182,7 +183,7 @@ import {
182
183
  subagentActivityAgeSeconds,
183
184
  subagentTranscriptDir,
184
185
  transcriptActivityAgeSeconds
185
- } from "../chunk-ZRQWRXGK.js";
186
+ } from "../chunk-F6U3ZJCG.js";
186
187
  import {
187
188
  classifyUnanswerablePane,
188
189
  focusedConfirmDialogBlock,
@@ -206,7 +207,7 @@ import {
206
207
  runSafeCleanup,
207
208
  tightestDiskStat,
208
209
  withPackageCacheLock
209
- } from "../chunk-AMZ5XSTY.js";
210
+ } from "../chunk-5433KPH4.js";
210
211
  import {
211
212
  parsePsRows,
212
213
  reapOrphanChannelMcps
@@ -334,7 +335,7 @@ import {
334
335
  stabiliseResetInstant,
335
336
  sumTranscriptUsageInWindow,
336
337
  summarizeTranscriptActivity
337
- } from "../chunk-MXDVYW5G.js";
338
+ } from "../chunk-NRNPYXG6.js";
338
339
  import {
339
340
  CLAUDE_CONFIG_DIR_ENV,
340
341
  claudeConfigDirFor,
@@ -527,6 +528,36 @@ function staleSessionStopConfirmed(sessionState) {
527
528
  return sessionState === "dead";
528
529
  }
529
530
 
531
+ // src/lib/config-reload-confirm.ts
532
+ function staleReloadTmuxSession(framework, codeName) {
533
+ return framework === "opencode" ? opencodeTmuxSession(codeName) : `agt-${codeName}`;
534
+ }
535
+ function confirmConfigReload(input, deps) {
536
+ if (!configReloadConfirmed({ pending: input.pending, freshFetch: input.freshFetch, rendered: input.rendered })) {
537
+ return { action: "not_ready" };
538
+ }
539
+ const session = staleReloadTmuxSession(input.framework, input.codeName);
540
+ let stopped = false;
541
+ if (deps.probe(session) === "alive") {
542
+ deps.log(
543
+ `[restart] '${input.codeName}' is running config from before the reload's fresh render - restarting it (ENG-11912)`
544
+ );
545
+ if (input.framework === "opencode") deps.stopOpencode(input.codeName);
546
+ else deps.stopClaudeCode(input.codeName);
547
+ stopped = true;
548
+ }
549
+ const sessionState = deps.probe(session);
550
+ if (staleSessionStopConfirmed(sessionState)) {
551
+ deps.confirm(input.agentId);
552
+ deps.log(`[restart] config-change reload for '${input.codeName}' rendered from fresh integrations - acking (ENG-11912)`);
553
+ return { action: "acked", stopped };
554
+ }
555
+ deps.log(
556
+ `[restart] STALE_SESSION_STOP_FAILED agent='${input.codeName}' session_state=${sessionState}: the session spawned from pre-reload config is still running or could not be probed, so the config-change reload stays pending and the stop is retried next poll (ENG-11912)`
557
+ );
558
+ return { action: "stop_unconfirmed", sessionState, stopped };
559
+ }
560
+
530
561
  // src/lib/manager-worker.ts
531
562
  import { createHash as createHash20 } from "crypto";
532
563
  import { readFileSync as readFileSync35, writeFileSync as writeFileSync18, mkdirSync as mkdirSync16, existsSync as existsSync19, rmSync as rmSync8, readdirSync as readdirSync14, statSync as statSync15, unlinkSync as unlinkSync6, renameSync as renameSync11, utimesSync as utimesSync4, readlinkSync as readlinkSync2 } from "fs";
@@ -9520,7 +9551,7 @@ function launchesWithClaudeModelFlag(refreshData) {
9520
9551
  const { modelEnv } = resolveModelPolicySpawnEnv({
9521
9552
  policy: parseModelPolicy(refreshData.model_policy),
9522
9553
  openRouterMode: false,
9523
- gatewayToken: null,
9554
+ gatewayToken: parseGatewayToken(refreshData),
9524
9555
  codeName: String(agent["code_name"] ?? "")
9525
9556
  });
9526
9557
  return Object.keys(modelEnv).length === 0;
@@ -14157,7 +14188,7 @@ function createFileMigrationReportIO(codeName, log2) {
14157
14188
  };
14158
14189
  }
14159
14190
  var managerHostPost = async (path, body) => {
14160
- const { api: api2, ApiError: ApiError3 } = await import("../api-client-6W27Z5SN.js");
14191
+ const { api: api2, ApiError: ApiError3 } = await import("../api-client-ATRLQZOU.js");
14161
14192
  try {
14162
14193
  const json = await api2.post(path, body);
14163
14194
  return { status: 200, json };
@@ -16196,7 +16227,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
16196
16227
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
16197
16228
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
16198
16229
  async function channelInboundActivityAgeSecondsFor(codeName) {
16199
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-X32GL24W.js");
16230
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-KGBRCJQW.js");
16200
16231
  const newest = newestPendingInboundActivityMtimeMs(dirname11(paneLogPath(codeName)));
16201
16232
  if (newest === null) return null;
16202
16233
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -17012,7 +17043,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
17012
17043
  var lastVersionCheckAt = 0;
17013
17044
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
17014
17045
  var lastResponsivenessProbeAt = 0;
17015
- var agtCliVersion = true ? "0.28.1257" : "dev";
17046
+ var agtCliVersion = true ? "0.28.1259" : "dev";
17016
17047
  function resolveBrewPath(execFileSync4) {
17017
17048
  try {
17018
17049
  const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -19011,7 +19042,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
19011
19042
  if (codeNames.length === 0) return;
19012
19043
  void (async () => {
19013
19044
  try {
19014
- const { collectDiagnostics } = await import("../persistent-session-BBEOA3TR.js");
19045
+ const { collectDiagnostics } = await import("../persistent-session-UC56OJVB.js");
19015
19046
  await api.post("/host/heartbeat", {
19016
19047
  host_id: hostId,
19017
19048
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
@@ -19154,7 +19185,7 @@ async function pollCycleInner() {
19154
19185
  }
19155
19186
  try {
19156
19187
  const { detectHostSecurity } = await import("../host-security-KQYYZZVW.js");
19157
- const { collectDiagnostics } = await import("../persistent-session-BBEOA3TR.js");
19188
+ const { collectDiagnostics } = await import("../persistent-session-UC56OJVB.js");
19158
19189
  const diagCodeNames = [...agentState.persistentSessionAgents];
19159
19190
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor) : void 0;
19160
19191
  let tailscaleHostname;
@@ -19419,7 +19450,7 @@ async function pollCycleInner() {
19419
19450
  }
19420
19451
  try {
19421
19452
  const desiredClaudeCodeVersion = hbResp?.desired_claude_code_version?.trim();
19422
- const { maybeUpdateClaudeCode, shouldRunClaudeCodeUpdater } = await import("../claude-code-updater-3YFSB22P.js");
19453
+ const { maybeUpdateClaudeCode, shouldRunClaudeCodeUpdater } = await import("../claude-code-updater-SUL3OSGB.js");
19423
19454
  const securityFloor = currentSecurityFloor();
19424
19455
  claudeUpdaterInFlight = true;
19425
19456
  if (desiredClaudeCodeVersion && (claudePairLoop.busy || claudePairingInProgress())) {
@@ -19454,7 +19485,7 @@ async function pollCycleInner() {
19454
19485
  collectPanelessActivityProbes,
19455
19486
  getResponsivenessIntervalMs,
19456
19487
  occupancyQualificationClassifications
19457
- } = await import("../responsiveness-probe-X32GL24W.js");
19488
+ } = await import("../responsiveness-probe-KGBRCJQW.js");
19458
19489
  const probeIntervalMs = getResponsivenessIntervalMs();
19459
19490
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
19460
19491
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -19571,7 +19602,7 @@ async function pollCycleInner() {
19571
19602
  collectResponsivenessProbes,
19572
19603
  livePendingInboundOldestAgeSeconds,
19573
19604
  parkPendingInbound
19574
- } = await import("../responsiveness-probe-X32GL24W.js");
19605
+ } = await import("../responsiveness-probe-KGBRCJQW.js");
19575
19606
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-5PCBGRNY.js");
19576
19607
  const wedgeNow = /* @__PURE__ */ new Date();
19577
19608
  const liveAgents = agentState.persistentSessionAgents;
@@ -19857,7 +19888,7 @@ async function pollCycleInner() {
19857
19888
  }
19858
19889
  }
19859
19890
  );
19860
- const { parkPendingInbound } = await import("../responsiveness-probe-X32GL24W.js");
19891
+ const { parkPendingInbound } = await import("../responsiveness-probe-KGBRCJQW.js");
19861
19892
  const { parked, deadLettered } = parkPendingInbound(codeName, new Date(fatalNowMs));
19862
19893
  paneFatalStreak.delete(codeName);
19863
19894
  paneFatalRestarts.set(codeName, [...history, fatalNowMs]);
@@ -19888,7 +19919,7 @@ async function pollCycleInner() {
19888
19919
  TRANSCRIPT_MOUNT_ESCALATION_REFRESH_MS,
19889
19920
  bindSourceEscalations
19890
19921
  } = await import("../transcript-mount-health-OHE6IVJV.js");
19891
- const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-BBEOA3TR.js");
19922
+ const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-UC56OJVB.js");
19892
19923
  const mountConfig = resolveTranscriptMountConfig();
19893
19924
  const liveAgents = agentState.persistentSessionAgents;
19894
19925
  for (const tracked of [
@@ -20053,7 +20084,7 @@ async function pollCycleInner() {
20053
20084
  }
20054
20085
  try {
20055
20086
  const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-VR5QGP3J.js");
20056
- const { probeSessionAuth } = await import("../session-auth-dead-5F3NEK57.js");
20087
+ const { probeSessionAuth } = await import("../session-auth-dead-AVYJASOL.js");
20057
20088
  const observations = [];
20058
20089
  const pendingCacheCommits = [];
20059
20090
  const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
@@ -22648,35 +22679,32 @@ async function processAgent(agent, agentStates, managedToolkits) {
22648
22679
  if (markMcpRepairPending(agentState.knownIntegrationHashes, agent.agent_id, orphanPruneFailed || mcpWriteFailed || !rotationHandled)) {
22649
22680
  log(`[hot-reload] '${agent.code_name}': MCP config writes did not all land this poll; the next poll re-renders to repair them (ENG-11912)`);
22650
22681
  }
22651
- if (configReloadConfirmed({
22652
- pending: configReloads.isPending(agent.agent_id),
22653
- freshFetch: integrationsFresh,
22654
- rendered: rotationHandled && !orphanPruneFailed && !mcpWriteFailed
22655
- })) {
22656
- const fwForReload = agentFrameworkCache.get(agent.code_name) ?? DEFAULT_FRAMEWORK;
22657
- const staleTmuxSession = fwForReload === "opencode" ? opencodeTmuxSession(agent.code_name) : `agt-${agent.code_name}`;
22658
- if (probeTmuxSession(staleTmuxSession) === "alive") {
22659
- if (fwForReload === "opencode") {
22660
- stopOpencodeSession(agent.code_name, log);
22661
- } else {
22662
- log(`[restart] '${agent.code_name}' is running config from before the reload's fresh render - restarting it (ENG-11912)`);
22682
+ confirmConfigReload(
22683
+ {
22684
+ agentId: agent.agent_id,
22685
+ codeName: agent.code_name,
22686
+ framework: agentFrameworkCache.get(agent.code_name) ?? DEFAULT_FRAMEWORK,
22687
+ pending: configReloads.isPending(agent.agent_id),
22688
+ freshFetch: integrationsFresh,
22689
+ rendered: rotationHandled && !orphanPruneFailed && !mcpWriteFailed
22690
+ },
22691
+ {
22692
+ // CodeRabbit on ba9356f4: the tri-state probe, not the boolean health
22693
+ // checks, which read a tmux error (timeout, missing binary) as "no
22694
+ // session" and would confirm over a session that may still be running.
22695
+ probe: probeTmuxSession,
22696
+ stopOpencode: (code) => stopOpencodeSession(code, log),
22697
+ stopClaudeCode: (code) => {
22663
22698
  try {
22664
- syncExecFile("tmux", ["kill-session", "-t", `agt-${agent.code_name}`], { stdio: "ignore" });
22699
+ syncExecFile("tmux", ["kill-session", "-t", `agt-${code}`], { stdio: "ignore" });
22665
22700
  } catch {
22666
22701
  }
22667
- stopPersistentSessionAndForgetMcpBaseline(agent.code_name, "integration-change");
22668
- }
22669
- }
22670
- const staleSessionState = probeTmuxSession(staleTmuxSession);
22671
- if (staleSessionStopConfirmed(staleSessionState)) {
22672
- configReloads.confirm(agent.agent_id);
22673
- log(`[restart] config-change reload for '${agent.code_name}' rendered from fresh integrations - acking (ENG-11912)`);
22674
- } else {
22675
- log(
22676
- `[restart] STALE_SESSION_STOP_FAILED agent='${agent.code_name}' session_state=${staleSessionState}: the session spawned from pre-reload config is still running or could not be probed, so the config-change reload stays pending and the stop is retried next poll (ENG-11912)`
22677
- );
22702
+ stopPersistentSessionAndForgetMcpBaseline(code, "integration-change");
22703
+ },
22704
+ confirm: (agentId) => configReloads.confirm(agentId),
22705
+ log
22678
22706
  }
22679
- }
22707
+ );
22680
22708
  if (capSurfaceHash !== prevCapSurfaceHash && rotationHandled) {
22681
22709
  if (intFlap.flapping) {
22682
22710
  log(`[mcp-flap-dampener] suppressed integration-update notice for '${agent.code_name}' (set flapping, ENG-6123): ${capSurfaceNames}`);
@@ -24035,6 +24063,7 @@ async function ensurePersistentSessionUnchecked(agent, tasks, boardItems, refres
24035
24063
  const modelPolicy = parseModelPolicy(
24036
24064
  refreshData.model_policy
24037
24065
  );
24066
+ const modelPolicyGatewayToken = parseGatewayToken(refreshData);
24038
24067
  let claudeAuthMode;
24039
24068
  let anthropicApiKey;
24040
24069
  let anthropicApiKeyFingerprint;
@@ -24144,18 +24173,21 @@ async function ensurePersistentSessionUnchecked(agent, tasks, boardItems, refres
24144
24173
  claudeAuthMode,
24145
24174
  anthropicApiKeyFingerprint,
24146
24175
  claudeAccountFingerprint,
24147
- modelPolicyComponent: modelPolicyAuthComponent(modelPolicy)
24176
+ // ENG-10865: the token's FINGERPRINT rides in the policy component, so a
24177
+ // re-minted or revoked key moves the tuple and the agent respawns onto it.
24178
+ // Without it `policyId@revision` holds still while the credential changes
24179
+ // underneath a running agent, and nothing would ever trigger the restart.
24180
+ modelPolicyComponent: modelPolicyAuthComponent(modelPolicy, modelPolicyGatewayToken)
24148
24181
  });
24149
24182
  const currentPolicyModel = policyResolvedModel({
24150
24183
  policy: modelPolicy,
24151
24184
  openRouterMode: Boolean(openRouterForAgent),
24152
- // The same null the launcher config carries — see `modelPolicyGatewayToken`
24153
- // at the spawn call site below, where its absence is deliberate until
24154
- // ENG-9481 decides what a gateway credential is. Both sites must move
24155
- // together: a token here and not there (or the reverse) resolves a gateway
24156
- // binding `blocked` for one and honoured for the other, and the recorded
24157
- // baseline would then describe an agent that does not exist.
24158
- gatewayToken: null,
24185
+ // ENG-10865: the SAME value the launcher config carries below, and that is
24186
+ // the whole requirement. A token here and not there (or the reverse)
24187
+ // resolves a gateway binding `blocked` for one and honoured for the other,
24188
+ // and the recorded baseline would then describe an agent that does not
24189
+ // exist. One local, two reads.
24190
+ gatewayToken: modelPolicyGatewayToken,
24159
24191
  codeName
24160
24192
  });
24161
24193
  const currentPolicyId = currentPolicyModel ? modelPolicy?.policyId ?? null : null;
@@ -24500,17 +24532,23 @@ ${truncateForLog(ctx.tail)}` : `; pane_tail_hash=sha256:${createHash20("sha256")
24500
24532
  model: openRouterForAgent.model,
24501
24533
  smallFastModel: openRouterForAgent.smallFastModel
24502
24534
  } : null,
24503
- // ENG-9483 slice 2 (ADR-0074). The SHAPE reaches the launcher; the
24504
- // credential does not. `modelPolicyGatewayToken` is deliberately absent
24505
- // (⇒ null) rather than wired to some plausible existing secret: slice 1's
24506
- // resolver never selects `model_policy_bindings.credential`, and ENG-9481's
24507
- // stored-key-vs-pass-through answer decides whether the credential is a
24508
- // `gateway_token` (needing ANTHROPIC_CUSTOM_HEADERS, an at-rest secret this
24509
- // tree does not have) or a plain `api_key` (which does not). Until then a
24510
- // gateway binding resolves to `blocked` and the agent keeps its existing
24511
- // auth — see resolveBindingCredential, the one function that changes when
24512
- // that question is answered.
24535
+ // ENG-9483 slice 2 (ADR-0074) + ENG-10865. Both the SHAPE and the
24536
+ // credential now reach the launcher.
24537
+ //
24538
+ // The credential is whatever `/host/refresh` delivered for this agent and
24539
+ // nothing else — see `modelPolicyGatewayToken` above for why there is no
24540
+ // fallback. It is `null` for the entire fleet until delivery is armed, so
24541
+ // a gateway binding still resolves `blocked` and the agent keeps its
24542
+ // existing auth, which is today's behaviour unchanged.
24543
+ //
24544
+ // ENG-9481 is NOT what gated this. That issue is a CUSTODY question about
24545
+ // holding a CUSTOMER's gateway key; this token is the platform's own,
24546
+ // minted per agent, and `resolveBindingCredential` refuses to apply it to
24547
+ // any binding that is not `credential_owner = 'platform'` on our own
24548
+ // gateway origin. The custom-headers shape ENG-9481 decides is still
24549
+ // unbuilt and still unreachable from here.
24513
24550
  modelPolicy,
24551
+ modelPolicyGatewayToken,
24514
24552
  runId: sessionRunResult.run_id,
24515
24553
  agentTimezone,
24516
24554
  // ENG-6476: materialize the host-side reply-routing flags into the agent
@@ -24981,7 +25019,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
24981
25019
  if (!refreshData) return;
24982
25020
  const framework = refreshData.agent?.framework ?? agentFrameworkCache.get(codeName) ?? DEFAULT_FRAMEWORK;
24983
25021
  const hostId = await getHostId();
24984
- const parkForRestart = await import("../responsiveness-probe-X32GL24W.js").then(
25022
+ const parkForRestart = await import("../responsiveness-probe-KGBRCJQW.js").then(
24985
25023
  (m) => m.parkPendingInbound,
24986
25024
  (err) => err
24987
25025
  );
@@ -25054,7 +25092,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
25054
25092
  void api.post("/host/restart-ack", { host_id: hostId, agent_id: agentId, restart_requested_at: requestedAt }).catch((err) => log(`[restart-lane] ack failed for '${codeName}': ${err.message}`));
25055
25093
  void (async () => {
25056
25094
  try {
25057
- const { collectDiagnostics } = await import("../persistent-session-BBEOA3TR.js");
25095
+ const { collectDiagnostics } = await import("../persistent-session-UC56OJVB.js");
25058
25096
  await api.post("/host/heartbeat", {
25059
25097
  host_id: hostId,
25060
25098
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
@@ -25105,7 +25143,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
25105
25143
  }
25106
25144
  try {
25107
25145
  const hostId = await getHostId();
25108
- const { collectDiagnostics } = await import("../persistent-session-BBEOA3TR.js");
25146
+ const { collectDiagnostics } = await import("../persistent-session-UC56OJVB.js");
25109
25147
  await api.post("/host/heartbeat", {
25110
25148
  host_id: hostId,
25111
25149
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor, sessionActivityFor)
@@ -25807,7 +25845,7 @@ async function processClaudePairSessions(agents) {
25807
25845
  snapshotPairConfig,
25808
25846
  // ENG-11659: result -> report body + the manager.log line that records it.
25809
25847
  planPairStartReport
25810
- } = await import("../claude-pair-runtime-W4XS6BR2.js");
25848
+ } = await import("../claude-pair-runtime-D6ZRO2FC.js");
25811
25849
  const { resetClaudeSignin, describeSigninResetForLog, describeSigninResetFailure } = await import("../claude-signin-reset-6IJMMVYG.js");
25812
25850
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
25813
25851
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);