threadnote 1.4.0 → 1.4.1

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.
@@ -35689,6 +35689,9 @@ function commandResultFromExecFileCallback(params) {
35689
35689
  function defaultCommandTimeoutMs() {
35690
35690
  return positiveIntegerFromEnv("THREADNOTE_COMMAND_TIMEOUT_MS") ?? 10 * 60 * 1e3;
35691
35691
  }
35692
+ function reindexWaitTimeoutMs() {
35693
+ return positiveIntegerFromEnv("THREADNOTE_REINDEX_TIMEOUT_MS") ?? 12e4;
35694
+ }
35692
35695
  function defaultCommandMaxOutputBytes() {
35693
35696
  return positiveIntegerFromEnv("THREADNOTE_COMMAND_MAX_OUTPUT_BYTES") ?? 5 * 1024 * 1024;
35694
35697
  }
@@ -36290,7 +36293,7 @@ function readStringArray(object3, key) {
36290
36293
 
36291
36294
  // src/runtime.ts
36292
36295
  function withIdentity(config2, args) {
36293
- return [...args, "--account", config2.account, "--user", config2.user, "--agent-id", config2.agentId];
36296
+ return [...args, "--account", config2.account, "--user", config2.user];
36294
36297
  }
36295
36298
 
36296
36299
  // src/index_repair.ts
@@ -36334,7 +36337,11 @@ async function repairStaleRecallIndex(config2, ov, options = {}) {
36334
36337
  const result = await runCommand(
36335
36338
  ov,
36336
36339
  withIdentity(config2, ["reindex", target.uri, "--mode", "semantic_and_vectors", "--wait", "true"]),
36337
- { allowFailure: true }
36340
+ // Bound the wait: `ov reindex` has no --timeout, so a stuck/poisoned
36341
+ // semantic queue would block each target for the full 10-min command
36342
+ // timeout. A timed-out target counts as a failure and trips the
36343
+ // consecutive-failure stop instead of hanging the whole repair.
36344
+ { allowFailure: true, timeoutMs: reindexWaitTimeoutMs() }
36338
36345
  );
36339
36346
  if (result.exitCode === 0) {
36340
36347
  consecutiveFailures = 0;
@@ -38580,7 +38587,7 @@ async function refreshMemoryIndex(config2, ov, uri, options = {}) {
38580
38587
  const result = await runCommand(
38581
38588
  ov,
38582
38589
  withIdentity(config2, ["reindex", uri, "--mode", "vectors_only", "--wait", "true"]),
38583
- { allowFailure: true }
38590
+ { allowFailure: true, timeoutMs: reindexWaitTimeoutMs() }
38584
38591
  );
38585
38592
  if (result.exitCode === 0) {
38586
38593
  if (options.quiet !== true && result.stdout.trim()) {
@@ -40814,8 +40821,9 @@ async function runOpenVikingMcpTool(config2, toolName, args) {
40814
40821
  const transport = new StreamableHTTPClientTransport(new URL(config2.openVikingMcpUrl), {
40815
40822
  requestInit: {
40816
40823
  headers: {
40824
+ // OpenViking 0.4.x dropped agent_id as an identity input; only
40825
+ // account + user are honored (mirrors withIdentity in runtime.ts).
40817
40826
  "X-OpenViking-Account": config2.account,
40818
- "X-OpenViking-Agent": config2.agentId,
40819
40827
  "X-OpenViking-User": config2.user
40820
40828
  }
40821
40829
  }
@@ -3835,6 +3835,9 @@ function commandResultFromExecFileCallback(params) {
3835
3835
  function defaultCommandTimeoutMs() {
3836
3836
  return positiveIntegerFromEnv("THREADNOTE_COMMAND_TIMEOUT_MS") ?? 10 * 60 * 1e3;
3837
3837
  }
3838
+ function reindexWaitTimeoutMs() {
3839
+ return positiveIntegerFromEnv("THREADNOTE_REINDEX_TIMEOUT_MS") ?? 12e4;
3840
+ }
3838
3841
  function defaultCommandMaxOutputBytes() {
3839
3842
  return positiveIntegerFromEnv("THREADNOTE_COMMAND_MAX_OUTPUT_BYTES") ?? 5 * 1024 * 1024;
3840
3843
  }
@@ -7548,7 +7551,7 @@ function openVikingServerArgs(config) {
7548
7551
  return ["--config", (0, import_node_path4.join)(config.agentContextHome, "ov.conf"), "--host", config.host, "--port", String(config.port)];
7549
7552
  }
7550
7553
  function withIdentity(config, args) {
7551
- return [...args, "--account", config.account, "--user", config.user, "--agent-id", config.agentId];
7554
+ return [...args, "--account", config.account, "--user", config.user];
7552
7555
  }
7553
7556
  function renderTemplate(template, config, extras = {}) {
7554
7557
  let rendered = template.replaceAll("{{THREADNOTE_HOME}}", config.agentContextHome).replaceAll("{{OPENVIKING_ACCOUNT}}", config.account).replaceAll("{{OPENVIKING_AGENT_ID}}", config.agentId).replaceAll("{{OPENVIKING_HOST}}", config.host).replaceAll("{{OPENVIKING_PORT}}", String(config.port)).replaceAll("{{OPENVIKING_USER}}", config.user);
@@ -7602,7 +7605,11 @@ async function repairStaleRecallIndex(config, ov, options = {}) {
7602
7605
  const result = await runCommand(
7603
7606
  ov,
7604
7607
  withIdentity(config, ["reindex", target.uri, "--mode", "semantic_and_vectors", "--wait", "true"]),
7605
- { allowFailure: true }
7608
+ // Bound the wait: `ov reindex` has no --timeout, so a stuck/poisoned
7609
+ // semantic queue would block each target for the full 10-min command
7610
+ // timeout. A timed-out target counts as a failure and trips the
7611
+ // consecutive-failure stop instead of hanging the whole repair.
7612
+ { allowFailure: true, timeoutMs: reindexWaitTimeoutMs() }
7606
7613
  );
7607
7614
  if (result.exitCode === 0) {
7608
7615
  consecutiveFailures = 0;
@@ -10905,7 +10912,7 @@ async function refreshMemoryIndex(config, ov, uri, options = {}) {
10905
10912
  const result = await runCommand(
10906
10913
  ov,
10907
10914
  withIdentity(config, ["reindex", uri, "--mode", "vectors_only", "--wait", "true"]),
10908
- { allowFailure: true }
10915
+ { allowFailure: true, timeoutMs: reindexWaitTimeoutMs() }
10909
10916
  );
10910
10917
  if (result.exitCode === 0) {
10911
10918
  if (options.quiet !== true && result.stdout.trim()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "threadnote",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "type": "commonjs",
5
5
  "main": "dist/threadnote.cjs",
6
6
  "description": "Shared local context and handoffs for development agents",