Improve delegate (#377)

* Improve delegate

* fix stale log regexes in delegate tests and add test-coupling comments

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Colin McDonnell
2026-02-23 23:41:27 +00:00
committed by pullfrog[bot]
parent a7bd746f21
commit 2017922780
30 changed files with 853 additions and 522 deletions
+7 -4
View File
@@ -14,15 +14,18 @@ export function SetOutputTool(ctx: ToolContext) {
"Set the action output. When called by a subagent, returns a summary result to the orchestrator. When called in standalone mode, exposes the value as the 'result' GitHub Action output.",
parameters: SetOutputParams,
execute: execute(async (params) => {
const activeId = ctx.toolState.activeSubagentId;
if (activeId) {
const subagent = ctx.toolState.subagents.get(activeId);
const selfId = ctx.toolState.selfSubagentId;
if (selfId) {
const subagent = ctx.toolState.subagents.get(selfId);
if (subagent) {
subagent.output = params.value;
log.debug(
`set_output: routed to subagent ${selfId} (value=${params.value.slice(0, 80)})`
);
return { success: true, routed: "subagent" };
}
log.warning(
`set_output: activeSubagentId=${activeId} but subagent not found in map — routing to action output`
`set_output: selfSubagentId=${selfId} but subagent not found in map — routing to action output`
);
}
ctx.toolState.output = params.value;