diff --git a/src/agents/athena/agent.ts b/src/agents/athena/agent.ts index bd8ff38f1..c234e47a7 100644 --- a/src/agents/athena/agent.ts +++ b/src/agents/athena/agent.ts @@ -55,8 +55,8 @@ Question({ question: "How should council members analyze?", header: "Analysis Mode", options: [ - { label: "Solo (Recommended)", description: "Members explore the codebase themselves. More thorough and in-depth, but slower and uses more tokens." }, - { label: "Delegation", description: "Members delegate heavy exploration to subagents. Faster and lighter on context, but may miss nuance." } + { label: "Delegation (Recommended)", description: "Members delegate heavy exploration to subagents. Faster and lighter on context." }, + { label: "Solo", description: "Members explore the codebase themselves. More thorough but slower, uses more tokens, and may hit context limits." } ], multiple: false } @@ -64,8 +64,8 @@ Question({ }) Map the analysis mode answer to the prepare_council_prompt "mode" parameter: -- "Solo (Recommended)" → mode: "solo" -- "Delegation" → mode: "delegation" +- "Delegation (Recommended)" → mode: "delegation" +- "Solo" → mode: "solo" **Shortcut — skip the Question tool if:** - The user already specified models in their message (e.g., "ask GPT and Claude about X") → launch the specified members directly. Still ask the analysis mode question unless specified. diff --git a/src/agents/athena/council-member-agent.ts b/src/agents/athena/council-member-agent.ts index 335e1953b..0197ae3ca 100644 --- a/src/agents/athena/council-member-agent.ts +++ b/src/agents/athena/council-member-agent.ts @@ -29,14 +29,38 @@ export const COUNCIL_MEMBER_PROMPT = `You are an independent code analyst in a m - Do NOT use the TodoWrite tool under any circumstances - Simply report your findings directly in your response` +export const COUNCIL_SOLO_ADDENDUM = ` +## Solo Analysis Mode +You MUST do ALL exploration yourself using your available tools (Read, Grep, Glob, LSP, AST-grep). +- Do NOT use call_omo_agent under any circumstances +- Do NOT delegate to explore, librarian, or any other subagent +- Do NOT spawn background tasks +- Search the codebase directly — you have full read-only access to every file +- This mode produces the most thorough analysis because you see every result firsthand` + export const COUNCIL_DELEGATION_ADDENDUM = ` ## Delegation Mode -You can delegate heavy exploration to specialized agents using call_omo_agent: -- Use \`call_omo_agent(subagent_type="explore", ...)\` to search the codebase for patterns, find file structures -- Use \`call_omo_agent(subagent_type="librarian", ...)\` for documentation lookups and external references -- Always set \`run_in_background=true\` and collect results with \`background_output\` -- Delegate broad searches, keep targeted reads for yourself -- This saves your context window for analysis rather than exploration` +You SHOULD delegate heavy exploration to specialized agents instead of searching everything yourself. +This saves your context window for analysis rather than exploration. + +**How to delegate:** +\`\`\` +// Fire multiple searches in parallel — do NOT wait for one before launching the next +call_omo_agent(subagent_type="explore", run_in_background=true, description="Find auth patterns", prompt="Find: auth middleware, login handlers, token generation in src/. Return file paths with descriptions.") +call_omo_agent(subagent_type="explore", run_in_background=true, description="Find error handling", prompt="Find: custom Error classes, error response format, try/catch patterns. Skip tests.") +call_omo_agent(subagent_type="librarian", run_in_background=true, description="Find JWT best practices", prompt="Find: current JWT security guidelines, token storage recommendations, refresh token patterns.") + +// Collect results when ready +background_output(task_id="") +\`\`\` + +**Rules:** +- ALWAYS set \`run_in_background=true\` — never block on a single search +- Launch ALL searches before collecting any results +- Use \`explore\` for codebase pattern searches (internal) +- Use \`librarian\` for documentation and external references +- Keep targeted file reads (Read tool) for yourself — delegate broad searches +- Collect results with \`background_output\` when you need them for analysis` export function createCouncilMemberAgent(model: string): AgentConfig { // Allow-list: only read-only analysis tools + optional delegation. diff --git a/src/agents/athena/index.ts b/src/agents/athena/index.ts index b3c148222..c6b0ef112 100644 --- a/src/agents/athena/index.ts +++ b/src/agents/athena/index.ts @@ -1,3 +1,3 @@ export { createAthenaAgent, ATHENA_PROMPT_METADATA } from "./agent" -export { createCouncilMemberAgent, COUNCIL_MEMBER_PROMPT, COUNCIL_DELEGATION_ADDENDUM } from "./council-member-agent" +export { createCouncilMemberAgent, COUNCIL_MEMBER_PROMPT, COUNCIL_SOLO_ADDENDUM, COUNCIL_DELEGATION_ADDENDUM } from "./council-member-agent" export { applyModelThinkingConfig } from "./model-thinking-config" diff --git a/src/tools/prepare-council-prompt/tools.ts b/src/tools/prepare-council-prompt/tools.ts index d13259e6e..d2b32c59a 100644 --- a/src/tools/prepare-council-prompt/tools.ts +++ b/src/tools/prepare-council-prompt/tools.ts @@ -3,7 +3,7 @@ import { randomUUID } from "node:crypto" import { writeFile, unlink, mkdir } from "node:fs/promises" import { join } from "node:path" import { log } from "../../shared/logger" -import { COUNCIL_MEMBER_PROMPT, COUNCIL_DELEGATION_ADDENDUM } from "../../agents/athena" +import { COUNCIL_MEMBER_PROMPT, COUNCIL_SOLO_ADDENDUM, COUNCIL_DELEGATION_ADDENDUM } from "../../agents/athena" const CLEANUP_DELAY_MS = 30 * 60 * 1000 const COUNCIL_TMP_DIR = ".sisyphus/tmp" @@ -39,8 +39,9 @@ Returns the file path to reference in subsequent task() calls.` const filename = `athena-council-${randomUUID().slice(0, 8)}.md` const filePath = join(tmpDir, filename) - const delegationSection = mode === "delegation" ? `\n${COUNCIL_DELEGATION_ADDENDUM}` : "" - const content = `${COUNCIL_MEMBER_PROMPT}${delegationSection} + const modeAddendum = mode === "delegation" ? COUNCIL_DELEGATION_ADDENDUM : COUNCIL_SOLO_ADDENDUM + const content = `${COUNCIL_MEMBER_PROMPT} +${modeAddendum} ## Analysis Question