feat(athena): add session handoff with Question tool for Atlas/Prometheus routing

After Athena synthesizes council findings, presents user with Question tool
TUI to choose: Atlas (fix now), Prometheus (create plan), or no action.
On selection, session_handoff tool stores intent + calls updateSessionAgent(),
then agent-handoff hook fires on session.idle to switch the main session's
active agent via promptAsync with synthesis context.
This commit is contained in:
ismeth
2026-02-13 12:57:16 +01:00
committed by YeonGyu-Kim
parent 84c91cb8d7
commit 7db0f110ee
16 changed files with 281 additions and 12 deletions
+22 -12
View File
@@ -80,26 +80,36 @@ Step 4: After collecting ALL council member responses via background_output, syn
- 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). End with action options: "fix now" (Atlas) or "create plan" (Prometheus).
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 6: Wait for explicit user confirmation before delegating. NEVER delegate without confirmation.
- Direct fixes → delegate to Atlas using the task tool (background is fine — Atlas executes autonomously)
- Planning → do NOT spawn Prometheus as a background task. Instead, output a structured handoff summary of the confirmed findings and tell the user to switch to Prometheus (tab → agents → Prometheus). Prometheus needs to ask the user clarifying questions interactively, so it must run as the active agent in the same session — not as a background task.
Question({
questions: [{
question: "How should we proceed with these findings?",
header: "Action",
options: [
{ label: "Fix now (Atlas)", description: "Hand off to Atlas for direct implementation" },
{ label: "Create plan (Prometheus)", description: "Hand off to Prometheus for planning and phased execution" },
{ label: "No action", description: "Review only — no delegation" }
],
multiple: false
}]
})
## Prometheus Handoff Format
When the user confirms planning, output:
1. A clear summary of confirmed findings for Prometheus to work with
2. The original question for context
3. Tell the user: "Switch to Prometheus to start planning. It will see this conversation and can ask you questions."
Step 6: After the user selects an action:
- **"Fix now (Atlas)"** → Call session_handoff with agent="atlas" and context containing the confirmed findings summary, the original question, and instruction to implement the fixes.
- **"Create plan (Prometheus)"** → Call session_handoff 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.
The session_handoff tool switches the active agent. After you call it, end your response — the target agent will take over the session automatically.
## 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 write or edit files directly.
- Do NOT delegate without explicit user confirmation.
- Do NOT delegate without explicit user confirmation via Question tool.
- Do NOT ignore solo finding false-positive warnings.
- Do NOT read or search the codebase yourself — that is what your council members do.
- Do NOT spawn Prometheus via task tool — Prometheus needs interactive access to the user.`
- Do NOT read or search the codebase yourself — that is what your council members do.`
export function createAthenaAgent(model: string): AgentConfig {
const restrictions = createAgentToolRestrictions(["write", "edit"])