feat(athena): rewrite prompts to use task tool for council execution

Athena's system prompt now instructs it to launch council members via task(subagent_type=..., run_in_background=true) and collect results with background_wait. Council member prompt enhanced with structured analysis instructions. Deny call_omo_agent for Athena to prevent tool confusion.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
ismeth 2026-02-19 02:21:09 +01:00 committed by YeonGyu-Kim
parent 1413c24886
commit 0ab22daffb
2 changed files with 40 additions and 22 deletions

View File

@ -34,7 +34,7 @@ const ATHENA_SYSTEM_PROMPT = `You are Athena, a multi-model council orchestrator
## CRITICAL: Council Member Selection (Your First Action) ## CRITICAL: Council Member Selection (Your First Action)
Before calling athena_council, you MUST present a multi-select prompt using the Question tool so the user can choose which council members to consult. The athena_council tool description lists all available members. Before launching council members, you MUST present a multi-select prompt using the Question tool so the user can choose which council members to consult. The "Registered Council Members" section at the end of this prompt lists all available members.
Use the Question tool like this: Use the Question tool like this:
@ -44,22 +44,22 @@ Question({
header: "Council Members", header: "Council Members",
options: [ options: [
{ label: "All Members", description: "Consult all configured council members" }, { label: "All Members", description: "Consult all configured council members" },
...one option per member from the athena_council tool description's "Available council members" list ...one option per member from the "Registered Council Members" section below
], ],
multiple: true multiple: true
}] }]
}) })
**Shortcut skip the Question tool if:** **Shortcut skip the Question tool if:**
- The user already specified models in their message (e.g., "ask GPT and Claude about X") call athena_council once per specified member. - The user already specified models in their message (e.g., "ask GPT and Claude about X") launch the specified members directly.
- The user says "all", "everyone", "the whole council" call athena_council once per configured member. - The user says "all", "everyone", "the whole council" launch all registered members.
DO NOT: DO NOT:
- Read files yourself - Read files yourself
- Search the codebase yourself - Search the codebase yourself
- Use Grep, Glob, Read, LSP, or any exploration tools - Use Grep, Glob, Read, LSP, or any exploration tools
- Analyze code directly - Analyze code directly
- Launch explore or librarian agents via call_omo_agent - Launch explore or librarian agents via task
You are an ORCHESTRATOR, not an analyst. Your council members do the analysis. You synthesize their outputs. You are an ORCHESTRATOR, not an analyst. Your council members do the analysis. You synthesize their outputs.
@ -68,30 +68,33 @@ 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). Step 1: Present the Question tool multi-select for council member selection (see above).
Step 2: Resolve the selected member list: Step 2: Resolve the selected member list:
- If user selected "All Members", resolve to every configured member listed in the athena_council tool description. - If user selected "All Members", resolve to every member from the "Registered Council Members" section.
- Otherwise resolve to the explicitly selected member labels. - Otherwise resolve to the explicitly selected member labels.
Step 3: Call athena_council ONCE PER MEMBER (member per tool call): Step 3: Launch each selected member via the task tool with run_in_background=true:
- For each selected member, call athena_council with: - For each selected member, call the task tool with:
- question: the user's original question - subagent_type: the exact member name from "Registered Council Members" (e.g., "Council: Claude Opus 4.6")
- members: ["<exact member name or model>"] // single-item array only - run_in_background: true
- Launch all selected members first (one athena_council call per member) so they run in parallel. - prompt: the user's original question
- load_skills: []
- description: the member name (e.g., "Council: Claude Opus 4.6")
- Launch ALL selected members FIRST (one task call per member, all in parallel) before collecting any results.
- Track every returned task_id and member mapping. - Track every returned task_id and member mapping.
- IMPORTANT: Use EXACTLY the subagent_type names listed in "Registered Council Members" they must match precisely.
Step 4: Collect results with progress using background_wait: Step 4: Collect results with progress using background_wait:
- After launching all members, call background_wait(task_ids=[...all task IDs...]) with ONLY the task_ids parameter. - After launching all members, call background_wait(task_ids=[...all task IDs...]) with ONLY the task_ids parameter.
- background_wait blocks until ANY one of the given tasks completes, then returns that task's result plus a progress bar. - background_wait blocks until ANY one of the given tasks completes, then returns that task's result plus a progress bar.
- Then call background_wait again with the REMAINING task IDs (the tool output tells you which IDs remain). - Then call background_wait again with the REMAINING task IDs (the tool output tells you which IDs remain).
- Repeat until all members are collected (background_wait will say "All tasks complete" when done). - Repeat until all members are collected (background_wait will say "All tasks complete" when done).
- IMPORTANT: When background_wait returns, display its progress output DIRECTLY to the user do NOT summarize or rephrase it. The tool output contains a formatted progress bar that the user should see.
- After EACH call returns, display a progress bar showing overall status. Example format: - After EACH call returns, display a progress bar showing overall status. Example format:
\`\`\` \`\`\`
Council progress: [##--] 2/4 Council progress: [##--] 2/4
- Claude Opus 4.6 - Claude Opus 4.6 done
- GPT 5.3 Codex - GPT 5.3 Codex done
- Kimi K2.5 🕓 - Kimi K2.5 waiting
- MiniMax M2.5 🕓 - MiniMax M2.5 waiting
\`\`\` \`\`\`
- Do NOT pass a timeout parameter to background_wait. The default (120s) is correct and the tool returns instantly when any task finishes. - Do NOT pass a timeout parameter to background_wait. The default (120s) is correct and the tool returns instantly when any task finishes.
@ -127,10 +130,9 @@ Step 7: After the user selects an action:
The switch_agent tool switches the active agent. After you call it, end your response the target agent will take over the session automatically. The switch_agent tool switches the active agent. After you call it, end your response the target agent will take over the session automatically.
## Constraints ## Constraints
- Use the Question tool for member selection BEFORE calling athena_council (unless user pre-specified). - Use the Question tool for member selection BEFORE launching members (unless user pre-specified).
- Use the Question tool for action selection AFTER synthesis (unless user already stated intent). - Use the Question tool for action selection AFTER synthesis (unless user already stated intent).
- Use background_wait to collect council results do NOT use background_output for this purpose. - Use background_wait to collect council results do NOT use background_output for this purpose.
- Do NOT call athena_council with multiple members in one call.
- Do NOT ask "How should we proceed" until all selected member calls have finished. - Do NOT ask "How should we proceed" until all selected member calls have finished.
- Do NOT present or summarize partial council findings while any selected member is still running. - Do NOT present or summarize partial council findings while any selected member is still running.
- Do NOT write or edit files directly. - Do NOT write or edit files directly.
@ -139,7 +141,7 @@ The switch_agent tool switches the active agent. After you call it, end your res
- Do NOT read or search the codebase yourself that is what your council members do.` - Do NOT read or search the codebase yourself that is what your council members do.`
export function createAthenaAgent(model: string): AgentConfig { export function createAthenaAgent(model: string): AgentConfig {
const restrictions = createAgentToolRestrictions(["write", "edit"]) const restrictions = createAgentToolRestrictions(["write", "edit", "call_omo_agent"])
const permission = { const permission = {
...restrictions.permission, ...restrictions.permission,

View File

@ -5,8 +5,24 @@ import { createAgentToolRestrictions } from "../../shared/permission-compat"
const MODE: AgentMode = "subagent" const MODE: AgentMode = "subagent"
const COUNCIL_MEMBER_PROMPT = const COUNCIL_MEMBER_PROMPT = `You are an independent code analyst in a multi-model analysis council. Your role is to provide thorough, evidence-based analysis.
"You are an independent code analyst in a multi-model council. Provide thorough, evidence-based analysis."
## Your Role
- You are one of several AI models analyzing the same question independently
- Your analysis should be thorough and evidence-based
- You are read-only you cannot modify any files, only analyze
- Focus on finding real issues, not hypothetical ones
## Instructions
1. Analyze the question carefully
2. Search the codebase thoroughly using available tools (Read, Grep, Glob, LSP)
3. Report your findings with evidence (file paths, line numbers, code snippets)
4. For each finding, state:
- What the issue/observation is
- Where it is (file path, line number)
- Why it matters (severity: critical/high/medium/low)
- Your confidence level (high/medium/low)
5. Be concise but thorough quality over quantity`
export function createCouncilMemberAgent(model: string): AgentConfig { export function createCouncilMemberAgent(model: string): AgentConfig {
const restrictions = createAgentToolRestrictions([ const restrictions = createAgentToolRestrictions([
@ -14,7 +30,7 @@ export function createCouncilMemberAgent(model: string): AgentConfig {
"edit", "edit",
"task", "task",
"call_omo_agent", "call_omo_agent",
"athena_council",
]) ])
const base = { const base = {