@vectorize-io/hindsight-coding-agents 0.8.4 → 0.8.6

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 (62) hide show
  1. package/README.md +13 -12
  2. package/dist/antigravity-hook.js +1 -1
  3. package/dist/antigravity-statusline.js +1 -1
  4. package/dist/antigravity-stop-hook.js +1 -1
  5. package/dist/claude-hook.js +1 -1
  6. package/dist/claude-sessionstart-hook.js +85 -88
  7. package/dist/claude-stop-hook.js +1 -1
  8. package/dist/cline.js +86 -89
  9. package/dist/codebuddy-hook.js +1 -1
  10. package/dist/codebuddy-sessionstart-hook.js +85 -88
  11. package/dist/codebuddy-stop-hook.js +1 -1
  12. package/dist/codex-hook.js +1 -1
  13. package/dist/codex-sessionstart-hook.js +85 -88
  14. package/dist/codex-stop-hook.js +1 -1
  15. package/dist/copilot-hook.js +1 -1
  16. package/dist/copilot-sessionstart-hook.js +85 -88
  17. package/dist/copilot-stop-hook.js +1 -1
  18. package/dist/cursor-hook.js +1 -1
  19. package/dist/cursor-sessionstart-hook.js +85 -88
  20. package/dist/cursor-stop-hook.js +1 -1
  21. package/dist/daemon-start.js +1 -1
  22. package/dist/dcode-hook.js +1 -1
  23. package/dist/dcode-sessionstart-hook.js +85 -88
  24. package/dist/dcode-stop-hook.js +1 -1
  25. package/dist/deepen.js +1 -1
  26. package/dist/devin-hook.js +1 -1
  27. package/dist/devin-sessionstart-hook.js +85 -88
  28. package/dist/devin-stop-hook.js +1 -1
  29. package/dist/droid-hook.js +1 -1
  30. package/dist/droid-sessionstart-hook.js +85 -88
  31. package/dist/droid-stop-hook.js +1 -1
  32. package/dist/dsh.js +86 -89
  33. package/dist/grok-hook.js +1 -1
  34. package/dist/grok-sessionstart-hook.js +85 -88
  35. package/dist/grok-stop-hook.js +1 -1
  36. package/dist/hindsight-seed.js +1 -1
  37. package/dist/index.js +86 -89
  38. package/dist/installer.js +1 -1
  39. package/dist/kilo.js +86 -89
  40. package/dist/kimi-hook.js +1 -1
  41. package/dist/kimi-sessionstart-hook.js +85 -88
  42. package/dist/kimi-stop-hook.js +1 -1
  43. package/dist/mcp-server.js +1 -1
  44. package/dist/opencode2.js +86 -89
  45. package/dist/pi.js +86 -89
  46. package/dist/prime-agent.js +86 -89
  47. package/dist/qwen-hook.js +1 -1
  48. package/dist/qwen-sessionstart-hook.js +85 -88
  49. package/dist/qwen-stop-hook.js +1 -1
  50. package/dist/status.js +1 -1
  51. package/dist/traecode-hook.js +1 -1
  52. package/dist/traecode-sessionstart-hook.js +85 -88
  53. package/dist/traecode-stop-hook.js +1 -1
  54. package/dist/workbuddy-hook.js +1 -1
  55. package/dist/workbuddy-sessionstart-hook.js +85 -88
  56. package/dist/workbuddy-stop-hook.js +1 -1
  57. package/dist/zcode-hook.js +1 -1
  58. package/dist/zcode-sessionstart-hook.js +85 -88
  59. package/dist/zcode-stop-hook.js +1 -1
  60. package/package.json +1 -1
  61. package/plugin.json +1 -1
  62. package/skill/SKILL.md +3 -3
@@ -673,7 +673,7 @@ function codingBankManifest(overrides, mode = DEFAULT_RETAIN_EXTRACTION_MODE, de
673
673
  }
674
674
 
675
675
  // package.json
676
- var version = "0.8.4";
676
+ var version = "0.8.6";
677
677
 
678
678
  // src/core/util.ts
679
679
  import { accessSync, constants, statSync as statSync2 } from "fs";
@@ -2737,6 +2737,8 @@ function resolveAgentBin(harness, claudeBin) {
2737
2737
  return process.env.HINDSIGHT_ANTIGRAVITY_BIN || "agy";
2738
2738
  case "opencode":
2739
2739
  return process.env.HINDSIGHT_OPENCODE_BIN || "opencode";
2740
+ default:
2741
+ return void 0;
2740
2742
  }
2741
2743
  }
2742
2744
  function opencodeCanDefineSurveyAgent(bin) {
@@ -2765,7 +2767,10 @@ var SURVEY_DISALLOWED_TOOLS = [
2765
2767
  var tomlValue = (value) => stringify({ v: value }).slice("v = ".length).trim();
2766
2768
  function buildSurveyPlan(harness, bin, repoDir, opts) {
2767
2769
  const env = {
2768
- ...process.env,
2770
+ // Terminal managers name the user's pane in env vars and hook the agent's Stop: inherited,
2771
+ // they made the survey's run look like the user's, so Orca closed the pane and Herdr rebound
2772
+ // it to the survey's session (#6075).
2773
+ ...Object.fromEntries(Object.entries(process.env).filter(([k]) => !/^(ORCA|HERDR)_/.test(k))),
2769
2774
  // Anti-recursion: the survey's own agent session must not fire our hooks (session-start,
2770
2775
  // UserPromptSubmit/BeforeAgent, Stop/SessionEnd) or re-seed — see the HINDSIGHT_DISABLE_HOOKS
2771
2776
  // guard in hook.ts / retain-hook.ts / session-start.ts / runtime.ts.
@@ -2859,96 +2864,88 @@ function surveyAttempts(file, sha) {
2859
2864
  async function startCodebaseSurvey(repoDir, opts = {}) {
2860
2865
  try {
2861
2866
  const spawnFn = opts.spawn ?? realSpawn4;
2862
- const resolveBin = opts.resolveBin ?? ((bin) => binOnPath(bin, { exts: [".exe"] }));
2867
+ const resolveBin = opts.resolveBin ?? ((bin2) => binOnPath(bin2, { exts: [".exe"] }));
2863
2868
  const mcpServerPath = opts.mcpServerPath ?? join13(dirname8(fileURLToPath3(import.meta.url)), "mcp-server.js");
2864
- const preferred = opts.harness ?? "claude-code";
2865
- const order = [
2866
- preferred,
2867
- "claude-code",
2868
- "codex",
2869
- "antigravity-cli",
2870
- "opencode"
2871
- ];
2872
- const seen = /* @__PURE__ */ new Set();
2873
- for (const harness of order) {
2874
- if (seen.has(harness)) continue;
2875
- seen.add(harness);
2876
- const name = resolveAgentBin(harness, opts.claudeBin);
2877
- const bin = resolveBin(name);
2878
- if (!bin) {
2879
- log.info("survey", `${harness}: ${name} not found, trying the next agent`);
2880
- continue;
2881
- }
2882
- if (harness === "opencode" && !(opts.opencodeDefinesAgent ?? opencodeCanDefineSurveyAgent)(bin)) {
2883
- log.info("survey", `${harness}: ${bin} cannot define the survey agent, trying the next`);
2884
- continue;
2885
- }
2886
- const plan = buildSurveyPlan(harness, bin, repoDir, {
2887
- model: opts.model,
2888
- budgetUsd: opts.budgetUsd,
2889
- mcpServerPath
2890
- });
2891
- const { cfg, bankId } = resolveHostConfig(harness, repoDir);
2892
- if (cfg.disabled) return false;
2893
- const key = createHash4("sha256").update(JSON.stringify([cfg.apiUrl.replace(/\/+$/, ""), cfg.apiToken ?? "", bankId])).digest("hex");
2894
- const leaseDir = opts.lease?.dir ?? join13(tmpdir3(), "hindsight-coding-agent", "surveys");
2895
- const lease = acquireLease(leaseDir, key, opts.lease?.staleMs ?? LEASE_STALE_MS);
2896
- if (!lease) return false;
2897
- const attemptsFile = join13(
2898
- leaseDir,
2899
- `attempts-${createHash4("sha256").update(JSON.stringify([key, repoDir])).digest("hex")}.json`
2900
- );
2901
- const attempts = opts.sha ? surveyAttempts(attemptsFile, opts.sha) : 0;
2902
- if (attempts >= SURVEY_MAX_ATTEMPTS) {
2903
- log.info("survey", `${attempts} surveys already launched at ${opts.sha}, skipping`);
2904
- releaseLease(lease);
2905
- return false;
2906
- }
2907
- const spec = {
2908
- lease,
2909
- bin: plan.bin,
2910
- args: plan.args,
2911
- ...opts.lease?.heartbeatMs ? { heartbeatMs: opts.lease.heartbeatMs } : {}
2912
- };
2913
- const supervisorPath = opts.supervisorPath ?? join13(dirname8(fileURLToPath3(import.meta.url)), "survey-supervisor.js");
2914
- return await new Promise((resolve4) => {
2915
- try {
2916
- const child = spawnFn("node", [supervisorPath], {
2917
- cwd: repoDir,
2918
- detached: true,
2919
- stdio: "ignore",
2920
- windowsHide: true,
2921
- env: { ...plan.env, [SURVEY_SPEC_ENV]: JSON.stringify(spec) }
2922
- });
2923
- let spawned = false;
2924
- child.on("error", (e) => {
2925
- if (spawned) return;
2926
- log.warn("survey", `survey supervisor failed to launch: ${describeError(e)}`);
2927
- releaseLease(lease);
2928
- resolve4(false);
2929
- });
2930
- child.once("spawn", () => {
2931
- spawned = true;
2932
- child.unref();
2933
- if (opts.sha) {
2934
- try {
2935
- writeFileSync3(
2936
- attemptsFile,
2937
- JSON.stringify({ sha: opts.sha, attempts: attempts + 1 }),
2938
- { mode: 384 }
2939
- );
2940
- } catch {
2941
- }
2942
- }
2943
- resolve4(true);
2944
- });
2945
- } catch (e) {
2869
+ const harness = opts.harness ?? "claude-code";
2870
+ const name = resolveAgentBin(harness, opts.claudeBin);
2871
+ if (!name) {
2872
+ log.info("survey", `${harness}: no headless survey for this agent, skipping the survey`);
2873
+ return false;
2874
+ }
2875
+ const bin = resolveBin(name);
2876
+ if (!bin) {
2877
+ log.info("survey", `${harness}: ${name} not found, skipping the survey`);
2878
+ return false;
2879
+ }
2880
+ if (harness === "opencode" && !(opts.opencodeDefinesAgent ?? opencodeCanDefineSurveyAgent)(bin)) {
2881
+ log.info("survey", `${harness}: ${bin} cannot define the survey agent, skipping the survey`);
2882
+ return false;
2883
+ }
2884
+ const plan = buildSurveyPlan(harness, bin, repoDir, {
2885
+ model: opts.model,
2886
+ budgetUsd: opts.budgetUsd,
2887
+ mcpServerPath
2888
+ });
2889
+ const { cfg, bankId } = resolveHostConfig(harness, repoDir);
2890
+ if (cfg.disabled) return false;
2891
+ const key = createHash4("sha256").update(JSON.stringify([cfg.apiUrl.replace(/\/+$/, ""), cfg.apiToken ?? "", bankId])).digest("hex");
2892
+ const leaseDir = opts.lease?.dir ?? join13(tmpdir3(), "hindsight-coding-agent", "surveys");
2893
+ const lease = acquireLease(leaseDir, key, opts.lease?.staleMs ?? LEASE_STALE_MS);
2894
+ if (!lease) return false;
2895
+ const attemptsFile = join13(
2896
+ leaseDir,
2897
+ `attempts-${createHash4("sha256").update(JSON.stringify([key, repoDir])).digest("hex")}.json`
2898
+ );
2899
+ const attempts = opts.sha ? surveyAttempts(attemptsFile, opts.sha) : 0;
2900
+ if (attempts >= SURVEY_MAX_ATTEMPTS) {
2901
+ log.info("survey", `${attempts} surveys already launched at ${opts.sha}, skipping`);
2902
+ releaseLease(lease);
2903
+ return false;
2904
+ }
2905
+ const spec = {
2906
+ lease,
2907
+ bin: plan.bin,
2908
+ args: plan.args,
2909
+ ...opts.lease?.heartbeatMs ? { heartbeatMs: opts.lease.heartbeatMs } : {}
2910
+ };
2911
+ const supervisorPath = opts.supervisorPath ?? join13(dirname8(fileURLToPath3(import.meta.url)), "survey-supervisor.js");
2912
+ return await new Promise((resolve4) => {
2913
+ try {
2914
+ const child = spawnFn("node", [supervisorPath], {
2915
+ cwd: repoDir,
2916
+ detached: true,
2917
+ stdio: "ignore",
2918
+ windowsHide: true,
2919
+ env: { ...plan.env, [SURVEY_SPEC_ENV]: JSON.stringify(spec) }
2920
+ });
2921
+ let spawned = false;
2922
+ child.on("error", (e) => {
2923
+ if (spawned) return;
2946
2924
  log.warn("survey", `survey supervisor failed to launch: ${describeError(e)}`);
2947
2925
  releaseLease(lease);
2948
2926
  resolve4(false);
2949
- }
2950
- });
2951
- }
2927
+ });
2928
+ child.once("spawn", () => {
2929
+ spawned = true;
2930
+ child.unref();
2931
+ if (opts.sha) {
2932
+ try {
2933
+ writeFileSync3(
2934
+ attemptsFile,
2935
+ JSON.stringify({ sha: opts.sha, attempts: attempts + 1 }),
2936
+ { mode: 384 }
2937
+ );
2938
+ } catch {
2939
+ }
2940
+ }
2941
+ resolve4(true);
2942
+ });
2943
+ } catch (e) {
2944
+ log.warn("survey", `survey supervisor failed to launch: ${describeError(e)}`);
2945
+ releaseLease(lease);
2946
+ resolve4(false);
2947
+ }
2948
+ });
2952
2949
  } catch {
2953
2950
  }
2954
2951
  return false;
@@ -633,7 +633,7 @@ function codingBankManifest(overrides, mode = DEFAULT_RETAIN_EXTRACTION_MODE, de
633
633
  }
634
634
 
635
635
  // package.json
636
- var version = "0.8.4";
636
+ var version = "0.8.6";
637
637
 
638
638
  // src/core/util.ts
639
639
  import { accessSync, constants, statSync as statSync2 } from "fs";
@@ -32025,7 +32025,7 @@ function codingBankManifest(overrides, mode = DEFAULT_RETAIN_EXTRACTION_MODE, de
32025
32025
  }
32026
32026
 
32027
32027
  // package.json
32028
- var version2 = "0.8.4";
32028
+ var version2 = "0.8.6";
32029
32029
 
32030
32030
  // src/core/util.ts
32031
32031
  import { accessSync, constants, statSync as statSync2 } from "fs";
package/dist/opencode2.js CHANGED
@@ -15167,7 +15167,7 @@ function codingBankManifest(overrides, mode = DEFAULT_RETAIN_EXTRACTION_MODE, de
15167
15167
  }
15168
15168
 
15169
15169
  // package.json
15170
- var version2 = "0.8.4";
15170
+ var version2 = "0.8.6";
15171
15171
 
15172
15172
  // src/core/util.ts
15173
15173
  import { accessSync, constants, statSync as statSync2 } from "fs";
@@ -17319,6 +17319,8 @@ function resolveAgentBin(harness, claudeBin) {
17319
17319
  return process.env.HINDSIGHT_ANTIGRAVITY_BIN || "agy";
17320
17320
  case "opencode":
17321
17321
  return process.env.HINDSIGHT_OPENCODE_BIN || "opencode";
17322
+ default:
17323
+ return void 0;
17322
17324
  }
17323
17325
  }
17324
17326
  function opencodeCanDefineSurveyAgent(bin) {
@@ -17347,7 +17349,10 @@ var SURVEY_DISALLOWED_TOOLS = [
17347
17349
  var tomlValue = (value) => stringify({ v: value }).slice("v = ".length).trim();
17348
17350
  function buildSurveyPlan(harness, bin, repoDir, opts) {
17349
17351
  const env = {
17350
- ...process.env,
17352
+ // Terminal managers name the user's pane in env vars and hook the agent's Stop: inherited,
17353
+ // they made the survey's run look like the user's, so Orca closed the pane and Herdr rebound
17354
+ // it to the survey's session (#6075).
17355
+ ...Object.fromEntries(Object.entries(process.env).filter(([k]) => !/^(ORCA|HERDR)_/.test(k))),
17351
17356
  // Anti-recursion: the survey's own agent session must not fire our hooks (session-start,
17352
17357
  // UserPromptSubmit/BeforeAgent, Stop/SessionEnd) or re-seed — see the HINDSIGHT_DISABLE_HOOKS
17353
17358
  // guard in hook.ts / retain-hook.ts / session-start.ts / runtime.ts.
@@ -17441,96 +17446,88 @@ function surveyAttempts(file3, sha) {
17441
17446
  async function startCodebaseSurvey(repoDir, opts = {}) {
17442
17447
  try {
17443
17448
  const spawnFn = opts.spawn ?? realSpawn5;
17444
- const resolveBin = opts.resolveBin ?? ((bin) => binOnPath(bin, { exts: [".exe"] }));
17449
+ const resolveBin = opts.resolveBin ?? ((bin2) => binOnPath(bin2, { exts: [".exe"] }));
17445
17450
  const mcpServerPath = opts.mcpServerPath ?? join11(dirname7(fileURLToPath4(import.meta.url)), "mcp-server.js");
17446
- const preferred = opts.harness ?? "claude-code";
17447
- const order = [
17448
- preferred,
17449
- "claude-code",
17450
- "codex",
17451
- "antigravity-cli",
17452
- "opencode"
17453
- ];
17454
- const seen = /* @__PURE__ */ new Set();
17455
- for (const harness of order) {
17456
- if (seen.has(harness)) continue;
17457
- seen.add(harness);
17458
- const name = resolveAgentBin(harness, opts.claudeBin);
17459
- const bin = resolveBin(name);
17460
- if (!bin) {
17461
- log.info("survey", `${harness}: ${name} not found, trying the next agent`);
17462
- continue;
17463
- }
17464
- if (harness === "opencode" && !(opts.opencodeDefinesAgent ?? opencodeCanDefineSurveyAgent)(bin)) {
17465
- log.info("survey", `${harness}: ${bin} cannot define the survey agent, trying the next`);
17466
- continue;
17467
- }
17468
- const plan = buildSurveyPlan(harness, bin, repoDir, {
17469
- model: opts.model,
17470
- budgetUsd: opts.budgetUsd,
17471
- mcpServerPath
17472
- });
17473
- const { cfg, bankId } = resolveHostConfig(harness, repoDir);
17474
- if (cfg.disabled) return false;
17475
- const key = createHash3("sha256").update(JSON.stringify([cfg.apiUrl.replace(/\/+$/, ""), cfg.apiToken ?? "", bankId])).digest("hex");
17476
- const leaseDir = opts.lease?.dir ?? join11(tmpdir2(), "hindsight-coding-agent", "surveys");
17477
- const lease = acquireLease(leaseDir, key, opts.lease?.staleMs ?? LEASE_STALE_MS);
17478
- if (!lease) return false;
17479
- const attemptsFile = join11(
17480
- leaseDir,
17481
- `attempts-${createHash3("sha256").update(JSON.stringify([key, repoDir])).digest("hex")}.json`
17482
- );
17483
- const attempts = opts.sha ? surveyAttempts(attemptsFile, opts.sha) : 0;
17484
- if (attempts >= SURVEY_MAX_ATTEMPTS) {
17485
- log.info("survey", `${attempts} surveys already launched at ${opts.sha}, skipping`);
17486
- releaseLease(lease);
17487
- return false;
17488
- }
17489
- const spec = {
17490
- lease,
17491
- bin: plan.bin,
17492
- args: plan.args,
17493
- ...opts.lease?.heartbeatMs ? { heartbeatMs: opts.lease.heartbeatMs } : {}
17494
- };
17495
- const supervisorPath = opts.supervisorPath ?? join11(dirname7(fileURLToPath4(import.meta.url)), "survey-supervisor.js");
17496
- return await new Promise((resolve4) => {
17497
- try {
17498
- const child = spawnFn("node", [supervisorPath], {
17499
- cwd: repoDir,
17500
- detached: true,
17501
- stdio: "ignore",
17502
- windowsHide: true,
17503
- env: { ...plan.env, [SURVEY_SPEC_ENV]: JSON.stringify(spec) }
17504
- });
17505
- let spawned = false;
17506
- child.on("error", (e) => {
17507
- if (spawned) return;
17508
- log.warn("survey", `survey supervisor failed to launch: ${describeError(e)}`);
17509
- releaseLease(lease);
17510
- resolve4(false);
17511
- });
17512
- child.once("spawn", () => {
17513
- spawned = true;
17514
- child.unref();
17515
- if (opts.sha) {
17516
- try {
17517
- writeFileSync3(
17518
- attemptsFile,
17519
- JSON.stringify({ sha: opts.sha, attempts: attempts + 1 }),
17520
- { mode: 384 }
17521
- );
17522
- } catch {
17523
- }
17524
- }
17525
- resolve4(true);
17526
- });
17527
- } catch (e) {
17451
+ const harness = opts.harness ?? "claude-code";
17452
+ const name = resolveAgentBin(harness, opts.claudeBin);
17453
+ if (!name) {
17454
+ log.info("survey", `${harness}: no headless survey for this agent, skipping the survey`);
17455
+ return false;
17456
+ }
17457
+ const bin = resolveBin(name);
17458
+ if (!bin) {
17459
+ log.info("survey", `${harness}: ${name} not found, skipping the survey`);
17460
+ return false;
17461
+ }
17462
+ if (harness === "opencode" && !(opts.opencodeDefinesAgent ?? opencodeCanDefineSurveyAgent)(bin)) {
17463
+ log.info("survey", `${harness}: ${bin} cannot define the survey agent, skipping the survey`);
17464
+ return false;
17465
+ }
17466
+ const plan = buildSurveyPlan(harness, bin, repoDir, {
17467
+ model: opts.model,
17468
+ budgetUsd: opts.budgetUsd,
17469
+ mcpServerPath
17470
+ });
17471
+ const { cfg, bankId } = resolveHostConfig(harness, repoDir);
17472
+ if (cfg.disabled) return false;
17473
+ const key = createHash3("sha256").update(JSON.stringify([cfg.apiUrl.replace(/\/+$/, ""), cfg.apiToken ?? "", bankId])).digest("hex");
17474
+ const leaseDir = opts.lease?.dir ?? join11(tmpdir2(), "hindsight-coding-agent", "surveys");
17475
+ const lease = acquireLease(leaseDir, key, opts.lease?.staleMs ?? LEASE_STALE_MS);
17476
+ if (!lease) return false;
17477
+ const attemptsFile = join11(
17478
+ leaseDir,
17479
+ `attempts-${createHash3("sha256").update(JSON.stringify([key, repoDir])).digest("hex")}.json`
17480
+ );
17481
+ const attempts = opts.sha ? surveyAttempts(attemptsFile, opts.sha) : 0;
17482
+ if (attempts >= SURVEY_MAX_ATTEMPTS) {
17483
+ log.info("survey", `${attempts} surveys already launched at ${opts.sha}, skipping`);
17484
+ releaseLease(lease);
17485
+ return false;
17486
+ }
17487
+ const spec = {
17488
+ lease,
17489
+ bin: plan.bin,
17490
+ args: plan.args,
17491
+ ...opts.lease?.heartbeatMs ? { heartbeatMs: opts.lease.heartbeatMs } : {}
17492
+ };
17493
+ const supervisorPath = opts.supervisorPath ?? join11(dirname7(fileURLToPath4(import.meta.url)), "survey-supervisor.js");
17494
+ return await new Promise((resolve4) => {
17495
+ try {
17496
+ const child = spawnFn("node", [supervisorPath], {
17497
+ cwd: repoDir,
17498
+ detached: true,
17499
+ stdio: "ignore",
17500
+ windowsHide: true,
17501
+ env: { ...plan.env, [SURVEY_SPEC_ENV]: JSON.stringify(spec) }
17502
+ });
17503
+ let spawned = false;
17504
+ child.on("error", (e) => {
17505
+ if (spawned) return;
17528
17506
  log.warn("survey", `survey supervisor failed to launch: ${describeError(e)}`);
17529
17507
  releaseLease(lease);
17530
17508
  resolve4(false);
17531
- }
17532
- });
17533
- }
17509
+ });
17510
+ child.once("spawn", () => {
17511
+ spawned = true;
17512
+ child.unref();
17513
+ if (opts.sha) {
17514
+ try {
17515
+ writeFileSync3(
17516
+ attemptsFile,
17517
+ JSON.stringify({ sha: opts.sha, attempts: attempts + 1 }),
17518
+ { mode: 384 }
17519
+ );
17520
+ } catch {
17521
+ }
17522
+ }
17523
+ resolve4(true);
17524
+ });
17525
+ } catch (e) {
17526
+ log.warn("survey", `survey supervisor failed to launch: ${describeError(e)}`);
17527
+ releaseLease(lease);
17528
+ resolve4(false);
17529
+ }
17530
+ });
17534
17531
  } catch {
17535
17532
  }
17536
17533
  return false;
@@ -18923,7 +18920,7 @@ var RuntimeCore = class {
18923
18920
  }
18924
18921
  if (output.context) blocks.push(output.context);
18925
18922
  if (output.notice) {
18926
- const preview = output.notice.replace(/\s+/g, " ").trim().slice(0, 140);
18923
+ const preview = output.notice.replace(/\x1b\[[0-9;]*m/g, "").replace(/\s+/g, " ").trim().slice(0, 140);
18927
18924
  log.info(this.harness, "reflect goal", { preview });
18928
18925
  this.notify?.("Hindsight \xB7 recalled past decisions", preview);
18929
18926
  }