opencode-multiagent 0.5.0 → 0.6.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.6.0](https://github.com/vaur94/opencode-multiagent/compare/v0.5.0...v0.6.0) (2026-03-15)
4
+
5
+
6
+ ### Features
7
+
8
+ * add plugin resilience and observability features (token tracking, retry/escalation, timeout, dependency graph, sibling findings, override validation) ([506db74](https://github.com/vaur94/opencode-multiagent/commit/506db749281cc5a1221a727384fa20c3bed1ca4c))
9
+
3
10
  ## [0.5.0](https://github.com/vaur94/opencode-multiagent/compare/v0.4.0...v0.5.0) (2026-03-15)
4
11
 
5
12
 
@@ -3,52 +3,102 @@
3
3
  "planner": {
4
4
  "model": "anthropic/claude-opus-4-6",
5
5
  "temperature": 0,
6
- "steps": 200
6
+ "steps": 200,
7
+ "top_p": 1,
8
+ "options": {},
9
+ "timeout_ms": 0,
10
+ "retry": 0,
11
+ "escalation_model": ""
7
12
  },
8
13
  "executor": {
9
14
  "model": "anthropic/claude-sonnet-4-6",
10
15
  "temperature": 0,
11
- "steps": 200
16
+ "steps": 200,
17
+ "top_p": 1,
18
+ "options": {},
19
+ "timeout_ms": 0,
20
+ "retry": 0,
21
+ "escalation_model": ""
12
22
  },
13
23
  "coder": {
14
24
  "model": "anthropic/claude-sonnet-4-6",
15
25
  "temperature": 0,
16
- "steps": 40
26
+ "steps": 40,
27
+ "top_p": 1,
28
+ "options": {},
29
+ "timeout_ms": 0,
30
+ "retry": 0,
31
+ "escalation_model": ""
17
32
  },
18
33
  "ui-coder": {
19
34
  "model": "anthropic/claude-sonnet-4-6",
20
35
  "temperature": 0,
21
- "steps": 40
36
+ "steps": 40,
37
+ "top_p": 1,
38
+ "options": {},
39
+ "timeout_ms": 0,
40
+ "retry": 0,
41
+ "escalation_model": ""
22
42
  },
23
43
  "sec-coder": {
24
44
  "model": "anthropic/claude-opus-4-6",
25
45
  "temperature": 0,
26
- "steps": 60
46
+ "steps": 60,
47
+ "top_p": 1,
48
+ "options": {},
49
+ "timeout_ms": 0,
50
+ "retry": 0,
51
+ "escalation_model": ""
27
52
  },
28
53
  "reviewer": {
29
54
  "model": "anthropic/claude-sonnet-4-6",
30
55
  "temperature": 0,
31
- "steps": 30
56
+ "steps": 30,
57
+ "top_p": 1,
58
+ "options": {},
59
+ "timeout_ms": 0,
60
+ "retry": 0,
61
+ "escalation_model": ""
32
62
  },
33
63
  "auditor": {
34
64
  "model": "anthropic/claude-opus-4-6",
35
65
  "temperature": 0,
36
- "steps": 40
66
+ "steps": 40,
67
+ "top_p": 1,
68
+ "options": {},
69
+ "timeout_ms": 0,
70
+ "retry": 0,
71
+ "escalation_model": ""
37
72
  },
38
73
  "scout": {
39
74
  "model": "anthropic/claude-sonnet-4-6",
40
75
  "temperature": 0,
41
- "steps": 30
76
+ "steps": 30,
77
+ "top_p": 1,
78
+ "options": {},
79
+ "timeout_ms": 0,
80
+ "retry": 0,
81
+ "escalation_model": ""
42
82
  },
43
83
  "docmaster": {
44
84
  "model": "anthropic/claude-sonnet-4-6",
45
85
  "temperature": 0,
46
- "steps": 30
86
+ "steps": 30,
87
+ "top_p": 1,
88
+ "options": {},
89
+ "timeout_ms": 0,
90
+ "retry": 0,
91
+ "escalation_model": ""
47
92
  },
48
93
  "brainstormer": {
49
94
  "model": "anthropic/claude-opus-4-6",
50
95
  "temperature": 0.3,
51
- "steps": 200
96
+ "steps": 200,
97
+ "top_p": 1,
98
+ "options": {},
99
+ "timeout_ms": 0,
100
+ "retry": 0,
101
+ "escalation_model": ""
52
102
  }
53
103
  },
54
104
  "mcpDefaults": {
@@ -34,9 +34,32 @@
34
34
  "steps": {
35
35
  "type": "number",
36
36
  "minimum": 1
37
+ },
38
+ "top_p": {
39
+ "type": "number",
40
+ "minimum": 0,
41
+ "maximum": 1
42
+ },
43
+ "options": {
44
+ "type": "object",
45
+ "description": "Provider-specific model options (e.g., thinking budget, reasoning mode).",
46
+ "additionalProperties": true
47
+ },
48
+ "timeout_ms": {
49
+ "type": "number",
50
+ "minimum": 0,
51
+ "description": "Absolute timeout in milliseconds for this agent's sessions. 0 = disabled."
52
+ },
53
+ "retry": {
54
+ "type": "number",
55
+ "minimum": 0,
56
+ "description": "Maximum retry attempts on failure. 0 = no retry."
57
+ },
58
+ "escalation_model": {
59
+ "type": "string",
60
+ "description": "Model to escalate to when retries are exhausted."
37
61
  }
38
- },
39
- "required": ["model"]
62
+ }
40
63
  }
41
64
  },
42
65
  "mcpDefaults": {
package/dist/index.js CHANGED
@@ -370,7 +370,7 @@ async function compileAgents(cfg, dirs, agentSettings = {}) {
370
370
  const overrides = agentSettings?.[name];
371
371
  if (overrides && typeof overrides === "object") {
372
372
  for (const [field, value] of Object.entries(overrides)) {
373
- if (["model", "temperature", "steps"].includes(field) && !explicitFields.has(field)) {
373
+ if (["model", "temperature", "steps", "top_p", "options", "timeout_ms", "retry", "escalation_model"].includes(field) && !explicitFields.has(field)) {
374
374
  target[field] = clone(value);
375
375
  }
376
376
  }
@@ -382,6 +382,15 @@ async function compileAgents(cfg, dirs, agentSettings = {}) {
382
382
  mcpRegistry.set(name, buildMcpPermissionRegistry(perm));
383
383
  taskRouting.set(name, buildTaskRoutingAllowSet(perm));
384
384
  }
385
+ for (const key of Object.keys(agentSettings)) {
386
+ if (!defs.has(key)) {
387
+ await note("config_warning", {
388
+ observation: true,
389
+ warning: "unknown_agent_override",
390
+ agent: key
391
+ });
392
+ }
393
+ }
385
394
  return { mcpRegistry, taskRouting };
386
395
  }
387
396
  var isTaskRoutingAllowed = (agent, target, routing) => {
@@ -835,7 +844,10 @@ var createSupervisionController = ({
835
844
  lastActivity: Date.now(),
836
845
  remindedAt: 0,
837
846
  lastToolErrorAt: 0,
838
- hasUnverifiedEdits: false
847
+ hasUnverifiedEdits: false,
848
+ startedAt: Date.now(),
849
+ timeoutMs: 0,
850
+ timeoutNotifiedAt: 0
839
851
  });
840
852
  tracker.enforceLimit();
841
853
  await note("supervision", { event: "child_tracked", parentID, childID });
@@ -887,6 +899,26 @@ var createSupervisionController = ({
887
899
  childID: sessionID,
888
900
  agentName: info.agentName
889
901
  });
902
+ if (info.timeoutMs > 0 && now - info.startedAt > info.timeoutMs && info.timeoutNotifiedAt === 0) {
903
+ info.timeoutNotifiedAt = now;
904
+ const timeoutText = `[opencode-multiagent supervision] Child session ${sessionID} ` + `(agent: ${info.agentName ?? "unknown"}) exceeded its timeout of ${info.timeoutMs}ms ` + `(elapsed: ${now - info.startedAt}ms). Consider terminating or investigating.`;
905
+ try {
906
+ if (client.session?.prompt) {
907
+ await client.session.prompt({
908
+ path: { id: info.parentID },
909
+ body: { parts: [{ type: "text", text: timeoutText }], noReply: false }
910
+ });
911
+ }
912
+ } catch {}
913
+ await note("agent_timeout", compact({
914
+ observation: true,
915
+ parentID: info.parentID,
916
+ childID: sessionID,
917
+ agentName: info.agentName,
918
+ timeoutMs: info.timeoutMs,
919
+ elapsed: now - info.startedAt
920
+ }));
921
+ }
890
922
  return;
891
923
  }
892
924
  };
@@ -903,12 +935,18 @@ var createSupervisionController = ({
903
935
  const getActiveChildCount = (parentID) => {
904
936
  return childMap.get(parentID)?.size ?? 0;
905
937
  };
938
+ const setSessionTimeout = (sessionID, timeoutMs) => {
939
+ const info = tracker.entries.get(sessionID);
940
+ if (info)
941
+ info.timeoutMs = timeoutMs;
942
+ };
906
943
  return {
907
944
  handleSupervision,
908
945
  cleanup: tracker.cleanup,
909
946
  recordToolError,
910
947
  recordVerification,
911
948
  getActiveChildCount,
949
+ setSessionTimeout,
912
950
  getChildInfo(sessionID) {
913
951
  return tracker.entries.get(sessionID);
914
952
  },
@@ -1016,6 +1054,9 @@ var createTaskManager = (projectRoot) => {
1016
1054
  assignedAgent: input.assignedAgent,
1017
1055
  createdBy: input.createdBy,
1018
1056
  dependencies: input.dependencies ?? [],
1057
+ retryCount: 0,
1058
+ maxRetries: input.maxRetries ?? 0,
1059
+ escalationModel: input.escalationModel,
1019
1060
  createdAt: Date.now(),
1020
1061
  updatedAt: Date.now()
1021
1062
  };
@@ -1041,6 +1082,8 @@ var createTaskManager = (projectRoot) => {
1041
1082
  task.result = input.result;
1042
1083
  if (input.assignedAgent !== undefined)
1043
1084
  task.assignedAgent = input.assignedAgent;
1085
+ if (input.findings !== undefined)
1086
+ task.findings = input.findings;
1044
1087
  task.updatedAt = Date.now();
1045
1088
  schedulePersist();
1046
1089
  return task;
@@ -1067,7 +1110,10 @@ var createTaskManager = (projectRoot) => {
1067
1110
  const active = [...tasks.values()].filter((t) => t.status === "pending" || t.status === "claimed" || t.status === "in_progress");
1068
1111
  if (active.length === 0)
1069
1112
  return "";
1070
- const lines = active.slice(0, 10).map((t) => `- [${t.status}] ${t.title}${t.assignedAgent ? ` (${t.assignedAgent})` : ""}`);
1113
+ const lines = active.slice(0, 10).map((t) => {
1114
+ const depNote = t.dependencies.length > 0 ? areDependenciesMet(t.id).met ? " [deps:ok]" : ` [blocked:${areDependenciesMet(t.id).unmet.join(",")}]` : "";
1115
+ return `- [${t.status}] ${t.title}${t.assignedAgent ? ` (${t.assignedAgent})` : ""}${depNote}`;
1116
+ });
1071
1117
  return `Active tasks (${active.length}):
1072
1118
  ${lines.join(`
1073
1119
  `)}`;
@@ -1081,7 +1127,70 @@ ${lines.join(`
1081
1127
  schedulePersist();
1082
1128
  return true;
1083
1129
  };
1084
- return { create, update, get, list, load, getActiveSummary, linkSession };
1130
+ const getSiblingFindings = (taskID) => {
1131
+ const task = tasks.get(taskID);
1132
+ if (!task?.createdBy)
1133
+ return "";
1134
+ const siblings = [...tasks.values()].filter((t) => t.id !== taskID && t.status === "completed" && t.findings && t.createdBy === task.createdBy);
1135
+ if (siblings.length === 0)
1136
+ return "";
1137
+ return siblings.slice(0, 5).map((t) => `- [${t.id}] ${t.title}: ${t.findings.slice(0, 200)}`).join(`
1138
+ `);
1139
+ };
1140
+ const getReadyTasks = () => {
1141
+ return [...tasks.values()].filter((t) => {
1142
+ if (t.status !== "pending")
1143
+ return false;
1144
+ if (t.dependencies.length === 0)
1145
+ return true;
1146
+ return areDependenciesMet(t.id).met;
1147
+ });
1148
+ };
1149
+ const getDependentsOf = (taskID) => {
1150
+ return [...tasks.values()].filter((t) => t.dependencies.includes(taskID));
1151
+ };
1152
+ const listWithDepInfo = (filter) => {
1153
+ return list(filter).map((task) => {
1154
+ const { met, unmet } = areDependenciesMet(task.id);
1155
+ return { ...task, depsMet: met, unmetDeps: unmet };
1156
+ });
1157
+ };
1158
+ const shouldRetry = (taskID) => {
1159
+ const task = tasks.get(taskID);
1160
+ if (!task)
1161
+ return { retry: false, escalate: false };
1162
+ if (task.retryCount < task.maxRetries)
1163
+ return { retry: true, escalate: false };
1164
+ if (task.escalationModel)
1165
+ return { retry: false, escalate: true, model: task.escalationModel };
1166
+ return { retry: false, escalate: false };
1167
+ };
1168
+ const incrementRetry = (taskID) => {
1169
+ const task = tasks.get(taskID);
1170
+ if (!task)
1171
+ return { error: `Task ${taskID} not found` };
1172
+ task.retryCount += 1;
1173
+ task.status = "pending";
1174
+ task.result = (task.result ? task.result + " | " : "") + `Retry #${task.retryCount}`;
1175
+ task.updatedAt = Date.now();
1176
+ schedulePersist();
1177
+ return task;
1178
+ };
1179
+ return {
1180
+ create,
1181
+ update,
1182
+ get,
1183
+ list,
1184
+ load,
1185
+ getActiveSummary,
1186
+ linkSession,
1187
+ getSiblingFindings,
1188
+ getReadyTasks,
1189
+ getDependentsOf,
1190
+ listWithDepInfo,
1191
+ shouldRetry,
1192
+ incrementRetry
1193
+ };
1085
1194
  };
1086
1195
 
1087
1196
  // src/opencode-multiagent/telemetry.ts
@@ -1106,6 +1215,8 @@ var createTelemetryController = ({ flags }) => {
1106
1215
  filesEdited: 0,
1107
1216
  tasksDispatched: 0,
1108
1217
  permissionDenied: 0,
1218
+ inputTokens: 0,
1219
+ outputTokens: 0,
1109
1220
  flushed: false,
1110
1221
  ...extra
1111
1222
  });
@@ -1152,6 +1263,15 @@ var createTelemetryController = ({ flags }) => {
1152
1263
  return;
1153
1264
  state.permissionDenied += 1;
1154
1265
  },
1266
+ trackTokenUsage(sessionID, usage, extra) {
1267
+ const state = ensureSession(sessionID, extra);
1268
+ if (!state)
1269
+ return;
1270
+ if (typeof usage.inputTokens === "number")
1271
+ state.inputTokens += usage.inputTokens;
1272
+ if (typeof usage.outputTokens === "number")
1273
+ state.outputTokens += usage.outputTokens;
1274
+ },
1155
1275
  async flushSession(sessionID, reason = "session_deleted") {
1156
1276
  const state = tracker.entries.get(sessionID);
1157
1277
  if (!state || state.flushed)
@@ -1169,6 +1289,8 @@ var createTelemetryController = ({ flags }) => {
1169
1289
  files_edited: state.filesEdited,
1170
1290
  tasks_dispatched: state.tasksDispatched,
1171
1291
  permission_denied: state.permissionDenied,
1292
+ input_tokens: state.inputTokens,
1293
+ output_tokens: state.outputTokens,
1172
1294
  reason
1173
1295
  });
1174
1296
  },
@@ -1191,7 +1313,9 @@ var createTaskTools = (taskManager, taskManagerReady, correlation, quality, flag
1191
1313
  description: pluginTool.schema.string().describe("Detailed description of what needs to be done"),
1192
1314
  assignedAgent: pluginTool.schema.string().optional().describe("Name of the agent to assign this task to"),
1193
1315
  dependencies: pluginTool.schema.array(pluginTool.schema.string()).optional().describe("IDs of tasks this task depends on"),
1194
- priority: pluginTool.schema.enum(["high", "medium", "low"]).optional().describe("Task priority: high, medium, or low")
1316
+ priority: pluginTool.schema.enum(["high", "medium", "low"]).optional().describe("Task priority: high, medium, or low"),
1317
+ maxRetries: pluginTool.schema.number().optional().describe("Maximum retry attempts on failure. 0 = no retry."),
1318
+ escalationModel: pluginTool.schema.string().optional().describe("Model to escalate to when retries are exhausted (e.g., anthropic/claude-opus-4-6)")
1195
1319
  },
1196
1320
  async execute(args, ctx) {
1197
1321
  await taskManagerReady;
@@ -1235,6 +1359,7 @@ var createTaskTools = (taskManager, taskManagerReady, correlation, quality, flag
1235
1359
  taskID: pluginTool.schema.string().describe("ID of the task to update"),
1236
1360
  status: pluginTool.schema.enum(["pending", "claimed", "in_progress", "completed", "failed", "blocked"]).describe("New status for the task"),
1237
1361
  result: pluginTool.schema.string().optional().describe("Result summary or notes"),
1362
+ findings: pluginTool.schema.string().optional().describe("Key findings or output summary from this task for sibling context sharing"),
1238
1363
  force: pluginTool.schema.boolean().optional().describe("Force completion even without quality evidence (bypass quality gate)")
1239
1364
  },
1240
1365
  async execute(args, ctx) {
@@ -1263,7 +1388,7 @@ var createTaskTools = (taskManager, taskManagerReady, correlation, quality, flag
1263
1388
  agent: ctx.agent
1264
1389
  });
1265
1390
  }
1266
- return JSON.stringify(taskManager.update(args.taskID, { status: args.status, result: args.result }));
1391
+ return JSON.stringify(taskManager.update(args.taskID, { status: args.status, result: args.result, findings: args.findings }));
1267
1392
  }
1268
1393
  }),
1269
1394
  task_get: pluginTool({
@@ -1284,7 +1409,15 @@ var createTaskTools = (taskManager, taskManagerReady, correlation, quality, flag
1284
1409
  },
1285
1410
  async execute(args) {
1286
1411
  await taskManagerReady;
1287
- return JSON.stringify(taskManager.list(args));
1412
+ return JSON.stringify(taskManager.listWithDepInfo(args));
1413
+ }
1414
+ }),
1415
+ task_ready: pluginTool({
1416
+ description: "List tasks whose dependencies are all met and are ready to be dispatched",
1417
+ args: {},
1418
+ async execute() {
1419
+ await taskManagerReady;
1420
+ return JSON.stringify(taskManager.getReadyTasks());
1288
1421
  }
1289
1422
  })
1290
1423
  });
@@ -1367,7 +1500,17 @@ var createPluginHooks = ({
1367
1500
  const notifyParentOnChildCompletion = async (childSessionID, parentSessionID, agentName, taskLabel) => {
1368
1501
  const agentLabel = agentName ? ` (agent: ${agentName})` : "";
1369
1502
  const taskInfo = taskLabel ? `, task ${taskLabel}` : "";
1370
- const text2 = `Child session ${childSessionID}${agentLabel}${taskInfo} has completed. ` + "Review its output and proceed with the next task.";
1503
+ let siblingContext = "";
1504
+ if (taskLabel) {
1505
+ const findings = taskManager.getSiblingFindings(taskLabel);
1506
+ if (findings) {
1507
+ siblingContext = `
1508
+
1509
+ Completed sibling findings:
1510
+ ${findings}`;
1511
+ }
1512
+ }
1513
+ const text2 = `Child session ${childSessionID}${agentLabel}${taskInfo} has completed. ` + `Review its output and proceed with the next task.${siblingContext}`;
1371
1514
  try {
1372
1515
  if (client.session?.prompt) {
1373
1516
  await client.session.prompt({
@@ -1460,6 +1603,13 @@ var createPluginHooks = ({
1460
1603
  parent_agent: parent.agent,
1461
1604
  child_sessionID: childID
1462
1605
  });
1606
+ const childAgentName = agentHint ?? (typeof props.info?.agent === "string" ? props.info.agent : undefined);
1607
+ if (childAgentName && childID) {
1608
+ const agentCfg = agentSettings?.[childAgentName];
1609
+ if (agentCfg && typeof agentCfg === "object" && typeof agentCfg.timeout_ms === "number") {
1610
+ supervision.setSessionTimeout(childID, agentCfg.timeout_ms);
1611
+ }
1612
+ }
1463
1613
  }
1464
1614
  } else if (type === "message.updated") {
1465
1615
  const sessionID = typeof props.info?.sessionID === "string" ? props.info.sessionID : undefined;
@@ -1467,6 +1617,15 @@ var createPluginHooks = ({
1467
1617
  if (sessionID && agent) {
1468
1618
  rememberSession(sessionID, { agent });
1469
1619
  }
1620
+ if (sessionID) {
1621
+ const usage = props.info?.usage ?? props.usage ?? props.metadata?.usage;
1622
+ if (usage && typeof usage === "object") {
1623
+ telemetry.trackTokenUsage(sessionID, {
1624
+ inputTokens: typeof usage.inputTokens === "number" ? usage.inputTokens : typeof usage.input_tokens === "number" ? usage.input_tokens : undefined,
1625
+ outputTokens: typeof usage.outputTokens === "number" ? usage.outputTokens : typeof usage.output_tokens === "number" ? usage.output_tokens : undefined
1626
+ });
1627
+ }
1628
+ }
1470
1629
  } else if (type === "session.deleted") {
1471
1630
  const sessionID = typeof props.info?.id === "string" ? props.info.id : typeof props.sessionID === "string" ? props.sessionID : undefined;
1472
1631
  if (sessionID) {
@@ -1490,6 +1649,63 @@ var createPluginHooks = ({
1490
1649
  childSessionID: sessionID,
1491
1650
  autoStatus
1492
1651
  });
1652
+ if (autoStatus === "failed" && flags.task_lifecycle) {
1653
+ const retryInfo = taskManager.shouldRetry(link.taskID);
1654
+ if (retryInfo.retry) {
1655
+ const retriedTask = taskManager.incrementRetry(link.taskID);
1656
+ if (!("error" in retriedTask)) {
1657
+ await note("task_retry", {
1658
+ observation: true,
1659
+ taskID: link.taskID,
1660
+ retryCount: retriedTask.retryCount,
1661
+ maxRetries: retriedTask.maxRetries
1662
+ });
1663
+ if (childInfo?.parentID) {
1664
+ const retryText = `[opencode-multiagent retry] Task ${link.taskID} failed and has been reset to pending ` + `(retry ${retriedTask.retryCount}/${retriedTask.maxRetries}). Re-dispatch when ready.`;
1665
+ try {
1666
+ if (client.session?.prompt) {
1667
+ await client.session.prompt({
1668
+ path: { id: childInfo.parentID },
1669
+ body: { parts: [{ type: "text", text: retryText }], noReply: false }
1670
+ });
1671
+ }
1672
+ } catch {}
1673
+ }
1674
+ correlation.removeLink(sessionID);
1675
+ return;
1676
+ }
1677
+ } else if (retryInfo.escalate && retryInfo.model) {
1678
+ taskManager.update(link.taskID, {
1679
+ status: "pending",
1680
+ result: `Escalated to ${retryInfo.model} after exhausting retries`
1681
+ });
1682
+ await note("task_escalation", {
1683
+ observation: true,
1684
+ taskID: link.taskID,
1685
+ escalationModel: retryInfo.model
1686
+ });
1687
+ if (childInfo?.parentID) {
1688
+ const escalateText = `[opencode-multiagent escalation] Task ${link.taskID} exhausted retries. ` + `Re-dispatch with model override: ${retryInfo.model}.`;
1689
+ try {
1690
+ if (client.session?.prompt) {
1691
+ await client.session.prompt({
1692
+ path: { id: childInfo.parentID },
1693
+ body: { parts: [{ type: "text", text: escalateText }], noReply: false }
1694
+ });
1695
+ }
1696
+ } catch {}
1697
+ }
1698
+ correlation.removeLink(sessionID);
1699
+ return;
1700
+ }
1701
+ }
1702
+ if (autoStatus === "completed") {
1703
+ const dependents = taskManager.getDependentsOf(link.taskID);
1704
+ const nowReady = dependents.filter((t) => t.status === "pending" && taskManager.getReadyTasks().some((r) => r.id === t.id));
1705
+ if (nowReady.length > 0) {
1706
+ taskLabel = `${link.taskID} [unblocked: ${nowReady.map((t) => t.id).join(", ")}]`;
1707
+ }
1708
+ }
1493
1709
  }
1494
1710
  if (link)
1495
1711
  correlation.removeLink(sessionID);
@@ -1523,6 +1739,16 @@ var createPluginHooks = ({
1523
1739
  agent: label(input.agent),
1524
1740
  model: label(input.model, ["id", "name", "modelID"])
1525
1741
  });
1742
+ const agentName = label(input.agent);
1743
+ if (agentName && agentSettings?.[agentName]) {
1744
+ const settings = agentSettings[agentName];
1745
+ if (typeof settings.top_p === "number") {
1746
+ output.topP = settings.top_p;
1747
+ }
1748
+ if (settings.options && typeof settings.options === "object") {
1749
+ output.options = { ...output.options, ...settings.options };
1750
+ }
1751
+ }
1526
1752
  if (!flags.observation)
1527
1753
  return;
1528
1754
  const marks = [];
@@ -1 +1 @@
1
- {"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../../src/opencode-multiagent/compiler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,KAAK,YAAY,GAAG,aAAa,GAAG;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACxC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;CAC5B,CAAC;AAWF,KAAK,mBAAmB,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AA2BpD,KAAK,mBAAmB,GAAG;IAC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,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5F,CAAC;AAGF,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAezC,eAAO,MAAM,iBAAiB,GAAI,gDAK/B;IAGD,MAAM,EAAE,GAAG,CAAC;IACZ,KAAK,EAAE,aAAa,CAAC;IACrB,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,KAAG,aAgrBH,CAAC"}
@@ -6,6 +6,9 @@ type ChildInfo = {
6
6
  remindedAt: number;
7
7
  lastToolErrorAt: number;
8
8
  hasUnverifiedEdits: boolean;
9
+ startedAt: number;
10
+ timeoutMs: number;
11
+ timeoutNotifiedAt: number;
9
12
  };
10
13
  export declare const createSupervisionController: ({ flags, client, }: {
11
14
  flags: Record<string, any>;
@@ -19,6 +22,7 @@ export declare const createSupervisionController: ({ flags, client, }: {
19
22
  recordToolError: (sessionID: string) => void;
20
23
  recordVerification: (sessionID: string) => void;
21
24
  getActiveChildCount: (parentID: string) => number;
25
+ setSessionTimeout: (sessionID: string, timeoutMs: number) => void;
22
26
  getChildInfo(sessionID: string): ChildInfo | undefined;
23
27
  getParentID(sessionID: string): string | undefined;
24
28
  };
@@ -1 +1 @@
1
- {"version":3,"file":"supervision.d.ts","sourceRoot":"","sources":["../../src/opencode-multiagent/supervision.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,KAAK,SAAS,GAAG;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAA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;4BAY5C,MAAM,GAAG,SAAS,GAAG,SAAS;2BAG/B,MAAM,GAAG,MAAM,GAAG,SAAS;CAIrD,CAAC"}
@@ -11,7 +11,11 @@ type Task = {
11
11
  createdBy?: string;
12
12
  dependencies: string[];
13
13
  result?: string;
14
+ findings?: string;
14
15
  sessionID?: string;
16
+ retryCount: number;
17
+ maxRetries: number;
18
+ escalationModel?: string;
15
19
  createdAt: number;
16
20
  updatedAt: number;
17
21
  };
@@ -22,11 +26,14 @@ type CreateTaskInput = {
22
26
  dependencies?: string[];
23
27
  priority?: TaskPriority;
24
28
  createdBy?: string;
29
+ maxRetries?: number;
30
+ escalationModel?: string;
25
31
  };
26
32
  type UpdateTaskInput = {
27
33
  status?: TaskStatus;
28
34
  result?: string;
29
35
  assignedAgent?: string;
36
+ findings?: string;
30
37
  };
31
38
  type TaskFilter = {
32
39
  status?: string;
@@ -48,6 +55,21 @@ export declare const createTaskManager: (projectRoot?: string) => {
48
55
  load: () => Promise<void>;
49
56
  getActiveSummary: () => string;
50
57
  linkSession: (taskID: string, sessionID: string) => boolean;
58
+ getSiblingFindings: (taskID: string) => string;
59
+ getReadyTasks: () => Task[];
60
+ getDependentsOf: (taskID: string) => Task[];
61
+ listWithDepInfo: (filter?: TaskFilter) => Array<Task & {
62
+ depsMet: boolean;
63
+ unmetDeps: string[];
64
+ }>;
65
+ shouldRetry: (taskID: string) => {
66
+ retry: boolean;
67
+ escalate: boolean;
68
+ model?: string;
69
+ };
70
+ incrementRetry: (taskID: string) => Task | {
71
+ error: string;
72
+ };
51
73
  };
52
74
  export type TaskManager = ReturnType<typeof createTaskManager>;
53
75
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"task-manager.d.ts","sourceRoot":"","sources":["../../src/opencode-multiagent/task-manager.ts"],"names":[],"mappings":"AAGA,KAAK,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;AAC7F,KAAK,YAAY,GAA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AO,iBAAiB,CAAC,CAAC"}
@@ -9,6 +9,8 @@ type SessionTelemetryState = {
9
9
  filesEdited: number;
10
10
  tasksDispatched: number;
11
11
  permissionDenied: number;
12
+ inputTokens: number;
13
+ outputTokens: number;
12
14
  flushed: boolean;
13
15
  };
14
16
  export declare const createTelemetryController: ({ flags }: {
@@ -21,6 +23,10 @@ export declare const createTelemetryController: ({ flags }: {
21
23
  trackToolError(sessionID: string | undefined, extra?: Partial<SessionTelemetryState>): void;
22
24
  trackTaskDispatch(sessionID: string | undefined, extra?: Partial<SessionTelemetryState>): void;
23
25
  trackPermissionDenied(sessionID: string | undefined, extra?: Partial<SessionTelemetryState>): void;
26
+ trackTokenUsage(sessionID: string | undefined, usage: {
27
+ inputTokens?: number;
28
+ outputTokens?: number;
29
+ }, extra?: Partial<SessionTelemetryState>): void;
24
30
  flushSession(sessionID: string, reason?: string): Promise<void>;
25
31
  flushAll(): Promise<void>;
26
32
  };
@@ -1 +1 @@
1
- {"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/opencode-multiagent/telemetry.ts"],"names":[],"mappings":"AAGA,KAAK,qBAAqB,GAAG;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,WAAW;IAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE;;+BAwClE,MAAM,GAAG,SAAS,UACtB,OAAO,CAAC,qBAAqB,CAAC,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,IAAI;8BAMM,MAAM,GAAG,SAAS,UACtB,OAAO,CAAC,qBAAqB,CAAC,GACpC,IAAI;iCAMM,MAAM,GAAG,SAAS,UACtB,OAAO,CAAC,qBAAqB,CAAC,GACpC,IAAI;qCAMM,MAAM,GAAG,SAAS,UACtB,OAAO,CAAC,qBAAqB,CAAC,GACpC,IAAI;+BAMM,MAAM,GAAG,SAAS,SACtB;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,UAC9C,OAAO,CAAC,qBAAqB,CAAC,GACrC,IAAI;4BAMuB,MAAM,oBAA+B,OAAO,CAAC,IAAI,CAAC;gBAqB9D,OAAO,CAAC,IAAI,CAAC;CAOlC,CAAC"}
@@ -20,6 +20,8 @@ export declare const createTaskTools: (taskManager: TaskManager, taskManagerRead
20
20
  medium: "medium";
21
21
  low: "low";
22
22
  }>>;
23
+ maxRetries: import("zod").ZodOptional<import("zod").ZodNumber>;
24
+ escalationModel: import("zod").ZodOptional<import("zod").ZodString>;
23
25
  };
24
26
  execute(args: {
25
27
  title: string;
@@ -27,6 +29,8 @@ export declare const createTaskTools: (taskManager: TaskManager, taskManagerRead
27
29
  assignedAgent?: string | undefined;
28
30
  dependencies?: string[] | undefined;
29
31
  priority?: "high" | "medium" | "low" | undefined;
32
+ maxRetries?: number | undefined;
33
+ escalationModel?: string | undefined;
30
34
  }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
31
35
  };
32
36
  task_dispatch: {
@@ -53,12 +57,14 @@ export declare const createTaskTools: (taskManager: TaskManager, taskManagerRead
53
57
  completed: "completed";
54
58
  }>;
55
59
  result: import("zod").ZodOptional<import("zod").ZodString>;
60
+ findings: import("zod").ZodOptional<import("zod").ZodString>;
56
61
  force: import("zod").ZodOptional<import("zod").ZodBoolean>;
57
62
  };
58
63
  execute(args: {
59
64
  taskID: string;
60
65
  status: "blocked" | "failed" | "pending" | "claimed" | "in_progress" | "completed";
61
66
  result?: string | undefined;
67
+ findings?: string | undefined;
62
68
  force?: boolean | undefined;
63
69
  }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
64
70
  };
@@ -82,6 +88,11 @@ export declare const createTaskTools: (taskManager: TaskManager, taskManagerRead
82
88
  assignedAgent?: string | undefined;
83
89
  }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
84
90
  };
91
+ task_ready: {
92
+ description: string;
93
+ args: {};
94
+ execute(args: Record<string, never>, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
95
+ };
85
96
  };
86
97
  export {};
87
98
  //# sourceMappingURL=tools.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/opencode-multiagent/tools.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,KAAK,cAAc,GAAG;IACpB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7E,CAAC;AAEF,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEzC,eAAO,MAAM,eAAe,GAC1B,aAAa,WAAW,EACxB,kBAAkB,OAAO,CAAC,IAAI,CAAC,EAC/B,cAAc,qBAAqB,EACnC,UAAU,cAAc,EACxB,QAAQ,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyJrB,CAAC"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/opencode-multiagent/tools.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,KAAK,cAAc,GAAG;IACpB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7E,CAAC;AAEF,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEzC,eAAO,MAAM,eAAe,GAC1B,aAAa,WAAW,EACxB,kBAAkB,OAAO,CAAC,IAAI,CAAC,EAC/B,cAAc,qBAAqB,EACnC,UAAU,cAAc,EACxB,QAAQ,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8KrB,CAAC"}
package/docs/agents.md CHANGED
@@ -156,6 +156,82 @@ planner (triage + planning + inspection)
156
156
  | `scout` | Research | `subagent` | `anthropic/claude-sonnet-4-6` | `30` | File discovery and external research |
157
157
  | `docmaster` | Documentation | `subagent` | `anthropic/claude-sonnet-4-6` | `30` | Docs and `.magent` writing |
158
158
 
159
+ ## Model Parameters
160
+
161
+ Each agent supports the following model parameters through `agentSettings`:
162
+
163
+ | Parameter | Type | Default | Description |
164
+ | ------------- | -------- | ------- | ------------------------------------------------------------------ |
165
+ | `model` | `string` | varies | Provider-qualified model ID (e.g., `anthropic/claude-opus-4-6`). |
166
+ | `temperature` | `number` | `0` | Sampling temperature (0–2). Higher values increase randomness. |
167
+ | `steps` | `number` | varies | Maximum tool-use steps the agent can take. |
168
+ | `top_p` | `number` | `1` | Top-p (nucleus) sampling parameter (0–1). |
169
+ | `options` | `object` | `{}` | Provider-specific options (e.g., thinking budget, reasoning mode). |
170
+ | `timeout_ms` | `number` | `0` | Absolute timeout in milliseconds for agent sessions. `0` = disabled. |
171
+ | `retry` | `number` | `0` | Maximum retry attempts on failure. `0` = no retry. |
172
+ | `escalation_model` | `string` | `""` | Model to escalate to when retries are exhausted. |
173
+
174
+ These parameters are applied at two layers:
175
+
176
+ 1. **Config time** — `compileAgents` writes them into the agent config
177
+ 2. **Runtime** — `chat.params` hook injects `top_p` and `options` directly into LLM call parameters
178
+
179
+ Example: enabling thinking mode for the planner agent:
180
+
181
+ ```json
182
+ {
183
+ "agentSettings": {
184
+ "planner": {
185
+ "model": "anthropic/claude-opus-4-6",
186
+ "options": {
187
+ "thinking": { "type": "enabled", "budget_tokens": 10000 }
188
+ }
189
+ }
190
+ }
191
+ }
192
+ ```
193
+
194
+ ## Agent Timeout
195
+
196
+ Each agent can have an absolute timeout via `timeout_ms`. When the elapsed time since session
197
+ creation exceeds this value, the supervision system notifies the parent session. The default
198
+ value of `0` disables the timeout entirely.
199
+
200
+ Example: limit coder sessions to 5 minutes:
201
+
202
+ ```json
203
+ {
204
+ "agentSettings": {
205
+ "coder": {
206
+ "timeout_ms": 300000
207
+ }
208
+ }
209
+ }
210
+ ```
211
+
212
+ ## Retry and Escalation
213
+
214
+ When a child session ends with a failure, the task lifecycle system can automatically retry or
215
+ escalate the task:
216
+
217
+ - **Retry** — if `retry > 0`, the task is reset to `pending` and the parent is notified to
218
+ re-dispatch. The retry count increments on each attempt.
219
+ - **Escalation** — when retries are exhausted and `escalation_model` is set, the task is reset
220
+ to `pending` with a note to re-dispatch using the escalation model.
221
+
222
+ Example: allow one retry then escalate to Opus:
223
+
224
+ ```json
225
+ {
226
+ "agentSettings": {
227
+ "coder": {
228
+ "retry": 1,
229
+ "escalation_model": "anthropic/claude-opus-4-6"
230
+ }
231
+ }
232
+ }
233
+ ```
234
+
159
235
  ## Related Docs
160
236
 
161
237
  - [Configuration Reference](configuration.md)
package/docs/agents.tr.md CHANGED
@@ -157,6 +157,82 @@ kullanici
157
157
  | `scout` | Research | `subagent` | `anthropic/claude-sonnet-4-6` | `30` | Dosya keşfi ve araştırma |
158
158
  | `docmaster` | Documentation | `subagent` | `anthropic/claude-sonnet-4-6` | `30` | Doküman, `.magent` yazımı ve GitHub |
159
159
 
160
+ ## Model Parametreleri
161
+
162
+ Her ajan, `agentSettings` üzerinden aşağıdaki model parametrelerini destekler:
163
+
164
+ | Parametre | Tip | Varsayılan | Açıklama |
165
+ | ------------- | -------- | ---------- | ---------------------------------------------------------------------------- |
166
+ | `model` | `string` | değişken | Provider-nitelikli model ID (ör. `anthropic/claude-opus-4-6`). |
167
+ | `temperature` | `number` | `0` | Sampling temperature (0–2). Yüksek değerler rastgeleliği artırır. |
168
+ | `steps` | `number` | değişken | Ajanın atabileceği maksimum tool-use adımı. |
169
+ | `top_p` | `number` | `1` | Top-p (nucleus) sampling parametresi (0–1). |
170
+ | `options` | `object` | `{}` | Provider'a özgü seçenekler (ör. thinking budget, reasoning mode). |
171
+ | `timeout_ms` | `number` | `0` | Ajan session'ları için mutlak timeout (milisaniye). `0` = devre dışı. |
172
+ | `retry` | `number` | `0` | Başarısızlık durumunda maksimum yeniden deneme sayısı. `0` = yeniden deneme yok. |
173
+ | `escalation_model` | `string` | `""` | Yeniden denemeler tükendiğinde yükseltilecek model. |
174
+
175
+ Bu parametreler iki katmanda uygulanır:
176
+
177
+ 1. **Config zamanı** — `compileAgents` bunları agent config'e yazar
178
+ 2. **Runtime** — `chat.params` hook'u `top_p` ve `options`'ı doğrudan LLM çağrı parametrelerine enjekte eder
179
+
180
+ Örnek: planner ajanında thinking modunu açma:
181
+
182
+ ```json
183
+ {
184
+ "agentSettings": {
185
+ "planner": {
186
+ "model": "anthropic/claude-opus-4-6",
187
+ "options": {
188
+ "thinking": { "type": "enabled", "budget_tokens": 10000 }
189
+ }
190
+ }
191
+ }
192
+ }
193
+ ```
194
+
195
+ ## Ajan Timeout
196
+
197
+ Her ajan `timeout_ms` ile mutlak bir timeout'a sahip olabilir. Session oluşturulmasından itibaren
198
+ geçen süre bu değeri aştığında, supervision sistemi parent session'ı bilgilendirir. Varsayılan
199
+ `0` değeri timeout'u tamamen devre dışı bırakır.
200
+
201
+ Örnek: coder session'larını 5 dakikayla sınırlama:
202
+
203
+ ```json
204
+ {
205
+ "agentSettings": {
206
+ "coder": {
207
+ "timeout_ms": 300000
208
+ }
209
+ }
210
+ }
211
+ ```
212
+
213
+ ## Yeniden Deneme ve Yükseltme (Retry & Escalation)
214
+
215
+ Bir child session hatayla sonlandığında, task yaşam döngüsü sistemi otomatik olarak görevi
216
+ yeniden deneyebilir veya yükseltebilir:
217
+
218
+ - **Retry** — `retry > 0` ise görev `pending` durumuna sıfırlanır ve parent yeniden dispatch
219
+ etmesi için bilgilendirilir.
220
+ - **Escalation** — yeniden denemeler tükendiğinde ve `escalation_model` tanımlıysa, görev
221
+ yükseltme modeliyle yeniden dispatch edilmesi için `pending` durumuna sıfırlanır.
222
+
223
+ Örnek: bir yeniden deneme izni verip ardından Opus'a yükseltme:
224
+
225
+ ```json
226
+ {
227
+ "agentSettings": {
228
+ "coder": {
229
+ "retry": 1,
230
+ "escalation_model": "anthropic/claude-opus-4-6"
231
+ }
232
+ }
233
+ }
234
+ ```
235
+
160
236
  ## İlgili Dokümanlar
161
237
 
162
238
  - [Konfigürasyon Referansı](configuration.tr.md)
@@ -39,8 +39,10 @@ the built-in baseline.
39
39
 
40
40
  ### Agent settings
41
41
 
42
- `agentSettings` is applied during agent compilation and only fills `model`, `temperature`, and
43
- `steps` when those fields are not already explicitly set in the host config.
42
+ `agentSettings` is applied during agent compilation and only fills `model`, `temperature`,
43
+ `steps`, `top_p`, `options`, `timeout_ms`, `retry`, and `escalation_model` when those fields are not already explicitly set in the host config.
44
+
45
+ Unrecognized agent names in `agentSettings` are logged as warnings during compilation.
44
46
 
45
47
  Practical rule:
46
48
 
@@ -129,21 +131,26 @@ This section centralizes per-agent defaults for:
129
131
  - `model`
130
132
  - `temperature`
131
133
  - `steps`
134
+ - `top_p` — top-p sampling parameter (0–1). All agents default to `1`.
135
+ - `options` — provider-specific model options (e.g., thinking budget, reasoning mode). Defaults to `{}`.
136
+ - `timeout_ms` — absolute timeout in milliseconds for agent sessions. `0` = disabled.
137
+ - `retry` — maximum retry attempts on failure. `0` = no retry.
138
+ - `escalation_model` — model to escalate to when retries are exhausted. Empty string = disabled.
132
139
 
133
140
  Most bundled agents default to `temperature: 0`. The exception is `brainstormer` which uses `temperature: 0.3` for more creative exploration.
134
141
 
135
- | Agent | Category | Default model | Steps |
136
- | -------------- | ------------- | ----------------------------- | ----- |
137
- | `brainstormer` | Primary | `anthropic/claude-opus-4-6` | `200` |
138
- | `planner` | Primary | `anthropic/claude-opus-4-6` | `200` |
139
- | `executor` | Primary | `anthropic/claude-sonnet-4-6` | `200` |
140
- | `coder` | Coding | `anthropic/claude-sonnet-4-6` | `40` |
141
- | `ui-coder` | Coding | `anthropic/claude-sonnet-4-6` | `40` |
142
- | `sec-coder` | Coding | `anthropic/claude-opus-4-6` | `60` |
143
- | `reviewer` | Quality | `anthropic/claude-sonnet-4-6` | `30` |
144
- | `auditor` | Quality | `anthropic/claude-opus-4-6` | `40` |
145
- | `scout` | Research | `anthropic/claude-sonnet-4-6` | `30` |
146
- | `docmaster` | Documentation | `anthropic/claude-sonnet-4-6` | `30` |
142
+ | Agent | Category | Default model | Steps | top_p | options | timeout_ms | retry | escalation_model |
143
+ | -------------- | ------------- | ----------------------------- | ----- | ----- | ------- | ---------- | ----- | ---------------- |
144
+ | `brainstormer` | Primary | `anthropic/claude-opus-4-6` | `200` | `1` | `{}` | `0` | `0` | |
145
+ | `planner` | Primary | `anthropic/claude-opus-4-6` | `200` | `1` | `{}` | `0` | `0` | |
146
+ | `executor` | Primary | `anthropic/claude-sonnet-4-6` | `200` | `1` | `{}` | `0` | `0` | |
147
+ | `coder` | Coding | `anthropic/claude-sonnet-4-6` | `40` | `1` | `{}` | `0` | `0` | |
148
+ | `ui-coder` | Coding | `anthropic/claude-sonnet-4-6` | `40` | `1` | `{}` | `0` | `0` | |
149
+ | `sec-coder` | Coding | `anthropic/claude-opus-4-6` | `60` | `1` | `{}` | `0` | `0` | |
150
+ | `reviewer` | Quality | `anthropic/claude-sonnet-4-6` | `30` | `1` | `{}` | `0` | `0` | |
151
+ | `auditor` | Quality | `anthropic/claude-opus-4-6` | `40` | `1` | `{}` | `0` | `0` | |
152
+ | `scout` | Research | `anthropic/claude-sonnet-4-6` | `30` | `1` | `{}` | `0` | `0` | |
153
+ | `docmaster` | Documentation | `anthropic/claude-sonnet-4-6` | `30` | `1` | `{}` | `0` | `0` | |
147
154
 
148
155
  ## `mcpDefaults`
149
156
 
@@ -39,9 +39,10 @@ ayarların üstüne yazar.
39
39
 
40
40
  ### Agent ayarları
41
41
 
42
- `agentSettings`, agent compilation sırasında uygulanır ve sadece `model`, `temperature` ve
43
- `steps` alanlarını doldurur; ancak bu alanlar host config içinde zaten açıkça tanımlanmışsa
44
- dokunulmaz.
42
+ `agentSettings`, agent compilation sırasında uygulanır ve sadece `model`, `temperature`,
43
+ `steps`, `top_p`, `options`, `timeout_ms`, `retry` ve `escalation_model` alanlarını doldurur; ancak bu alanlar host config içinde zaten açıkça tanımlanmışsa dokunulmaz.
44
+
45
+ `agentSettings` içinde tanınmayan ajan adları derleme sırasında uyarı olarak loglanır.
45
46
 
46
47
  Pratik kural:
47
48
 
@@ -130,21 +131,26 @@ Bu bölüm, agent bazında şu varsayılanları merkezi olarak yönetir:
130
131
  - `model`
131
132
  - `temperature`
132
133
  - `steps`
134
+ - `top_p` — top-p sampling parametresi (0–1). Tüm ajanlar varsayılan olarak `1` kullanır.
135
+ - `options` — provider'a özgü model seçenekleri (ör. thinking budget, reasoning mode). Varsayılan: `{}`.
136
+ - `timeout_ms` — ajan session'ları için mutlak timeout (milisaniye). `0` = devre dışı.
137
+ - `retry` — başarısızlık durumunda maksimum yeniden deneme sayısı. `0` = yeniden deneme yok.
138
+ - `escalation_model` — yeniden denemeler tükendiğinde yükseltilecek model. Boş string = devre dışı.
133
139
 
134
140
  Paketlenmiş ajanların çoğu varsayılan olarak `temperature: 0` kullanır. Tek istisna, daha yaratıcı keşif için `temperature: 0.3` kullanan `brainstormer` ajanıdır.
135
141
 
136
- | Agent | Kategori | Varsayılan model | Steps |
137
- | -------------- | ------------- | ----------------------------- | ----- |
138
- | `brainstormer` | Primary | `anthropic/claude-opus-4-6` | `200` |
139
- | `planner` | Primary | `anthropic/claude-opus-4-6` | `200` |
140
- | `executor` | Primary | `anthropic/claude-sonnet-4-6` | `200` |
141
- | `coder` | Coding | `anthropic/claude-sonnet-4-6` | `40` |
142
- | `ui-coder` | Coding | `anthropic/claude-sonnet-4-6` | `40` |
143
- | `sec-coder` | Coding | `anthropic/claude-opus-4-6` | `60` |
144
- | `reviewer` | Quality | `anthropic/claude-sonnet-4-6` | `30` |
145
- | `auditor` | Quality | `anthropic/claude-opus-4-6` | `40` |
146
- | `scout` | Research | `anthropic/claude-sonnet-4-6` | `30` |
147
- | `docmaster` | Documentation | `anthropic/claude-sonnet-4-6` | `30` |
142
+ | Agent | Kategori | Varsayılan model | Steps | top_p | options | timeout_ms | retry | escalation_model |
143
+ | -------------- | ------------- | ----------------------------- | ----- | ----- | ------- | ---------- | ----- | ---------------- |
144
+ | `brainstormer` | Primary | `anthropic/claude-opus-4-6` | `200` | `1` | `{}` | `0` | `0` | |
145
+ | `planner` | Primary | `anthropic/claude-opus-4-6` | `200` | `1` | `{}` | `0` | `0` | |
146
+ | `executor` | Primary | `anthropic/claude-sonnet-4-6` | `200` | `1` | `{}` | `0` | `0` | |
147
+ | `coder` | Coding | `anthropic/claude-sonnet-4-6` | `40` | `1` | `{}` | `0` | `0` | |
148
+ | `ui-coder` | Coding | `anthropic/claude-sonnet-4-6` | `40` | `1` | `{}` | `0` | `0` | |
149
+ | `sec-coder` | Coding | `anthropic/claude-opus-4-6` | `60` | `1` | `{}` | `0` | `0` | |
150
+ | `reviewer` | Quality | `anthropic/claude-sonnet-4-6` | `30` | `1` | `{}` | `0` | `0` | |
151
+ | `auditor` | Quality | `anthropic/claude-opus-4-6` | `40` | `1` | `{}` | `0` | `0` | |
152
+ | `scout` | Research | `anthropic/claude-sonnet-4-6` | `30` | `1` | `{}` | `0` | `0` | |
153
+ | `docmaster` | Documentation | `anthropic/claude-sonnet-4-6` | `30` | `1` | `{}` | `0` | `0` | |
148
154
 
149
155
  ## `mcpDefaults`
150
156
 
@@ -73,11 +73,12 @@ the route unless you have a strong reason to override the flow.
73
73
 
74
74
  ## 5. Shared Task Board
75
75
 
76
- The plugin exposes three shared task tools:
76
+ The plugin exposes shared task tools:
77
77
 
78
- - `task_create`
79
- - `task_update`
80
- - `task_list`
78
+ - `task_create` — create a new task with optional `maxRetries` and `escalationModel`
79
+ - `task_update` — update task status, result, and `findings` for sibling context sharing
80
+ - `task_list` — list tasks with dependency status (`depsMet`, `unmetDeps`)
81
+ - `task_ready` — list tasks whose dependencies are all met and are ready to dispatch
81
82
 
82
83
  These are used internally by the agent system to track work, but they are also important to
83
84
  understand when reading logs or `.opencode` artifacts.
@@ -93,6 +94,23 @@ Possible task states:
93
94
  - `failed`
94
95
  - `blocked`
95
96
 
97
+ ### Retry and escalation
98
+
99
+ Tasks created with `maxRetries > 0` are automatically retried when the child session ends with
100
+ a failure. When retries are exhausted and an `escalationModel` is set, the task is reset with a
101
+ prompt to re-dispatch using a more capable model.
102
+
103
+ ### Sibling context sharing
104
+
105
+ When a task is completed with `findings`, those findings are included in the completion
106
+ notification sent to sibling tasks. This lets parallel workers learn from each other's results
107
+ without requiring manual coordination.
108
+
109
+ ### Dependency visibility
110
+
111
+ `task_list` now returns dependency status for each task (`depsMet: true/false`, `unmetDeps: [...]`).
112
+ Use `task_ready` to quickly find tasks that are ready to dispatch.
113
+
96
114
  ### Persistence
97
115
 
98
116
  When a project root is available, the task board is persisted to:
@@ -140,6 +158,28 @@ Example:
140
158
  }
141
159
  ```
142
160
 
161
+ ### Extended model parameters
162
+
163
+ You can also set `top_p` and provider-specific `options` per agent. For example, to enable
164
+ thinking mode with a token budget:
165
+
166
+ ```json
167
+ {
168
+ "agentSettings": {
169
+ "planner": {
170
+ "model": "anthropic/claude-opus-4-6",
171
+ "top_p": 0.9,
172
+ "options": {
173
+ "thinking": { "type": "enabled", "budget_tokens": 10000 }
174
+ }
175
+ }
176
+ }
177
+ }
178
+ ```
179
+
180
+ These parameters are injected both at config compilation time and at runtime via the `chat.params`
181
+ hook, ensuring they reach the LLM provider regardless of how OpenCode merges agent config.
182
+
143
183
  Use `opencode.json` when you want an explicit host-level override for a specific OpenCode field.
144
184
 
145
185
  Example:
@@ -200,7 +240,7 @@ Common generated files and directories:
200
240
 
201
241
  | Path | Purpose |
202
242
  | ----------------------------------------------------- | ---------------------------------------------------- |
203
- | `~/.config/opencode/logs/opencode-multiagent.jsonl` | Observation and telemetry log |
243
+ | `~/.config/opencode/logs/opencode-multiagent.jsonl` | Observation, telemetry, and token usage log |
204
244
  | `~/.config/opencode/plugins/opencode-multiagent.json` | User runtime overrides |
205
245
  | `.opencode/tasks/taskboard.json` | Shared task board persistence |
206
246
  | `.opencode/plans/` | Durable plans created through planner and docmaster |
@@ -73,11 +73,12 @@ Kullanıcı açısından pratik kural basittir: güçlü bir sebep yoksa görevi
73
73
 
74
74
  ## 5. Ortak Task Board
75
75
 
76
- Plugin üç ortak task aracı sunar:
76
+ Plugin ortak task araçları sunar:
77
77
 
78
- - `task_create`
79
- - `task_update`
80
- - `task_list`
78
+ - `task_create` — opsiyonel `maxRetries` ve `escalationModel` ile yeni görev oluşturma
79
+ - `task_update` — görev durumu, sonuç ve sibling context paylaşımı için `findings` güncelleme
80
+ - `task_list` — bağımlılık durumu ile görevleri listeleme (`depsMet`, `unmetDeps`)
81
+ - `task_ready` — bağımlılıkları karşılanmış ve dispatch'e hazır görevleri listeleme
81
82
 
82
83
  Bu araçlar ajan sistemi tarafından dahili olarak kullanılır; ancak log ve `.opencode` çıktılarının
83
84
  nasıl oluştuğunu anlamak için bilinmeleri faydalıdır.
@@ -93,6 +94,23 @@ Olası task durumları:
93
94
  - `failed`
94
95
  - `blocked`
95
96
 
97
+ ### Yeniden deneme ve yükseltme
98
+
99
+ `maxRetries > 0` ile oluşturulan görevler, child session hatayla sonlandığında otomatik olarak
100
+ yeniden denenir. Yeniden denemeler tükendiğinde ve bir `escalationModel` tanımlıysa, görev daha
101
+ güçlü bir modelle yeniden dispatch edilmesi için sıfırlanır.
102
+
103
+ ### Sibling context paylaşımı
104
+
105
+ Bir görev `findings` ile tamamlandığında, bu bulgular kardeş görevlere gönderilen tamamlanma
106
+ bildirimlerine eklenir. Bu sayede paralel çalışanlar, manuel koordinasyon gerektirmeden
107
+ birbirlerinin sonuçlarından öğrenebilir.
108
+
109
+ ### Bağımlılık görünürlüğü
110
+
111
+ `task_list` artık her görev için bağımlılık durumunu döndürür (`depsMet: true/false`,
112
+ `unmetDeps: [...]`). Dispatch'e hazır görevleri hızlıca bulmak için `task_ready` kullanın.
113
+
96
114
  ### Kalıcılık
97
115
 
98
116
  Bir proje kökü varsa task board şu dosyaya yazılır:
@@ -141,6 +159,29 @@ kullanın.
141
159
  }
142
160
  ```
143
161
 
162
+ ### Genişletilmiş model parametreleri
163
+
164
+ Her ajan için `top_p` ve provider'a özgü `options` da ayarlanabilir. Örneğin, thinking modunu
165
+ bir token bütçesiyle açmak için:
166
+
167
+ ```json
168
+ {
169
+ "agentSettings": {
170
+ "planner": {
171
+ "model": "anthropic/claude-opus-4-6",
172
+ "top_p": 0.9,
173
+ "options": {
174
+ "thinking": { "type": "enabled", "budget_tokens": 10000 }
175
+ }
176
+ }
177
+ }
178
+ }
179
+ ```
180
+
181
+ Bu parametreler hem config derleme zamanında hem de runtime'da `chat.params` hook'u aracılığıyla
182
+ enjekte edilir; böylece OpenCode agent config'i nasıl birleştirirse birleştirsin parametreler
183
+ LLM provider'a ulaşır.
184
+
144
185
  Belirli bir OpenCode alanını açıkça override etmek istediğinizde `opencode.json` kullanın.
145
186
 
146
187
  Örnek:
@@ -201,7 +242,7 @@ Sık görülen dosya ve dizinler:
201
242
 
202
243
  | Yol | Amaç |
203
244
  | ----------------------------------------------------- | -------------------------------------------------------------- |
204
- | `~/.config/opencode/logs/opencode-multiagent.jsonl` | Observation ve telemetry logu |
245
+ | `~/.config/opencode/logs/opencode-multiagent.jsonl` | Observation, telemetry ve token kullanım logu |
205
246
  | `~/.config/opencode/plugins/opencode-multiagent.json` | Kullanıcı runtime override dosyası |
206
247
  | `.opencode/tasks/taskboard.json` | Ortak task board verisi |
207
248
  | `.opencode/plans/` | `planner` ve `docmaster` tarafından yazılan kalıcı planlar |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-multiagent",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "description": "Multi-agent orchestration plugin for OpenCode",
6
6
  "license": "MIT",
File without changes