fix: sync council-member tool restrictions across all layers, optimize athena guards
- Add switch_agent/background_wait to agent-tool-restrictions.ts (boolean format) - Add dynamic council member name matching via COUNCIL_MEMBER_KEY_PREFIX - Move athena question permission from hardcoded to tool-config-handler (CLI-mode aware) - Rename appendMissingCouncilPrompt -> applyMissingCouncilGuard - Optimize tool-execute-before: check hasPendingCouncilMembers before resolving session agent - Add fallback_models to council-member/athena in schema.json - Remove unused createAthenaAgent export from agents/index.ts - Add cross-reference comments for restriction sync points
This commit is contained in:
@@ -203,17 +203,21 @@ The switch_agent tool switches the active agent. After you call it, end your res
|
||||
- Do NOT ask any post-synthesis questions until all selected member calls have finished.
|
||||
- Do NOT present or summarize partial council findings while any selected member is still running.
|
||||
- Do NOT write or edit files directly.
|
||||
- Do NOT delegate without explicit user confirmation via Question tool.
|
||||
- Do NOT delegate without explicit user confirmation via Question tool, unless in non-interactive mode (where auto-delegation applies per the non-interactive rules above).
|
||||
- Do NOT ignore solo finding false-positive warnings.
|
||||
- Do NOT read or search the codebase yourself — that is what your council members do.
|
||||
- When handing off to Atlas/Prometheus, include ONLY the selected findings in context — not all findings.`
|
||||
|
||||
export function createAthenaAgent(model: string): AgentConfig {
|
||||
// NOTE: Athena/council tool restrictions are also defined in:
|
||||
// - src/shared/agent-tool-restrictions.ts (boolean format for session.prompt)
|
||||
// - src/plugin-handlers/tool-config-handler.ts (allow/deny string format)
|
||||
// Keep all three in sync when modifying.
|
||||
const restrictions = createAgentToolRestrictions(["write", "edit", "call_omo_agent"])
|
||||
|
||||
// question permission is set by tool-config-handler.ts based on CLI mode (allow/deny)
|
||||
const permission = {
|
||||
...restrictions.permission,
|
||||
question: "allow",
|
||||
} as AgentConfig["permission"]
|
||||
|
||||
const base = {
|
||||
|
||||
@@ -29,7 +29,7 @@ import { maybeCreateSisyphusConfig } from "./builtin-agents/sisyphus-agent"
|
||||
import { maybeCreateHephaestusConfig } from "./builtin-agents/hephaestus-agent"
|
||||
import { maybeCreateAtlasConfig } from "./builtin-agents/atlas-agent"
|
||||
import { registerCouncilMemberAgents } from "./builtin-agents/council-member-agents"
|
||||
import { appendMissingCouncilPrompt } from "./builtin-agents/athena-council-guard"
|
||||
import { applyMissingCouncilGuard } from "./builtin-agents/athena-council-guard"
|
||||
import type { CouncilConfig } from "../config/schema/athena"
|
||||
|
||||
type AgentSource = AgentFactory | AgentConfig
|
||||
@@ -207,12 +207,12 @@ export async function createBuiltinAgents(
|
||||
prompt: (result["athena"].prompt ?? "") + councilTaskInstructions,
|
||||
}
|
||||
} else {
|
||||
result["athena"] = appendMissingCouncilPrompt(result["athena"], skippedMembers)
|
||||
result["athena"] = applyMissingCouncilGuard(result["athena"], skippedMembers)
|
||||
}
|
||||
} else if (councilConfig?.members && councilConfig.members.length >= 2 && !result["athena"]) {
|
||||
log("[builtin-agents] Skipping council member registration — Athena is disabled")
|
||||
} else if (result["athena"]) {
|
||||
result["athena"] = appendMissingCouncilPrompt(result["athena"])
|
||||
result["athena"] = applyMissingCouncilGuard(result["athena"])
|
||||
}
|
||||
|
||||
return result
|
||||
|
||||
@@ -45,7 +45,7 @@ After informing the user, **end your turn**. Do NOT try to work around this by u
|
||||
* The original prompt is discarded to avoid contradictory instructions.
|
||||
* Used when Athena is registered but no valid council config exists.
|
||||
*/
|
||||
export function appendMissingCouncilPrompt(
|
||||
export function applyMissingCouncilGuard(
|
||||
athenaConfig: AgentConfig,
|
||||
skippedMembers?: Array<{ name: string; reason: string }>,
|
||||
): AgentConfig {
|
||||
|
||||
Reference in New Issue
Block a user