fix(council-finalize): append runtime guidance to tool response for same-turn delivery

Remove contextCollector dependency from council_finalize and append
Athena runtime guidance directly to the tool's JSON response string.
This fixes the timing bug where guidance registered via contextCollector
only arrived on the next message cycle, too late for Athena's same-turn
synthesis.

- Remove ContextCollector import, RegisterContext type, and collector.register() block
- Append buildAthenaRuntimeGuidance() output after JSON result with \n\n separator
- Simplify createCouncilFinalize() factory call in tool-registry (no options)
- Update unit tests: replace collector mock assertions with direct output string checks
- Update integration tests: wrap JSON.parse with extractJson() helper for hybrid output
This commit is contained in:
ismeth
2026-03-01 18:36:27 +01:00
committed by YeonGyu-Kim
parent 951f004a65
commit 6e57d060e1
4 changed files with 95 additions and 135 deletions
+1 -2
View File
@@ -32,7 +32,6 @@ import {
createPrepareCouncilPromptTool,
} from "../tools"
import { createCouncilFinalize } from "../tools/council-archive"
import { contextCollector } from "../features/context-injector"
import { getMainSessionID } from "../features/claude-code-session-state"
import { filterDisabledTools } from "../shared/disabled-tools"
import { isTaskSystemEnabled, log } from "../shared"
@@ -282,7 +281,7 @@ export function createToolRegistry(args: {
...taskToolsRecord,
...hashlineToolsRecord,
prepare_council_prompt: createPrepareCouncilPromptTool(ctx.directory),
council_finalize: createCouncilFinalize(ctx.directory, { contextCollector }),
council_finalize: createCouncilFinalize(ctx.directory),
}
for (const toolDefinition of Object.values(allTools)) {