Files
oh-my-opencode/src/tools/AGENTS.md
T
YeonGyu-Kim 2dfa6336f5 fix(metis): switch primary model to claude-sonnet-4-6 + correct AGENTS.md inaccuracies
Source code change:
- src/shared/model-requirements.ts: prepend claude-sonnet-4-6 to metis fallback
  chain so Sonnet becomes the default. Opus 4.7 max remains as the immediate
  fallback for callers who want extra reasoning.
- src/shared/model-requirements.test.ts: update assertion to expect Sonnet
  primary + Opus secondary.

AGENTS.md accuracy fixes (verified against source):
- Agent modes: Sisyphus/Hephaestus are 'primary' (not 'all'); Sisyphus-Junior
  is 'subagent' (not 'all'). Confirmed via 'const MODE: AgentMode = ...' in
  each agent file. Also clarified Prometheus has no agentSources factory and
  is built via buildPrometheusAgentConfig.
- Sisyphus fallback chain: corrected order to kimi-k2.6 → k2p5 → kimi-k2.5
  → gpt-5.5 medium → glm-5 → big-pickle (was missing kimi-k2.5).
- Librarian/Explore: added missing minimax-m2.7 step between -highspeed and
  claude-haiku-4-5.
- Metis chain: removed fictitious gemini-3.1-pro entry.
- Sisyphus-Junior chain: spelled out the actual fallback (was 'user-configurable').
- Temperatures: Sisyphus/Hephaestus do not set explicit temperature (model
  default); Sisyphus-Junior is 0.1 via SISYPHUS_JUNIOR_DEFAULTS.
- Quick category default: gpt-5.4-mini (not gpt-5.4-mini-fast).

Team-mode corrections:
- Eligibility registry has 3 verdicts: eligible (sisyphus, atlas, sisyphus-junior),
  conditional (hephaestus — needs D-36 teammate permission), hard-reject
  (oracle, librarian, explore, multimodal-looker, metis, momus, prometheus).
- Schema has 11 fields, not 4: added max_messages_per_run, max_wall_clock_minutes,
  max_member_turns, base_dir, message_payload_max_bytes, recipient_unread_max_bytes,
  mailbox_poll_interval_ms.
- Hooks: 'team-session-events' is 4 sub-handlers in src/plugin/event.ts
  (team-idle-wake-hint, team-lead-orphan-handler, team-member-error-handler,
  team-member-status-handler), not a single Continuation-tier hook.
- Tier counts now show base + team-mode: ToolGuard 14/15, Transform 5/7.
- Total: 52 base hooks, 59 with team-mode.

Doc cascade for the Metis change:
- docs/guide/orchestration.md, agent-model-matching.md, installation.md
- docs/reference/configuration.md, features.md
2026-05-08 13:06:34 +09:00

5.7 KiB
Raw Blame History

src/tools/ — 2039 Tools Across 16 Directories

Generated: 2026-05-08

OVERVIEW

Tools registered via createToolRegistry() in src/plugin/. Two patterns: factory functions (createXXXTool) for most tools, direct ToolDefinition exports for the 6 LSP tools and interactive_bash. The total exposed count varies between 20 (minimum) and 39 (with all flags on) based on config gates listed below.

TOOL CATALOG

Always On (20)

Group Tools
LSP (6) lsp_goto_definition, lsp_find_references, lsp_symbols, lsp_diagnostics, lsp_prepare_rename, lsp_rename
Search (4) grep, glob, ast_grep_search, ast_grep_replace
Sessions (4) session_list, session_read, session_search, session_info
Background tasks (2) background_output, background_cancel
Delegation (2) task (delegate, full skill+category support), call_omo_agent (named agent only: explore, librarian)
Skills/MCP (2) skill (load skill or invoke command), skill_mcp (call skill-embedded MCP tool/resource/prompt)

Conditional (up to +19)

Tool(s) Gate Source
look_at not in disabled_agents for multimodal-looker look-at/
interactive_bash isInteractiveBashEnabled(config) (tmux config) interactive-bash/
task_create, task_get, task_list, task_update experimental.task_system task/
edit (hashline-edit) hashline_edit: true hashline-edit/
12 team_* tools team_mode.enabled: true ../features/team-mode/tools/

12 team_* Tools (when team_mode enabled)

Tool Purpose
team_create Spawn team + member sessions from a TeamSpec (named or inline)
team_delete Tear down — removes mailbox, tasklist, worktrees, optional tmux layout
team_shutdown_request Member or lead requests its own shutdown
team_approve_shutdown Lead acks a pending shutdown
team_reject_shutdown Lead rejects a shutdown with reason
team_send_message Async message to specific member or * broadcast
team_task_create Create task on shared list
team_task_list List tasks (filter by status, owner)
team_task_update Claim/complete/delete (atomic file lock)
team_task_get Fetch single task
team_status Full team run status (members, tasks, mailbox)
team_list List declared + active teams

DELEGATION CATEGORIES (built-in 8)

task (delegate) selects model by category. Default category models live in provider-specific files under src/tools/delegate-task/ and aggregate via BUILTIN_CATEGORIES in builtin-categories.ts. Authoritative fallback chains in src/shared/model-requirements.ts CATEGORY_MODEL_REQUIREMENTS.

Category Default Model Source File Domain
visual-engineering google/gemini-3.1-pro (variant: high) google-categories.ts Frontend, UI/UX
ultrabrain openai/gpt-5.5 (variant: xhigh) openai-categories.ts Hard logic / heavy reasoning
deep openai/gpt-5.5 (variant: medium) openai-categories.ts Autonomous multi-step problem-solving
artistry google/gemini-3.1-pro (variant: high) google-categories.ts Creative / unconventional approaches
quick openai/gpt-5.4-mini openai-categories.ts Trivial single-file changes
unspecified-low anthropic/claude-sonnet-4-6 anthropic-categories.ts Moderate effort fallback
unspecified-high anthropic/claude-opus-4-7 (variant: max) anthropic-categories.ts High effort fallback
writing kimi-for-coding/k2p5 (default) → gemini-3-flash (first fallback) kimi-categories.ts Documentation, prose

User-defined categories declared in categories: { ... } config override and extend this set.

TOOL DIR LAYOUT

tools/
├── ast-grep/             # ast_grep_search, ast_grep_replace
├── background-task/      # background_output, background_cancel (LLM interface; engine in features/background-agent)
├── call-omo-agent/       # call_omo_agent (explore + librarian only)
├── delegate-task/        # task — full delegation with categories + skills
├── glob/                 # glob (60s timeout, 100 file limit)
├── grep/                 # grep (60s timeout, 10MB limit)
├── hashline-edit/        # edit — hash-anchored line edits with LINE#ID validation
├── interactive-bash/     # interactive_bash — tmux session control
├── look-at/              # look_at — image/PDF analysis
├── lsp/                  # 6 LSP tools (direct ToolDefinition)
├── session-manager/      # 4 session_* tools
├── skill/                # skill — load skill or run command
├── skill-mcp/            # skill_mcp — call skill-embedded MCP servers
├── slashcommand/         # discoverCommandsSync — feeds skill tool with /-command list
├── task/                 # 4 task_* tools (Sisyphus task system)
└── index.ts              # barrel exports

ADDING A NEW TOOL

  1. Create src/tools/{name}/index.ts with factory createXXXTool
  2. Add types.ts for parameter Zod schemas
  3. Add tools.ts (or single index.ts) for implementation
  4. Export factory from src/tools/index.ts
  5. Register in src/plugin/tool-registry.ts:
    • Always-on: spread into allTools directly
    • Conditional: build a Record<string, ToolDefinition> and gate-spread
  6. If the tool needs disabling, ensure it appears in filterDisabledTools allow-list (its name will be matched against disabled_tools)