fix(athena): harden council members — compaction recovery, block TodoWrite, analysis mode

- Add session.compacted handler in BackgroundManager to prevent premature
  task completion after compaction (defer first post-compaction idle)
- Explicitly block TodoWrite/TodoRead for council members in all sync
  points (AgentConfig permission + session tools + prompt instructions)
- Add council member prefix check to todo-continuation-enforcer skip list
  to prevent infinite continuation loops on completed council members
- Add optional analysis mode (solo/delegation) question to Athena setup:
  solo = thorough but heavier, delegation = fast via explore/librarian
- Allow call_omo_agent in council member allow-list for delegation mode
- Update COUNCIL_MEMBER_PROMPT with TodoWrite prohibition and delegation
  addendum for when delegation mode is selected
- Update prepare_council_prompt tool with mode parameter
This commit is contained in:
ismeth
2026-02-23 19:42:56 +01:00
committed by YeonGyu-Kim
parent c75ae6bffd
commit fb543f88d5
7 changed files with 109 additions and 24 deletions
+24 -2
View File
@@ -22,10 +22,26 @@ export const COUNCIL_MEMBER_PROMPT = `You are an independent code analyst in a m
- 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`
5. Be concise but thorough — quality over quantity
## CRITICAL: Do NOT use TodoWrite
- Do NOT create todos or task lists
- Do NOT use the TodoWrite tool under any circumstances
- Simply report your findings directly in your response`
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`
export function createCouncilMemberAgent(model: string): AgentConfig {
// Allow-list: only read-only analysis tools. Everything else is denied via `*: deny`.
// Allow-list: only read-only analysis tools + optional delegation.
// Everything else is denied via `*: deny`.
// TodoWrite/TodoRead explicitly denied to prevent uncompletable todo loops.
const restrictions = createAgentToolAllowlist([
"read",
"grep",
@@ -35,8 +51,14 @@ export function createCouncilMemberAgent(model: string): AgentConfig {
"lsp_symbols",
"lsp_diagnostics",
"ast_grep_search",
"call_omo_agent",
])
// Explicitly deny TodoWrite/TodoRead even though `*: deny` should catch them.
// Built-in OpenCode tools may bypass the wildcard deny.
restrictions.permission.todowrite = "deny"
restrictions.permission.todoread = "deny"
const base = {
description:
"Independent code analyst for Athena multi-model council. Read-only, evidence-based analysis. (Council Member - OhMyOpenCode)",