opencode-model-router 1.1.8 → 1.1.9
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/package.json +1 -1
- package/src/index.ts +8 -10
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -580,21 +580,19 @@ const ModelRouterPlugin: Plugin = async (_ctx: PluginInput) => {
|
|
|
580
580
|
let cfg = loadConfig();
|
|
581
581
|
const activeTiers = getActiveTiers(cfg);
|
|
582
582
|
|
|
583
|
-
// Track
|
|
584
|
-
//
|
|
583
|
+
// Track subagent sessions so we can skip delegation protocol injection.
|
|
584
|
+
// Populated by chat.params (which has the agent name) before system.transform fires.
|
|
585
585
|
const subagentSessionIDs = new Set<string>();
|
|
586
586
|
|
|
587
587
|
return {
|
|
588
588
|
// -----------------------------------------------------------------------
|
|
589
|
-
//
|
|
589
|
+
// Detect subagent calls via chat.params (has agent field).
|
|
590
|
+
// When the agent name matches a registered tier, record the sessionID.
|
|
590
591
|
// -----------------------------------------------------------------------
|
|
591
|
-
|
|
592
|
-
const
|
|
593
|
-
if (
|
|
594
|
-
subagentSessionIDs.add(
|
|
595
|
-
}
|
|
596
|
-
if (evt.type === "session.deleted") {
|
|
597
|
-
subagentSessionIDs.delete(evt.properties?.info?.id);
|
|
592
|
+
"chat.params": async (input: any, _output: any) => {
|
|
593
|
+
const tierNames = Object.keys(activeTiers);
|
|
594
|
+
if (input.agent && tierNames.includes(input.agent)) {
|
|
595
|
+
subagentSessionIDs.add(input.sessionID);
|
|
598
596
|
}
|
|
599
597
|
},
|
|
600
598
|
|