opencode-multiagent 0.5.0 → 0.6.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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.6.1](https://github.com/vaur94/opencode-multiagent/compare/v0.6.0...v0.6.1) (2026-03-15)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * skip top_p=1 injection to avoid API conflict with temperature, slow down pre-major versioning ([db61ec2](https://github.com/vaur94/opencode-multiagent/commit/db61ec2981e39026f35326541b6f468e5c366fa6))
9
+
10
+ ## [0.6.0](https://github.com/vaur94/opencode-multiagent/compare/v0.5.0...v0.6.0) (2026-03-15)
11
+
12
+
13
+ ### Features
14
+
15
+ * 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))
16
+
3
17
  ## [0.5.0](https://github.com/vaur94/opencode-multiagent/compare/v0.4.0...v0.5.0) (2026-03-15)
4
18
 
5
19
 
@@ -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,9 @@ 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
+ if (field === "top_p" && value === 1)
375
+ continue;
374
376
  target[field] = clone(value);
375
377
  }
376
378
  }
@@ -382,6 +384,15 @@ async function compileAgents(cfg, dirs, agentSettings = {}) {
382
384
  mcpRegistry.set(name, buildMcpPermissionRegistry(perm));
383
385
  taskRouting.set(name, buildTaskRoutingAllowSet(perm));
384
386
  }
387
+ for (const key of Object.keys(agentSettings)) {
388
+ if (!defs.has(key)) {
389
+ await note("config_warning", {
390
+ observation: true,
391
+ warning: "unknown_agent_override",
392
+ agent: key
393
+ });
394
+ }
395
+ }
385
396
  return { mcpRegistry, taskRouting };
386
397
  }
387
398
  var isTaskRoutingAllowed = (agent, target, routing) => {
@@ -835,7 +846,10 @@ var createSupervisionController = ({
835
846
  lastActivity: Date.now(),
836
847
  remindedAt: 0,
837
848
  lastToolErrorAt: 0,
838
- hasUnverifiedEdits: false
849
+ hasUnverifiedEdits: false,
850
+ startedAt: Date.now(),
851
+ timeoutMs: 0,
852
+ timeoutNotifiedAt: 0
839
853
  });
840
854
  tracker.enforceLimit();
841
855
  await note("supervision", { event: "child_tracked", parentID, childID });
@@ -887,6 +901,26 @@ var createSupervisionController = ({
887
901
  childID: sessionID,
888
902
  agentName: info.agentName
889
903
  });
904
+ if (info.timeoutMs > 0 && now - info.startedAt > info.timeoutMs && info.timeoutNotifiedAt === 0) {
905
+ info.timeoutNotifiedAt = now;
906
+ 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.`;
907
+ try {
908
+ if (client.session?.prompt) {
909
+ await client.session.prompt({
910
+ path: { id: info.parentID },
911
+ body: { parts: [{ type: "text", text: timeoutText }], noReply: false }
912
+ });
913
+ }
914
+ } catch {}
915
+ await note("agent_timeout", compact({
916
+ observation: true,
917
+ parentID: info.parentID,
918
+ childID: sessionID,
919
+ agentName: info.agentName,
920
+ timeoutMs: info.timeoutMs,
921
+ elapsed: now - info.startedAt
922
+ }));
923
+ }
890
924
  return;
891
925
  }
892
926
  };
@@ -903,12 +937,18 @@ var createSupervisionController = ({
903
937
  const getActiveChildCount = (parentID) => {
904
938
  return childMap.get(parentID)?.size ?? 0;
905
939
  };
940
+ const setSessionTimeout = (sessionID, timeoutMs) => {
941
+ const info = tracker.entries.get(sessionID);
942
+ if (info)
943
+ info.timeoutMs = timeoutMs;
944
+ };
906
945
  return {
907
946
  handleSupervision,
908
947
  cleanup: tracker.cleanup,
909
948
  recordToolError,
910
949
  recordVerification,
911
950
  getActiveChildCount,
951
+ setSessionTimeout,
912
952
  getChildInfo(sessionID) {
913
953
  return tracker.entries.get(sessionID);
914
954
  },
@@ -1016,6 +1056,9 @@ var createTaskManager = (projectRoot) => {
1016
1056
  assignedAgent: input.assignedAgent,
1017
1057
  createdBy: input.createdBy,
1018
1058
  dependencies: input.dependencies ?? [],
1059
+ retryCount: 0,
1060
+ maxRetries: input.maxRetries ?? 0,
1061
+ escalationModel: input.escalationModel,
1019
1062
  createdAt: Date.now(),
1020
1063
  updatedAt: Date.now()
1021
1064
  };
@@ -1041,6 +1084,8 @@ var createTaskManager = (projectRoot) => {
1041
1084
  task.result = input.result;
1042
1085
  if (input.assignedAgent !== undefined)
1043
1086
  task.assignedAgent = input.assignedAgent;
1087
+ if (input.findings !== undefined)
1088
+ task.findings = input.findings;
1044
1089
  task.updatedAt = Date.now();
1045
1090
  schedulePersist();
1046
1091
  return task;
@@ -1067,7 +1112,10 @@ var createTaskManager = (projectRoot) => {
1067
1112
  const active = [...tasks.values()].filter((t) => t.status === "pending" || t.status === "claimed" || t.status === "in_progress");
1068
1113
  if (active.length === 0)
1069
1114
  return "";
1070
- const lines = active.slice(0, 10).map((t) => `- [${t.status}] ${t.title}${t.assignedAgent ? ` (${t.assignedAgent})` : ""}`);
1115
+ const lines = active.slice(0, 10).map((t) => {
1116
+ const depNote = t.dependencies.length > 0 ? areDependenciesMet(t.id).met ? " [deps:ok]" : ` [blocked:${areDependenciesMet(t.id).unmet.join(",")}]` : "";
1117
+ return `- [${t.status}] ${t.title}${t.assignedAgent ? ` (${t.assignedAgent})` : ""}${depNote}`;
1118
+ });
1071
1119
  return `Active tasks (${active.length}):
1072
1120
  ${lines.join(`
1073
1121
  `)}`;
@@ -1081,7 +1129,70 @@ ${lines.join(`
1081
1129
  schedulePersist();
1082
1130
  return true;
1083
1131
  };
1084
- return { create, update, get, list, load, getActiveSummary, linkSession };
1132
+ const getSiblingFindings = (taskID) => {
1133
+ const task = tasks.get(taskID);
1134
+ if (!task?.createdBy)
1135
+ return "";
1136
+ const siblings = [...tasks.values()].filter((t) => t.id !== taskID && t.status === "completed" && t.findings && t.createdBy === task.createdBy);
1137
+ if (siblings.length === 0)
1138
+ return "";
1139
+ return siblings.slice(0, 5).map((t) => `- [${t.id}] ${t.title}: ${t.findings.slice(0, 200)}`).join(`
1140
+ `);
1141
+ };
1142
+ const getReadyTasks = () => {
1143
+ return [...tasks.values()].filter((t) => {
1144
+ if (t.status !== "pending")
1145
+ return false;
1146
+ if (t.dependencies.length === 0)
1147
+ return true;
1148
+ return areDependenciesMet(t.id).met;
1149
+ });
1150
+ };
1151
+ const getDependentsOf = (taskID) => {
1152
+ return [...tasks.values()].filter((t) => t.dependencies.includes(taskID));
1153
+ };
1154
+ const listWithDepInfo = (filter) => {
1155
+ return list(filter).map((task) => {
1156
+ const { met, unmet } = areDependenciesMet(task.id);
1157
+ return { ...task, depsMet: met, unmetDeps: unmet };
1158
+ });
1159
+ };
1160
+ const shouldRetry = (taskID) => {
1161
+ const task = tasks.get(taskID);
1162
+ if (!task)
1163
+ return { retry: false, escalate: false };
1164
+ if (task.retryCount < task.maxRetries)
1165
+ return { retry: true, escalate: false };
1166
+ if (task.escalationModel)
1167
+ return { retry: false, escalate: true, model: task.escalationModel };
1168
+ return { retry: false, escalate: false };
1169
+ };
1170
+ const incrementRetry = (taskID) => {
1171
+ const task = tasks.get(taskID);
1172
+ if (!task)
1173
+ return { error: `Task ${taskID} not found` };
1174
+ task.retryCount += 1;
1175
+ task.status = "pending";
1176
+ task.result = (task.result ? task.result + " | " : "") + `Retry #${task.retryCount}`;
1177
+ task.updatedAt = Date.now();
1178
+ schedulePersist();
1179
+ return task;
1180
+ };
1181
+ return {
1182
+ create,
1183
+ update,
1184
+ get,
1185
+ list,
1186
+ load,
1187
+ getActiveSummary,
1188
+ linkSession,
1189
+ getSiblingFindings,
1190
+ getReadyTasks,
1191
+ getDependentsOf,
1192
+ listWithDepInfo,
1193
+ shouldRetry,
1194
+ incrementRetry
1195
+ };
1085
1196
  };
1086
1197
 
1087
1198
  // src/opencode-multiagent/telemetry.ts
@@ -1106,6 +1217,8 @@ var createTelemetryController = ({ flags }) => {
1106
1217
  filesEdited: 0,
1107
1218
  tasksDispatched: 0,
1108
1219
  permissionDenied: 0,
1220
+ inputTokens: 0,
1221
+ outputTokens: 0,
1109
1222
  flushed: false,
1110
1223
  ...extra
1111
1224
  });
@@ -1152,6 +1265,15 @@ var createTelemetryController = ({ flags }) => {
1152
1265
  return;
1153
1266
  state.permissionDenied += 1;
1154
1267
  },
1268
+ trackTokenUsage(sessionID, usage, extra) {
1269
+ const state = ensureSession(sessionID, extra);
1270
+ if (!state)
1271
+ return;
1272
+ if (typeof usage.inputTokens === "number")
1273
+ state.inputTokens += usage.inputTokens;
1274
+ if (typeof usage.outputTokens === "number")
1275
+ state.outputTokens += usage.outputTokens;
1276
+ },
1155
1277
  async flushSession(sessionID, reason = "session_deleted") {
1156
1278
  const state = tracker.entries.get(sessionID);
1157
1279
  if (!state || state.flushed)
@@ -1169,6 +1291,8 @@ var createTelemetryController = ({ flags }) => {
1169
1291
  files_edited: state.filesEdited,
1170
1292
  tasks_dispatched: state.tasksDispatched,
1171
1293
  permission_denied: state.permissionDenied,
1294
+ input_tokens: state.inputTokens,
1295
+ output_tokens: state.outputTokens,
1172
1296
  reason
1173
1297
  });
1174
1298
  },
@@ -1191,7 +1315,9 @@ var createTaskTools = (taskManager, taskManagerReady, correlation, quality, flag
1191
1315
  description: pluginTool.schema.string().describe("Detailed description of what needs to be done"),
1192
1316
  assignedAgent: pluginTool.schema.string().optional().describe("Name of the agent to assign this task to"),
1193
1317
  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")
1318
+ priority: pluginTool.schema.enum(["high", "medium", "low"]).optional().describe("Task priority: high, medium, or low"),
1319
+ maxRetries: pluginTool.schema.number().optional().describe("Maximum retry attempts on failure. 0 = no retry."),
1320
+ escalationModel: pluginTool.schema.string().optional().describe("Model to escalate to when retries are exhausted (e.g., anthropic/claude-opus-4-6)")
1195
1321
  },
1196
1322
  async execute(args, ctx) {
1197
1323
  await taskManagerReady;
@@ -1235,6 +1361,7 @@ var createTaskTools = (taskManager, taskManagerReady, correlation, quality, flag
1235
1361
  taskID: pluginTool.schema.string().describe("ID of the task to update"),
1236
1362
  status: pluginTool.schema.enum(["pending", "claimed", "in_progress", "completed", "failed", "blocked"]).describe("New status for the task"),
1237
1363
  result: pluginTool.schema.string().optional().describe("Result summary or notes"),
1364
+ findings: pluginTool.schema.string().optional().describe("Key findings or output summary from this task for sibling context sharing"),
1238
1365
  force: pluginTool.schema.boolean().optional().describe("Force completion even without quality evidence (bypass quality gate)")
1239
1366
  },
1240
1367
  async execute(args, ctx) {
@@ -1263,7 +1390,7 @@ var createTaskTools = (taskManager, taskManagerReady, correlation, quality, flag
1263
1390
  agent: ctx.agent
1264
1391
  });
1265
1392
  }
1266
- return JSON.stringify(taskManager.update(args.taskID, { status: args.status, result: args.result }));
1393
+ return JSON.stringify(taskManager.update(args.taskID, { status: args.status, result: args.result, findings: args.findings }));
1267
1394
  }
1268
1395
  }),
1269
1396
  task_get: pluginTool({
@@ -1284,7 +1411,15 @@ var createTaskTools = (taskManager, taskManagerReady, correlation, quality, flag
1284
1411
  },
1285
1412
  async execute(args) {
1286
1413
  await taskManagerReady;
1287
- return JSON.stringify(taskManager.list(args));
1414
+ return JSON.stringify(taskManager.listWithDepInfo(args));
1415
+ }
1416
+ }),
1417
+ task_ready: pluginTool({
1418
+ description: "List tasks whose dependencies are all met and are ready to be dispatched",
1419
+ args: {},
1420
+ async execute() {
1421
+ await taskManagerReady;
1422
+ return JSON.stringify(taskManager.getReadyTasks());
1288
1423
  }
1289
1424
  })
1290
1425
  });
@@ -1367,7 +1502,17 @@ var createPluginHooks = ({
1367
1502
  const notifyParentOnChildCompletion = async (childSessionID, parentSessionID, agentName, taskLabel) => {
1368
1503
  const agentLabel = agentName ? ` (agent: ${agentName})` : "";
1369
1504
  const taskInfo = taskLabel ? `, task ${taskLabel}` : "";
1370
- const text2 = `Child session ${childSessionID}${agentLabel}${taskInfo} has completed. ` + "Review its output and proceed with the next task.";
1505
+ let siblingContext = "";
1506
+ if (taskLabel) {
1507
+ const findings = taskManager.getSiblingFindings(taskLabel);
1508
+ if (findings) {
1509
+ siblingContext = `
1510
+
1511
+ Completed sibling findings:
1512
+ ${findings}`;
1513
+ }
1514
+ }
1515
+ const text2 = `Child session ${childSessionID}${agentLabel}${taskInfo} has completed. ` + `Review its output and proceed with the next task.${siblingContext}`;
1371
1516
  try {
1372
1517
  if (client.session?.prompt) {
1373
1518
  await client.session.prompt({
@@ -1460,6 +1605,13 @@ var createPluginHooks = ({
1460
1605
  parent_agent: parent.agent,
1461
1606
  child_sessionID: childID
1462
1607
  });
1608
+ const childAgentName = agentHint ?? (typeof props.info?.agent === "string" ? props.info.agent : undefined);
1609
+ if (childAgentName && childID) {
1610
+ const agentCfg = agentSettings?.[childAgentName];
1611
+ if (agentCfg && typeof agentCfg === "object" && typeof agentCfg.timeout_ms === "number") {
1612
+ supervision.setSessionTimeout(childID, agentCfg.timeout_ms);
1613
+ }
1614
+ }
1463
1615
  }
1464
1616
  } else if (type === "message.updated") {
1465
1617
  const sessionID = typeof props.info?.sessionID === "string" ? props.info.sessionID : undefined;
@@ -1467,6 +1619,15 @@ var createPluginHooks = ({
1467
1619
  if (sessionID && agent) {
1468
1620
  rememberSession(sessionID, { agent });
1469
1621
  }
1622
+ if (sessionID) {
1623
+ const usage = props.info?.usage ?? props.usage ?? props.metadata?.usage;
1624
+ if (usage && typeof usage === "object") {
1625
+ telemetry.trackTokenUsage(sessionID, {
1626
+ inputTokens: typeof usage.inputTokens === "number" ? usage.inputTokens : typeof usage.input_tokens === "number" ? usage.input_tokens : undefined,
1627
+ outputTokens: typeof usage.outputTokens === "number" ? usage.outputTokens : typeof usage.output_tokens === "number" ? usage.output_tokens : undefined
1628
+ });
1629
+ }
1630
+ }
1470
1631
  } else if (type === "session.deleted") {
1471
1632
  const sessionID = typeof props.info?.id === "string" ? props.info.id : typeof props.sessionID === "string" ? props.sessionID : undefined;
1472
1633
  if (sessionID) {
@@ -1490,6 +1651,63 @@ var createPluginHooks = ({
1490
1651
  childSessionID: sessionID,
1491
1652
  autoStatus
1492
1653
  });
1654
+ if (autoStatus === "failed" && flags.task_lifecycle) {
1655
+ const retryInfo = taskManager.shouldRetry(link.taskID);
1656
+ if (retryInfo.retry) {
1657
+ const retriedTask = taskManager.incrementRetry(link.taskID);
1658
+ if (!("error" in retriedTask)) {
1659
+ await note("task_retry", {
1660
+ observation: true,
1661
+ taskID: link.taskID,
1662
+ retryCount: retriedTask.retryCount,
1663
+ maxRetries: retriedTask.maxRetries
1664
+ });
1665
+ if (childInfo?.parentID) {
1666
+ const retryText = `[opencode-multiagent retry] Task ${link.taskID} failed and has been reset to pending ` + `(retry ${retriedTask.retryCount}/${retriedTask.maxRetries}). Re-dispatch when ready.`;
1667
+ try {
1668
+ if (client.session?.prompt) {
1669
+ await client.session.prompt({
1670
+ path: { id: childInfo.parentID },
1671
+ body: { parts: [{ type: "text", text: retryText }], noReply: false }
1672
+ });
1673
+ }
1674
+ } catch {}
1675
+ }
1676
+ correlation.removeLink(sessionID);
1677
+ return;
1678
+ }
1679
+ } else if (retryInfo.escalate && retryInfo.model) {
1680
+ taskManager.update(link.taskID, {
1681
+ status: "pending",
1682
+ result: `Escalated to ${retryInfo.model} after exhausting retries`
1683
+ });
1684
+ await note("task_escalation", {
1685
+ observation: true,
1686
+ taskID: link.taskID,
1687
+ escalationModel: retryInfo.model
1688
+ });
1689
+ if (childInfo?.parentID) {
1690
+ const escalateText = `[opencode-multiagent escalation] Task ${link.taskID} exhausted retries. ` + `Re-dispatch with model override: ${retryInfo.model}.`;
1691
+ try {
1692
+ if (client.session?.prompt) {
1693
+ await client.session.prompt({
1694
+ path: { id: childInfo.parentID },
1695
+ body: { parts: [{ type: "text", text: escalateText }], noReply: false }
1696
+ });
1697
+ }
1698
+ } catch {}
1699
+ }
1700
+ correlation.removeLink(sessionID);
1701
+ return;
1702
+ }
1703
+ }
1704
+ if (autoStatus === "completed") {
1705
+ const dependents = taskManager.getDependentsOf(link.taskID);
1706
+ const nowReady = dependents.filter((t) => t.status === "pending" && taskManager.getReadyTasks().some((r) => r.id === t.id));
1707
+ if (nowReady.length > 0) {
1708
+ taskLabel = `${link.taskID} [unblocked: ${nowReady.map((t) => t.id).join(", ")}]`;
1709
+ }
1710
+ }
1493
1711
  }
1494
1712
  if (link)
1495
1713
  correlation.removeLink(sessionID);
@@ -1523,6 +1741,16 @@ var createPluginHooks = ({
1523
1741
  agent: label(input.agent),
1524
1742
  model: label(input.model, ["id", "name", "modelID"])
1525
1743
  });
1744
+ const agentName = label(input.agent);
1745
+ if (agentName && agentSettings?.[agentName]) {
1746
+ const settings = agentSettings[agentName];
1747
+ if (typeof settings.top_p === "number" && settings.top_p < 1) {
1748
+ output.topP = settings.top_p;
1749
+ }
1750
+ if (settings.options && typeof settings.options === "object") {
1751
+ output.options = { ...output.options, ...settings.options };
1752
+ }
1753
+ }
1526
1754
  if (!flags.observation)
1527
1755
  return;
1528
1756
  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,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OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,uEAAuE;IACvE,iCAAiC,CAAC,EAAE,CAClC,KAAK,EAAE,OAAO,EACd,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,KAC1B,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,6DAA6D;IAC7D,4BAA4B,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,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,C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3B,MAAM,EAAE,YAAY,CAAC;CACtB;+BA+ByC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,GAAG,CAAA;KAAE,KAAG,OAAO,CAAC,IAAI,CAAC;;iCAwIvD,MAAM,KAAG,IAAI;oCAKV,MAAM,KAAG,IAAI;oCAKb,MAAM,KAAG,MAAM;mCAIhB,MAAM,aAAa,MAAM,KAAG,IAAI;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,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE9C,KAAK,IAAI,GAAG;IACV,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa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AA;KAAE,CAAC;0BAOzE,MAAM,KAAG;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;6BAQ3D,MAAM,KAAG,IAAI,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE;CAgBlE,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,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;I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,MAAM,yBAAyB,GAAI,WAAW;IAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE;;+BA0ClE,MAAM,GAAG,SAAS,UACtB,OAAO,CAAC,qBAAqB,CAAC,GACpC,IAAI;yBAIc,MAAM,GAAG,SAAS,GAAG,IAAI;6BAMjC,MAAM,GAAG,SAAS,UACtB,OAAO,CAAC,qBAAqB,CAAC,GACpC,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.1",
4
4
  "type": "module",
5
5
  "description": "Multi-agent orchestration plugin for OpenCode",
6
6
  "license": "MIT",
File without changes