Updates the canonical Anthropic Opus model in every fallback chain
(sisyphus, oracle, prometheus, metis, momus, visual-engineering,
ultrabrain, deep, artistry, unspecified-high), the unspecified-high
category default, the think-mode HIGH_VARIANT_MAP, the Claude Code
alias map, the claude-thinking legacy alias, the context-limit GA
regex, and event.ts fallback strings.
Widens supportsCachedAnthropicLimit to accept both claude-*-4-6 and
claude-*-4-7 so the 1M context cache still applies across the bump.
Regenerates the bundled model-capabilities snapshot from models.dev
and the model-fallback snapshot to match the new source output.
When replace_plan is true (default), the native plan agent was demoted to
subagent but remained visible in the agent picker. This caused Sisyphus to
route planning to the native plan agent instead of Prometheus.
Add hidden: true to buildPlanDemoteConfig(), consistent with how the build
agent is hidden when default_builder_enabled is false.
- Modified agent-config-handler.ts to load and integrate both new agent sources
- Added loadAgentDefinitions() and readOpencodeConfigAgents() calls in loading phase
- Integrated both sources into agent precedence chains (both Sisyphus-enabled and disabled paths)
- Added detailed logging for new agent sources
- Added filtering logic to respect disabled_agents configuration
- Extended agent-config-handler.test.ts with 7 new integration tests
- All tests passing (18/18 integration, 65/65 loader suite)
Wave 3 of agent definitions enhancement complete.
Reverts getAgentDisplayName back to getAgentRuntimeName in the remapper
and default_agent assignment. OpenCode sorts agents by name via
localeCompare, so ZWSP prefixes in the name field are required to
preserve canonical core agent order (sisyphus > hephaestus > prometheus > atlas).
agent-key-remapper now unconditionally injects getAgentRuntimeName()
into the name field, ensuring OpenCode's localeCompare sort preserves
canonical core agent order even when builtin configs omit name.
Also fixes 3 pre-existing test failures where builtinSisyphusConfig
expected the original name to survive remapping.
- Replace getAgentRuntimeName with getAgentDisplayName for consistency
- Add stripAgentListSortPrefix helper to normalize agent names
- Strip sort prefixes in subagent-resolver and sync-executor
- Backfill canonical names for core agents when builtin configs omit name
- Update tests to match new behavior
The canonical agent order is: sisyphus → hephaestus → prometheus → atlas
Changes:
- Export CANONICAL_CORE_AGENT_ORDER as single source of truth
- Sort non-core agents alphabetically for deterministic ordering
- Add 12 regression tests including 100-permutation stability test
This permanently resolves the agent ordering saga that caused 15+ commits,
8+ PRs, and multiple reverts due to ZWSP prefixes, Object.entries() order
dependencies, and inconsistent merge sequences.
Closes#3281
Remap the core agent keys, default agent, and command routing back to\nlist display names so OpenCode's name-based sorting keeps the\ncanonical Sisyphus -> Hephaestus -> Prometheus -> Atlas order.\n\nAlso teach tool config lookups to resolve the prefixed list keys and\nadd regression tests that exercise the real ordering and routing path.
model-resolver.test.ts and prometheus-agent-config-builder.test.ts use
spyOn(shared, 'log') but do not own the logger module. When other test
files in the same bun test process call mock.module('../shared/logger'),
the import cache is poisoned and the spyOn targets a stale binding.
Add a lightweight mock.module call at the top of each file so the
auto-detection in run-ci-tests.ts picks them up as isolated targets.
This ensures each file gets its own module instance and the spy
captures all calls correctly.
Fixes the flaky CI failure pattern where resolveModelWithFallback and
buildPrometheusAgentConfig tests pass locally (separate bun process)
but fail in the shared CI batch.
Agent names in the config.agent object (which becomes the /agent API
response) contained invisible Zero-Width Space (U+200B) characters
baked in by getAgentListDisplayName(). These ZWSP prefixes were used
for TUI sort ordering, but they leaked into the public API surface.
Impact: any prompt_async consumer that discovered agent names via the
/agent endpoint and passed them back to prompt_async without manual
ZWSP stripping got silent message drops — the agent name didn't match.
hy-pony's feishu-bridge integration went dark after upgrading to 3.16.0
with no error, no warning, and no indication that invisible Unicode
characters in agent names were the cause.
Fix: switch all four callsites from getAgentListDisplayName() (which
prepends \u200B×N) to getAgentDisplayName() (clean names):
- agent-key-remapper.ts: config keys → display names (was the primary
injection point)
- agent-priority-order.ts: CORE_AGENT_ORDER lookup (must agree with
the keys emitted by the remapper)
- command-config-handler.ts: command agent field normalization
- tool-config-handler.ts: agent config lookup (simplified fallback
chain since the primary lookup is now clean)
Sort ordering is preserved by:
1. JS object insertion order from reorderAgentsByPriority()
2. The injected `order` field (1-4) added by injectOrderField()
getAgentListDisplayName() is marked @deprecated with a link to #3238.
AGENT_LIST_SORT_PREFIXES and stripAgentListSortPrefix() are kept for
any internal callers that strip prefixes from legacy data.
Closes#3238
agent-config-handler.ts now registers custom agents from
~/.config/opencode/agents/ into the task subagent registry.
5005 tests pass, tsc clean.
Closes#2689
Display names with parentheses like 'Atlas (Plan Executor)' cause HTTP
header validation errors in x-opencode-agent-name. This was blocking
Atlas/Prometheus from working via /start-work and auto-retry.
Changes:
- Display names: parens -> dashes ('Atlas - Plan Executor')
- Hooks (start-work, no-hephaestus-non-gpt, no-sisyphus-gpt): use
config keys ('atlas', 'sisyphus', 'hephaestus') for agent API fields
- auto-retry: use config key instead of display name for promptAsync
- agent-override-protection: handle dash-suffix normalization
- Updated all test expectations to match new format
Closes#3138
Prevent ZWSP sort prefixes from leaking into stored agent names, config
key lookups, and override-protection normalization. Ensures prefixed
list-display names resolve correctly throughout the pipeline.
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) assistance
Populate AGENT_LIST_SORT_PREFIXES for sisyphus/hephaestus/prometheus/atlas
so the TUI agent list renders in canonical order. Update dependent tests
to use getAgentListDisplayName() instead of hardcoded display strings.
🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) assistance
Extract hephaestus into agentConfig before prometheus so the config
handler naturally assembles agents in the canonical order instead of
relying solely on reorderAgentsByPriority to fix the wrong intermediate
order. Also fix test data that had atlas/prometheus swapped and add
missing hephaestus to agent-config-integration test lists.
- Fix zod/v4 imports in background-task schema tests
- Remove ZWSP prefix from agent-key-remapper test (fixed in #3136)
- Use toMatchObject for openai-only catalog tests (fallback_models added by #3144)
- Replace z.toJSONSchema (zod v4) with zodToJsonSchema (zod v3 compat)
- Fix task-list.ts type narrowing for zod v3 inferred types
Previously, Claude Code's .mcp.json would silently override OpenCode user
config when MCP server names collided. This was unexpected behavior since
users expect their explicit OpenCode configuration to take precedence.
Changes:
1. Swapped merge order: Claude Code .mcp.json is now merged BEFORE user
config, so user config wins on collision
2. Added warning log when user config overrides a Claude Code MCP server:
'warning: MCP server X from user config overrides Claude Code .mcp.json'
3. Added comprehensive tests for collision scenarios
Fixes#2946
Previously, Prometheus always used params.currentModel (UI-selected model)
when no explicit configuration existed. This bypassed the intended fallback
chain (claude-opus-4-6 → gpt-5.4 → glm-5 → gemini-3.1-pro).
Now, the UI-selected model is only used if it matches one of the models
in Prometheus's fallback chain. Otherwise, the fallback chain resolution
takes over and finds an available model.
Fixes#2986