opencode-swarm 7.28.1 → 7.28.2

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.28.1",
37
+ version: "7.28.2",
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",
@@ -5,6 +5,7 @@
5
5
  * Uses experimental.chat.messages.transform to provide non-blocking guidance.
6
6
  */
7
7
  import type { PluginConfig } from '../config';
8
+ import type { AgentSessionState } from '../state';
8
9
  import type { DelegationEnvelope, EnvelopeValidationResult } from '../types/delegation.js';
9
10
  /**
10
11
  * v6.33.1 CRIT-1: Fallback map for declared coder scope by taskId.
@@ -53,6 +54,26 @@ interface MessageWithParts {
53
54
  info: MessageInfo;
54
55
  parts: MessagePart[];
55
56
  }
57
+ declare function resolveDelegatedPlanTaskId(args: Record<string, unknown>, knownPlanTaskIds?: ReadonlySet<string>): string | null;
58
+ /**
59
+ * Resolves the correct task ID for evidence recording by chaining:
60
+ * 1. Explicit task_id in direct args (structured field)
61
+ * 2. Prompt-text extraction via resolveDelegatedPlanTaskId (plan-aware)
62
+ * 3. Session-state fallback via getEvidenceTaskId
63
+ *
64
+ * This fixes parallel evidence recording where multiple reviewer/test_engineer
65
+ * agents are dispatched for different tasks from the same architect session.
66
+ * Issue #970.
67
+ */
68
+ declare function resolveEvidenceTaskId(args: Record<string, unknown> | undefined, session: AgentSessionState, directory: string): Promise<string | null>;
69
+ /**
70
+ * _internals export for testing — do not use in production code.
71
+ * Exposes resolveEvidenceTaskId and resolveDelegatedPlanTaskId for unit testing.
72
+ */
73
+ export declare const _internals: {
74
+ resolveEvidenceTaskId: typeof resolveEvidenceTaskId;
75
+ resolveDelegatedPlanTaskId: typeof resolveDelegatedPlanTaskId;
76
+ };
56
77
  /**
57
78
  * Creates the experimental.chat.messages.transform hook for delegation gating.
58
79
  * Inspects coder delegations and warns when tasks are oversized or batched.
package/dist/index.js CHANGED
@@ -48,7 +48,7 @@ var package_default;
48
48
  var init_package = __esm(() => {
49
49
  package_default = {
50
50
  name: "opencode-swarm",
51
- version: "7.28.1",
51
+ version: "7.28.2",
52
52
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
53
53
  main: "dist/index.js",
54
54
  types: "dist/index.d.ts",
@@ -39012,6 +39012,24 @@ async function getEvidenceTaskId(session, directory) {
39012
39012
  }
39013
39013
  return null;
39014
39014
  }
39015
+ async function resolveEvidenceTaskId(args2, session, directory) {
39016
+ const rawTaskId = args2?.task_id;
39017
+ if (typeof rawTaskId === "string" && rawTaskId.length <= 20 && isStrictTaskId(rawTaskId.trim())) {
39018
+ return rawTaskId.trim();
39019
+ }
39020
+ if (args2) {
39021
+ try {
39022
+ const plan = await loadPlanJsonOnly(directory);
39023
+ if (plan) {
39024
+ const planTaskIds = new Set(plan.phases.flatMap((p) => p.tasks.map((t) => t.id)));
39025
+ const promptTaskId = resolveDelegatedPlanTaskId(args2, planTaskIds);
39026
+ if (promptTaskId)
39027
+ return promptTaskId;
39028
+ }
39029
+ } catch {}
39030
+ }
39031
+ return getEvidenceTaskId(session, directory);
39032
+ }
39015
39033
  function createDelegationGateHook(config2, directory) {
39016
39034
  const enabled = config2.hooks?.delegation_gate !== false;
39017
39035
  const delegationMaxChars = config2.hooks?.delegation_max_chars ?? 4000;
@@ -39253,8 +39271,8 @@ function createDelegationGateHook(config2, directory) {
39253
39271
  }
39254
39272
  if (typeof subagentType === "string") {
39255
39273
  try {
39256
- const rawTaskId = directArgs?.task_id;
39257
- const evidenceTaskId = typeof rawTaskId === "string" && rawTaskId.length <= 20 && isStrictTaskId(rawTaskId.trim()) ? rawTaskId.trim() : await getEvidenceTaskId(session, directory);
39274
+ const mergedArgs = { ...storedArgs ?? {}, ...directArgs };
39275
+ const evidenceTaskId = await resolveEvidenceTaskId(mergedArgs, session, directory);
39258
39276
  if (evidenceTaskId) {
39259
39277
  const turbo = hasActiveTurboMode(input.sessionID);
39260
39278
  const gateAgents = [
@@ -39376,8 +39394,7 @@ function createDelegationGateHook(config2, directory) {
39376
39394
  }
39377
39395
  }
39378
39396
  try {
39379
- const rawTaskId = directArgs?.task_id;
39380
- const evidenceTaskId = typeof rawTaskId === "string" && rawTaskId.length <= 20 && isStrictTaskId(rawTaskId.trim()) ? rawTaskId.trim() : await getEvidenceTaskId(session, directory);
39397
+ const evidenceTaskId = await resolveEvidenceTaskId(directArgs, session, directory);
39381
39398
  if (evidenceTaskId) {
39382
39399
  const turbo = hasActiveTurboMode(input.sessionID);
39383
39400
  if (hasReviewer) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.28.1",
3
+ "version": "7.28.2",
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",