opencode-swarm 7.18.0 → 7.18.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.
package/dist/cli/index.js CHANGED
@@ -34,7 +34,7 @@ var package_default;
34
34
  var init_package = __esm(() => {
35
35
  package_default = {
36
36
  name: "opencode-swarm",
37
- version: "7.18.0",
37
+ version: "7.18.1",
38
38
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
39
39
  main: "dist/index.js",
40
40
  types: "dist/index.d.ts",
package/dist/index.js CHANGED
@@ -33,7 +33,7 @@ var package_default;
33
33
  var init_package = __esm(() => {
34
34
  package_default = {
35
35
  name: "opencode-swarm",
36
- version: "7.18.0",
36
+ version: "7.18.1",
37
37
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
38
38
  main: "dist/index.js",
39
39
  types: "dist/index.d.ts",
@@ -26355,9 +26355,9 @@ async function getEvidenceTaskId(session, directory) {
26355
26355
  const primary = session.currentTaskId ?? session.lastCoderDelegationTaskId;
26356
26356
  if (primary)
26357
26357
  return primary;
26358
- if (session.taskWorkflowStates && session.taskWorkflowStates.size > 0) {
26359
- return session.taskWorkflowStates.keys().next().value ?? null;
26360
- }
26358
+ const onlyTaskId = getOnlyWorkflowTaskId(session);
26359
+ if (onlyTaskId)
26360
+ return onlyTaskId;
26361
26361
  try {
26362
26362
  if (typeof directory !== "string" || directory.length === 0) {
26363
26363
  return null;
@@ -26707,18 +26707,25 @@ function createDelegationGateHook(config2, directory) {
26707
26707
  const explicitEvidenceTaskId = extractTaskIdFromTaskArgs(mergedTaskArgs);
26708
26708
  const stageBEvidenceTaskId = gateForEvidence === "reviewer" || gateForEvidence === "test_engineer" || gateForEvidence === "adversarial_test_engineer" ? resolveScopedStageBTaskId(session, mergedTaskArgs) : null;
26709
26709
  const evidenceTaskId = stageBEvidenceTaskId ?? explicitEvidenceTaskId ?? await getEvidenceTaskId(session, directory);
26710
+ const gateAgents = [
26711
+ "reviewer",
26712
+ "test_engineer",
26713
+ "docs",
26714
+ "designer",
26715
+ "critic",
26716
+ "explorer",
26717
+ "sme"
26718
+ ];
26719
+ if (evidenceTaskId === null && gateAgents.includes(targetAgentForEvidence)) {
26720
+ session.pendingAdvisoryMessages ??= [];
26721
+ if (!session.pendingAdvisoryMessages.some((m) => m.includes("evidence-task-id-unresolved"))) {
26722
+ session.pendingAdvisoryMessages.push(`[evidence-task-id-unresolved] Gate evidence has NOT been written for one or more recent gate-agent dispatches because the current task id is unresolved. Call update_task_status(<task_id>, 'in_progress') BEFORE dispatching gate agents (e.g. reviewer/test_engineer). Most recent affected agent: ${targetAgentForEvidence}.`);
26723
+ }
26724
+ console.warn(`[delegation-gate] evidence-task-id-unresolved sessionID=${input.sessionID} subagentType=${targetAgentForEvidence} reason=evidence-task-id-unresolved`);
26725
+ }
26710
26726
  if (evidenceTaskId && typeof directory === "string") {
26711
26727
  const turbo = hasActiveTurboMode(input.sessionID);
26712
26728
  const parallelRuntime = resolveStandardParallelizationConfig(config2, directory);
26713
- const gateAgents = [
26714
- "reviewer",
26715
- "test_engineer",
26716
- "docs",
26717
- "designer",
26718
- "critic",
26719
- "explorer",
26720
- "sme"
26721
- ];
26722
26729
  if (gateAgents.includes(targetAgentForEvidence)) {
26723
26730
  const { recordGateEvidence: recordGateEvidence2 } = await Promise.resolve().then(() => (init_gate_evidence(), exports_gate_evidence));
26724
26731
  await recordGateEvidence2(directory, evidenceTaskId, gateForEvidence, input.sessionID, turbo, parallelRuntime.evidenceLockTimeoutMs);
@@ -26728,7 +26735,7 @@ function createDelegationGateHook(config2, directory) {
26728
26735
  }
26729
26736
  }
26730
26737
  } catch (err2) {
26731
- console.warn(`[delegation-gate] evidence recording failed: ${err2 instanceof Error ? err2.message : String(err2)}`);
26738
+ console.warn(`[delegation-gate] evidence recording failed reason=evidence-write-failed: ${err2 instanceof Error ? err2.message : String(err2)}`);
26732
26739
  }
26733
26740
  }
26734
26741
  if (storedArgs !== undefined) {
@@ -89503,6 +89510,7 @@ function verifyLeanTurboPhaseReady(directory, phase, sessionIDOrConfig, config3)
89503
89510
  }
89504
89511
 
89505
89512
  // src/tools/phase-complete.ts
89513
+ init_task_id();
89506
89514
  init_create_tool();
89507
89515
  init_resolve_working_directory();
89508
89516
  function safeWarn(message, error93) {
@@ -89510,6 +89518,15 @@ function safeWarn(message, error93) {
89510
89518
  console.warn(message, error93 instanceof Error ? error93.message : String(error93));
89511
89519
  } catch {}
89512
89520
  }
89521
+ function taskIdToPhase(taskId) {
89522
+ if (typeof taskId !== "string")
89523
+ return null;
89524
+ if (!isStrictTaskId(taskId))
89525
+ return null;
89526
+ const head = taskId.split(".")[0];
89527
+ const n = Number.parseInt(head, 10);
89528
+ return Number.isFinite(n) && n > 0 ? n : null;
89529
+ }
89513
89530
  function collectCrossSessionDispatchedAgents(phaseReferenceTimestamp, callerSessionId) {
89514
89531
  const agents = new Set;
89515
89532
  const contributorSessionIds = [];
@@ -90622,6 +90639,52 @@ Advisory notes: ${advisoryNotes.join("; ")}` : "";
90622
90639
  const oldPhase = contributorSession.lastPhaseCompletePhase;
90623
90640
  contributorSession.lastPhaseCompletePhase = phase;
90624
90641
  telemetry.phaseChanged(contributorSessionId, oldPhase ?? 0, phase);
90642
+ const currentTid = contributorSession.currentTaskId;
90643
+ if (currentTid) {
90644
+ const tp = taskIdToPhase(currentTid);
90645
+ if (tp !== null && tp <= phase) {
90646
+ contributorSession.currentTaskId = null;
90647
+ }
90648
+ }
90649
+ const lastCoderTid = contributorSession.lastCoderDelegationTaskId;
90650
+ if (lastCoderTid) {
90651
+ const tp = taskIdToPhase(lastCoderTid);
90652
+ if (tp !== null && tp <= phase) {
90653
+ contributorSession.lastCoderDelegationTaskId = null;
90654
+ }
90655
+ }
90656
+ const openStates = new Set([
90657
+ "coder_delegated",
90658
+ "pre_check_passed",
90659
+ "reviewer_run"
90660
+ ]);
90661
+ if (contributorSession.taskWorkflowStates instanceof Map) {
90662
+ for (const [taskId, state] of Array.from(contributorSession.taskWorkflowStates.entries())) {
90663
+ const tp = taskIdToPhase(taskId);
90664
+ if (tp === null || tp > phase)
90665
+ continue;
90666
+ if (openStates.has(state)) {
90667
+ console.warn(`[phase-complete] dropping open task state at phase boundary: taskId=${taskId} state=${state} phaseCompleted=${phase}`);
90668
+ }
90669
+ contributorSession.taskWorkflowStates.delete(taskId);
90670
+ }
90671
+ }
90672
+ if (contributorSession.stageBCompletion instanceof Map) {
90673
+ for (const taskId of Array.from(contributorSession.stageBCompletion.keys())) {
90674
+ const tp = taskIdToPhase(taskId);
90675
+ if (tp !== null && tp <= phase) {
90676
+ contributorSession.stageBCompletion.delete(taskId);
90677
+ }
90678
+ }
90679
+ }
90680
+ if (contributorSession.requiredStageBGates instanceof Map) {
90681
+ for (const taskId of Array.from(contributorSession.requiredStageBGates.keys())) {
90682
+ const tp = taskIdToPhase(taskId);
90683
+ if (tp !== null && tp <= phase) {
90684
+ contributorSession.requiredStageBGates.delete(taskId);
90685
+ }
90686
+ }
90687
+ }
90625
90688
  }
90626
90689
  }
90627
90690
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.18.0",
3
+ "version": "7.18.1",
4
4
  "description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",