@sideboard-ai/core 0.1.143 → 0.1.144

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.
@@ -453,7 +453,7 @@ async function continueSourceThread(threadId, prompt) {
453
453
  await continueOnReply(threadId, prompt);
454
454
  return;
455
455
  }
456
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-VIFXOHF4.js");
456
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-DB5ZSE6M.js");
457
457
  await getOrchestrator2().send(threadId, prompt);
458
458
  } catch {
459
459
  }
@@ -3219,6 +3219,16 @@ function shouldReadThreadToHealReconcile(eventType, lastCheckAt, now) {
3219
3219
  return true;
3220
3220
  }
3221
3221
 
3222
+ // src/orchestrator/setup-last-error.ts
3223
+ function shouldStampSetupLastError(opts) {
3224
+ if (opts.turnInFlight) return false;
3225
+ if (opts.status === "running") return false;
3226
+ return true;
3227
+ }
3228
+ function isStaleLastErrorDuringTurn(err) {
3229
+ return Boolean(err?.trim());
3230
+ }
3231
+
3222
3232
  // src/threads/fork-worktree.ts
3223
3233
  function requireThread2(idOrRef) {
3224
3234
  const thread = findThreadByRef(idOrRef) ?? null;
@@ -5913,7 +5923,7 @@ function formatScheduledPrompt(name, prompt) {
5913
5923
  ${prompt}`;
5914
5924
  }
5915
5925
  async function defaultDeps() {
5916
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-VIFXOHF4.js");
5926
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-DB5ZSE6M.js");
5917
5927
  const orch = getOrchestrator2();
5918
5928
  return {
5919
5929
  findThread: (id) => findThreadByRef(id),
@@ -6394,6 +6404,13 @@ var Orchestrator = class {
6394
6404
  const message = err instanceof Error ? err.message : String(err);
6395
6405
  if (/no setup script/i.test(message)) return;
6396
6406
  if (/already running/i.test(message)) return;
6407
+ const live = readThread(threadId);
6408
+ if (!shouldStampSetupLastError({
6409
+ turnInFlight: this.activeTurns.has(threadId) || this.startingTurns.has(threadId),
6410
+ status: live?.status
6411
+ })) {
6412
+ return;
6413
+ }
6397
6414
  updateThread(threadId, {
6398
6415
  lastError: `Setup failed: ${message}`
6399
6416
  });
@@ -6740,7 +6757,7 @@ var Orchestrator = class {
6740
6757
  )) {
6741
6758
  this.lastReconcileHealAt.set(threadId, now);
6742
6759
  const live = readThread(threadId);
6743
- if (live?.lastError?.includes("reconciled on startup") && (this.activeTurns.has(threadId) || this.startingTurns.has(threadId))) {
6760
+ if (isStaleLastErrorDuringTurn(live?.lastError) && (this.activeTurns.has(threadId) || this.startingTurns.has(threadId))) {
6744
6761
  setStatus(threadId, "running");
6745
6762
  this.emit({ type: "status_changed", threadId, status: "running" });
6746
6763
  }
@@ -7197,9 +7214,15 @@ var Orchestrator = class {
7197
7214
  );
7198
7215
  }
7199
7216
  if (setup.exitCode !== 0 && setup.exitCode !== null) {
7200
- updateThread(thread.id, {
7201
- lastError: `Setup exited ${setup.exitCode}`
7202
- });
7217
+ const live = readThread(thread.id);
7218
+ if (shouldStampSetupLastError({
7219
+ turnInFlight: this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id),
7220
+ status: live?.status
7221
+ })) {
7222
+ updateThread(thread.id, {
7223
+ lastError: `Setup exited ${setup.exitCode}`
7224
+ });
7225
+ }
7203
7226
  }
7204
7227
  this.emit({ type: "setup_finished", threadId: thread.id, exitCode: setup.exitCode });
7205
7228
  return { exitCode: setup.exitCode, source: setup.source };
@@ -388,7 +388,7 @@ async function continueSourceThread(threadId, prompt) {
388
388
  await continueOnReply(threadId, prompt);
389
389
  return;
390
390
  }
391
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-TDJZKQPT.js");
391
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-IQGVBBSH.js");
392
392
  await getOrchestrator2().send(threadId, prompt);
393
393
  } catch {
394
394
  }
@@ -3151,6 +3151,16 @@ function shouldReadThreadToHealReconcile(eventType, lastCheckAt, now) {
3151
3151
  return true;
3152
3152
  }
3153
3153
 
3154
+ // src/orchestrator/setup-last-error.ts
3155
+ function shouldStampSetupLastError(opts) {
3156
+ if (opts.turnInFlight) return false;
3157
+ if (opts.status === "running") return false;
3158
+ return true;
3159
+ }
3160
+ function isStaleLastErrorDuringTurn(err) {
3161
+ return Boolean(err?.trim());
3162
+ }
3163
+
3154
3164
  // src/threads/fork-worktree.ts
3155
3165
  function requireThread2(idOrRef) {
3156
3166
  const thread = findThreadByRef(idOrRef) ?? null;
@@ -5596,7 +5606,7 @@ function formatScheduledPrompt(name, prompt) {
5596
5606
  ${prompt}`;
5597
5607
  }
5598
5608
  async function defaultDeps() {
5599
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-TDJZKQPT.js");
5609
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-IQGVBBSH.js");
5600
5610
  const orch = getOrchestrator2();
5601
5611
  return {
5602
5612
  findThread: (id) => findThreadByRef(id),
@@ -6077,6 +6087,13 @@ var Orchestrator = class {
6077
6087
  const message = err instanceof Error ? err.message : String(err);
6078
6088
  if (/no setup script/i.test(message)) return;
6079
6089
  if (/already running/i.test(message)) return;
6090
+ const live = readThread(threadId);
6091
+ if (!shouldStampSetupLastError({
6092
+ turnInFlight: this.activeTurns.has(threadId) || this.startingTurns.has(threadId),
6093
+ status: live?.status
6094
+ })) {
6095
+ return;
6096
+ }
6080
6097
  updateThread(threadId, {
6081
6098
  lastError: `Setup failed: ${message}`
6082
6099
  });
@@ -6423,7 +6440,7 @@ var Orchestrator = class {
6423
6440
  )) {
6424
6441
  this.lastReconcileHealAt.set(threadId, now);
6425
6442
  const live = readThread(threadId);
6426
- if (live?.lastError?.includes("reconciled on startup") && (this.activeTurns.has(threadId) || this.startingTurns.has(threadId))) {
6443
+ if (isStaleLastErrorDuringTurn(live?.lastError) && (this.activeTurns.has(threadId) || this.startingTurns.has(threadId))) {
6427
6444
  setStatus(threadId, "running");
6428
6445
  this.emit({ type: "status_changed", threadId, status: "running" });
6429
6446
  }
@@ -6880,9 +6897,15 @@ var Orchestrator = class {
6880
6897
  );
6881
6898
  }
6882
6899
  if (setup.exitCode !== 0 && setup.exitCode !== null) {
6883
- updateThread(thread.id, {
6884
- lastError: `Setup exited ${setup.exitCode}`
6885
- });
6900
+ const live = readThread(thread.id);
6901
+ if (shouldStampSetupLastError({
6902
+ turnInFlight: this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id),
6903
+ status: live?.status
6904
+ })) {
6905
+ updateThread(thread.id, {
6906
+ lastError: `Setup exited ${setup.exitCode}`
6907
+ });
6908
+ }
6886
6909
  }
6887
6910
  this.emit({ type: "setup_finished", threadId: thread.id, exitCode: setup.exitCode });
6888
6911
  return { exitCode: setup.exitCode, source: setup.source };
package/dist/index.cjs CHANGED
@@ -15181,6 +15181,21 @@ var init_reconcile_heal = __esm({
15181
15181
  }
15182
15182
  });
15183
15183
 
15184
+ // src/orchestrator/setup-last-error.ts
15185
+ function shouldStampSetupLastError(opts) {
15186
+ if (opts.turnInFlight) return false;
15187
+ if (opts.status === "running") return false;
15188
+ return true;
15189
+ }
15190
+ function isStaleLastErrorDuringTurn(err) {
15191
+ return Boolean(err?.trim());
15192
+ }
15193
+ var init_setup_last_error = __esm({
15194
+ "src/orchestrator/setup-last-error.ts"() {
15195
+ "use strict";
15196
+ }
15197
+ });
15198
+
15184
15199
  // src/threads/fork-worktree.ts
15185
15200
  function requireThread2(idOrRef) {
15186
15201
  const thread = findThreadByRef(idOrRef) ?? null;
@@ -18085,6 +18100,7 @@ var init_orchestrator = __esm({
18085
18100
  init_repo_git_lock();
18086
18101
  init_turn_live();
18087
18102
  init_reconcile_heal();
18103
+ init_setup_last_error();
18088
18104
  init_request_review();
18089
18105
  init_fork_worktree();
18090
18106
  init_quota_failover();
@@ -18463,6 +18479,13 @@ var init_orchestrator = __esm({
18463
18479
  const message = err instanceof Error ? err.message : String(err);
18464
18480
  if (/no setup script/i.test(message)) return;
18465
18481
  if (/already running/i.test(message)) return;
18482
+ const live = readThread(threadId);
18483
+ if (!shouldStampSetupLastError({
18484
+ turnInFlight: this.activeTurns.has(threadId) || this.startingTurns.has(threadId),
18485
+ status: live?.status
18486
+ })) {
18487
+ return;
18488
+ }
18466
18489
  updateThread(threadId, {
18467
18490
  lastError: `Setup failed: ${message}`
18468
18491
  });
@@ -18809,7 +18832,7 @@ var init_orchestrator = __esm({
18809
18832
  )) {
18810
18833
  this.lastReconcileHealAt.set(threadId, now);
18811
18834
  const live = readThread(threadId);
18812
- if (live?.lastError?.includes("reconciled on startup") && (this.activeTurns.has(threadId) || this.startingTurns.has(threadId))) {
18835
+ if (isStaleLastErrorDuringTurn(live?.lastError) && (this.activeTurns.has(threadId) || this.startingTurns.has(threadId))) {
18813
18836
  setStatus(threadId, "running");
18814
18837
  this.emit({ type: "status_changed", threadId, status: "running" });
18815
18838
  }
@@ -19266,9 +19289,15 @@ var init_orchestrator = __esm({
19266
19289
  );
19267
19290
  }
19268
19291
  if (setup.exitCode !== 0 && setup.exitCode !== null) {
19269
- updateThread(thread.id, {
19270
- lastError: `Setup exited ${setup.exitCode}`
19271
- });
19292
+ const live = readThread(thread.id);
19293
+ if (shouldStampSetupLastError({
19294
+ turnInFlight: this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id),
19295
+ status: live?.status
19296
+ })) {
19297
+ updateThread(thread.id, {
19298
+ lastError: `Setup exited ${setup.exitCode}`
19299
+ });
19300
+ }
19272
19301
  }
19273
19302
  this.emit({ type: "setup_finished", threadId: thread.id, exitCode: setup.exitCode });
19274
19303
  return { exitCode: setup.exitCode, source: setup.source };
package/dist/index.js CHANGED
@@ -212,7 +212,7 @@ import {
212
212
  worktreeCleanupSettings,
213
213
  wrapReviewSkillMarkdown,
214
214
  writeWorktreeFile
215
- } from "./chunk-KP4OJUPH.js";
215
+ } from "./chunk-FGT26PJE.js";
216
216
  import {
217
217
  BRIGHTSY_MCP_ALLOWED_TOOLS,
218
218
  CLAUDE_MODEL_CATALOG,
@@ -14160,6 +14160,21 @@ var init_reconcile_heal = __esm({
14160
14160
  }
14161
14161
  });
14162
14162
 
14163
+ // src/orchestrator/setup-last-error.ts
14164
+ function shouldStampSetupLastError(opts) {
14165
+ if (opts.turnInFlight) return false;
14166
+ if (opts.status === "running") return false;
14167
+ return true;
14168
+ }
14169
+ function isStaleLastErrorDuringTurn(err) {
14170
+ return Boolean(err?.trim());
14171
+ }
14172
+ var init_setup_last_error = __esm({
14173
+ "src/orchestrator/setup-last-error.ts"() {
14174
+ "use strict";
14175
+ }
14176
+ });
14177
+
14163
14178
  // src/threads/fork-worktree.ts
14164
14179
  function requireThread2(idOrRef) {
14165
14180
  const thread = findThreadByRef(idOrRef) ?? null;
@@ -17356,6 +17371,7 @@ var init_orchestrator = __esm({
17356
17371
  init_repo_git_lock();
17357
17372
  init_turn_live();
17358
17373
  init_reconcile_heal();
17374
+ init_setup_last_error();
17359
17375
  init_request_review();
17360
17376
  init_fork_worktree();
17361
17377
  init_quota_failover();
@@ -17734,6 +17750,13 @@ var init_orchestrator = __esm({
17734
17750
  const message = err instanceof Error ? err.message : String(err);
17735
17751
  if (/no setup script/i.test(message)) return;
17736
17752
  if (/already running/i.test(message)) return;
17753
+ const live = readThread(threadId);
17754
+ if (!shouldStampSetupLastError({
17755
+ turnInFlight: this.activeTurns.has(threadId) || this.startingTurns.has(threadId),
17756
+ status: live?.status
17757
+ })) {
17758
+ return;
17759
+ }
17737
17760
  updateThread(threadId, {
17738
17761
  lastError: `Setup failed: ${message}`
17739
17762
  });
@@ -18080,7 +18103,7 @@ var init_orchestrator = __esm({
18080
18103
  )) {
18081
18104
  this.lastReconcileHealAt.set(threadId, now);
18082
18105
  const live = readThread(threadId);
18083
- if (live?.lastError?.includes("reconciled on startup") && (this.activeTurns.has(threadId) || this.startingTurns.has(threadId))) {
18106
+ if (isStaleLastErrorDuringTurn(live?.lastError) && (this.activeTurns.has(threadId) || this.startingTurns.has(threadId))) {
18084
18107
  setStatus(threadId, "running");
18085
18108
  this.emit({ type: "status_changed", threadId, status: "running" });
18086
18109
  }
@@ -18537,9 +18560,15 @@ var init_orchestrator = __esm({
18537
18560
  );
18538
18561
  }
18539
18562
  if (setup.exitCode !== 0 && setup.exitCode !== null) {
18540
- updateThread(thread.id, {
18541
- lastError: `Setup exited ${setup.exitCode}`
18542
- });
18563
+ const live = readThread(thread.id);
18564
+ if (shouldStampSetupLastError({
18565
+ turnInFlight: this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id),
18566
+ status: live?.status
18567
+ })) {
18568
+ updateThread(thread.id, {
18569
+ lastError: `Setup exited ${setup.exitCode}`
18570
+ });
18571
+ }
18543
18572
  }
18544
18573
  this.emit({ type: "setup_finished", threadId: thread.id, exitCode: setup.exitCode });
18545
18574
  return { exitCode: setup.exitCode, source: setup.source };
@@ -32,7 +32,7 @@ import {
32
32
  slackTokenFor,
33
33
  syncBoardPins,
34
34
  updateSchedule
35
- } from "../chunk-EAP4SMR3.js";
35
+ } from "../chunk-OLR4UPP7.js";
36
36
  import {
37
37
  listModelsForAgent,
38
38
  sideboardMcpProfile
@@ -4,7 +4,7 @@ import {
4
4
  isPidAlive,
5
5
  startOrchestration,
6
6
  waitForPidExit
7
- } from "./chunk-KP4OJUPH.js";
7
+ } from "./chunk-FGT26PJE.js";
8
8
  import "./chunk-VHTIHOHE.js";
9
9
  import "./chunk-KBWND62T.js";
10
10
  import "./chunk-M267JPEA.js";
@@ -6,7 +6,7 @@ import {
6
6
  isPidAlive,
7
7
  startOrchestration,
8
8
  waitForPidExit
9
- } from "./chunk-EAP4SMR3.js";
9
+ } from "./chunk-OLR4UPP7.js";
10
10
  import "./chunk-CG25RYQQ.js";
11
11
  import "./chunk-ED4UPEJX.js";
12
12
  import "./chunk-S42XV45P.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sideboard-ai/core",
3
- "version": "0.1.143",
3
+ "version": "0.1.144",
4
4
  "description": "Sideboard core — orchestration, agents, git worktrees, MCP server",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",