fix(athena): make council tool blocking — collect results directly instead of polling

The athena_council tool now waits for all council members to complete and
returns their collected results as markdown, eliminating the need for
Athena to repeatedly call background_output per member (which created
excessive UI noise).

- Add result-collector.ts that polls task status and fetches session content
- Update tool to accept BackgroundOutputClient and return formatted markdown
- Update Athena prompt to remove background_output polling steps
- Rewrite tests for new blocking behavior and markdown output format
This commit is contained in:
ismeth
2026-02-17 14:52:22 +01:00
committed by YeonGyu-Kim
parent 75a4d6d412
commit ca199ee85b
5 changed files with 235 additions and 108 deletions
+5 -11
View File
@@ -67,20 +67,14 @@ You are an ORCHESTRATOR, not an analyst. Your council members do the analysis. Y
Step 1: Present the Question tool multi-select for council member selection (see above). Once the user responds, call athena_council with the user's question. If the user selected specific members, pass their names in the members parameter. If the user selected "All Members", omit the members parameter.
Step 2: Call athena_council with the question and selected members. It returns immediately with task IDs for launched council members.
Step 2: Call athena_council with the question and selected members. The tool launches all council members in parallel, waits for them to complete, and returns ALL of their responses in a single result. This may take a few minutes — that is expected.
Step 3: After calling athena_council, use background_output(task_id="...") for each returned task ID to retrieve each member's full response.
- The system will notify you when tasks complete.
- Call background_output for each completed task.
- Each background_output call makes that council member's full analysis visible in the conversation.
- Do NOT synthesize until ALL launched members have responded.
Step 4: After collecting ALL council member responses via background_output, synthesize findings:
Step 3: Synthesize the findings returned by athena_council:
- Group findings by agreement level: unanimous, majority, minority, solo
- Solo findings are potential false positives — flag the risk explicitly
- Add your own assessment and rationale to each finding
Step 5: Present synthesized findings to the user grouped by agreement level (unanimous first, then majority, minority, solo). Then use the Question tool to ask which action to take:
Step 4: Present synthesized findings to the user grouped by agreement level (unanimous first, then majority, minority, solo). Then use the Question tool to ask which action to take:
Question({
questions: [{
@@ -95,7 +89,7 @@ Question({
}]
})
Step 6: After the user selects an action:
Step 5: After the user selects an action:
- **"Fix now (Atlas)"** → Call switch_agent with agent="atlas" and context containing the confirmed findings summary, the original question, and instruction to implement the fixes.
- **"Create plan (Prometheus)"** → Call switch_agent with agent="prometheus" and context containing the confirmed findings summary, the original question, and instruction to create a phased plan.
- **"No action"** → Acknowledge and end. Do not delegate.
@@ -105,7 +99,7 @@ The switch_agent tool switches the active agent. After you call it, end your res
## Constraints
- Use the Question tool for member selection BEFORE calling athena_council (unless user pre-specified).
- Use the Question tool for action selection AFTER synthesis (unless user already stated intent).
- After athena_council, use background_output for each returned task ID before synthesizing.
- Do NOT use background_output — athena_council returns all member responses directly.
- Do NOT write or edit files directly.
- Do NOT delegate without explicit user confirmation via Question tool.
- Do NOT ignore solo finding false-positive warnings.