Filter host config agent aliases with the same protected builtin-name rules used for external agent sources so stale display-name entries cannot replace resolved user-configured models when team mode is enabled.
Fixes#4429
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Atlas was the only agent that bailed early (returning undefined) when
applyModelResolution returned undefined, even if the user had explicitly
configured agents.atlas.model. The general-agents.ts path already handled
this case by falling back to the user's override; sisyphus has its own
explicit-config check. Atlas had neither, so under edge cases (cold
provider cache, no system default, empty availableModels) Atlas was
silently dropped and OpenCode used its built-in default — surfaced as
the hardcoded claude-sonnet-4-6 in the reported bug.
This aligns atlas-agent.ts with the same defensive pattern used in
general-agents.ts: when resolution fails but the user has an explicit
model override, honor it directly instead of dropping the agent.
Adds a regression test covering the scenario where availableModels is
empty AND systemDefaultModel is undefined AND no provider cache exists.
default-mode (system-transform):
- e5463e2db introduced auto-activation of ultrawork+ralph-loop, and
dc2e082ac then skipped the ultrawork system prompt whenever ralph_loop
was also enabled. Net effect: the keyword-detector still showed
'Default ultrawork mode enabled' to the user, but the first turn had
none of the ultrawork behavior. Loop continuation kept the ultrawork
prefix, so the contract was honored only on later iterations.
- Drop the skip so the initial turn matches what the toast advertises.
New matrix test pins all four (ultrawork, ralph_loop) combinations.
multimodal-looker:
- Prompt claimed 'read' and 'call_omo_agent' were available, but the
look_at invocation runtime explicitly disables both via READ_ENABLED
and createAgentToolAllowlist([]). Small VL models trusted the prompt
and looped on rejected tool calls (#4116).
- Rewrite the agent prompt to describe direct-attachment analysis and
forbid tool/agent calls. Add a consistency test that extracts the
prompt's 'available tools' claim and compares it against the
configured allowlist.
delegate-task (skill-resolver):
- 088693697 filtered per-agent restricted skills at the skill tool and
builtin agent prompt layers, but delegate-task itself happily injected
whatever skill name a caller passed. A target agent could be force-fed
a skill marked agent: oracle just by listing it in load_skills.
- Thread the target agent through resolveSkills and silently filter
skills whose definition.agent does not include it. Public skills with
no restriction are unaffected. Regression test pins the bypass.
- prometheus-prompt.test.ts: close missing }) on the OpenSpec expanded
commands describe block (introduced by d66b6bcbf, parse error).
- agent-sort-shim/agent-config-integration/continuation-injection/
unstable-agent-babysitter/subagent-resolver/sync-executor/
resolve-caller-team-lead tests: expect 'Sisyphus - ultraworker'
(lowercase) to match production after cd39f8858, which lowercased the
display name to dodge a TUI ZWSP rendering glitch. Legacy uppercase
inputs that exercise the normalization path are preserved.
- sync-executor.ts + resolve-caller-team-lead.ts: route legacy display
name inputs through normalizeAgentForPrompt so prompt agent names and
caller team lead lookups produce the canonical lowercase form.
Replace 'FN.' shorthand with explicit examples 'F1.', 'F2.' to prevent
LLMs from generating literal 'FN.' labels that the parser rejects.
Identified by cubic.
- Strengthen Prometheus plan template with FORMAT constraint
- Add task label format check to Oracle phase-2 (N/6 → N/7)
- Add format checks to self-review checklist
- New plan-format-validator hook: compares raw checkbox count
against getPlanProgress() after plan writes, warns agent when
labels are malformed (0/0 or partial skip scenarios)
The multimodal-looker prompt described what to do but never told the model which tools are available. Smaller VL models (e.g. Qwen3-VL-8B) would try to call non-existent tools and enter an infinite loop emitting:
Model tried to call unavailable tool 'invalid'. Available tools: call_omo_agent, read.
Add a single sentence at the top of the prompt that explicitly enumerates the only allowed tools ('read' and 'call_omo_agent') and forbids calling any other tool. This matches the runtime allowlist enforced by createAgentToolAllowlist(["read"]).
Regression test asserts the prompt contains the available-tools enumeration so future prompt rewrites don't regress.
Skills with an `agent` frontmatter field are intended for a specific
agent. Previously they still appeared in:
- every agent's system prompt (via `buildAvailableSkills`)
- the `skill` tool's `<available_items>` description visible to all agents
This wasted tokens and could mislead agents into attempting calls that
would be rejected at execution time.
Changes:
- `buildAvailableSkills`: new optional `agentName` parameter; when
provided, skills whose `definition.agent` does not match are excluded
- `builtin-agents.ts`: pass per-agent name to `buildAvailableSkills`
for sisyphus, hephaestus, and atlas, so each agent's prompt only
lists the skills it is allowed to use
- `createSkillTool` (`tools.ts`): exclude agent-restricted skills from
both the eager and lazy description builds, keeping the shared tool
description free of skills the current agent cannot access
Execution-time enforcement (throwing on mismatch) is unchanged; this
change adds the earlier, description-level visibility gate.
Tests: new `available-skills.test.ts` (5 cases) + 3 new cases in
`tools.test.ts` covering the description-filter and execute paths.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Tests that mock an AgentFactory were using an `as AgentFactory` cast
and a separate mutation of `mockFactory.mode` to satisfy the type.
Replace with Object.assign so the factory type is constructed correctly
without casts. Also type the empty discoveredSkills fixture so its
element type is inferred from the function signature instead of
collapsing to never[].
The task() tool schema declares run_in_background as a REQUIRED parameter, but three prompt-template files contained category-based task() examples that omitted it. When agents copied these patterns into actual tool calls, the runtime validator threw 'run_in_background parameter is REQUIRED', breaking delegation.
Add run_in_background=false to the four offending category-based examples: 2 in src/agents/dynamic-agent-category-skills-guide.ts (Delegation Pattern + Category Domain Matching CORRECT/WRONG pair), 1 in src/agents/hephaestus/gpt-5-3-codex.ts (frontend example), and 1 in src/agents/sisyphus/gemini.ts (Example 4 DELEGATE). Subagent-type explore/librarian examples already correctly use run_in_background=true. atlas/shared-prompt.ts examples were already correct.
Verification: bun test src/agents/ — 373 pass, 0 fail. bun run typecheck — clean. Grep confirms no remaining category task() examples lack the parameter.
Inserts blocking Oracle verification todos (plan-1b / plan-2b /
plan-6b in the canonical, plan-1b / plan-2b / plan-5b in the gpt and
gemini variants) between each major Prometheus phase. Each gate is a
single task(subagent_type=oracle) invocation that must return
VERDICT: GO; NO-GO is a directive to fix the cited issues and rerun on
the same Oracle session, not a license to skip.
Adds a new 'Oracle Verification (Phase Gates)' section to
plan-generation.ts with the concrete invocation prompts for each gate:
phase 1 verifies interview completeness, phase 2 verifies the generated
plan, phase 3 verifies plan readiness for execution before /start-work
handoff.
Also adds a plan-generation.test.ts smoke suite (9 cases) that pins
the new todo ids, the section name, the GO/NO-GO format, the
'fix the cited issues' fallback, and the relative ordering.
Drops 'Maximum 3 retries' / 'document and move on' across every Atlas
variant (default, opus-4-7, gpt, kimi, gemini). New text forbids the
'false positive' excuse explicitly and instructs Atlas to keep iterating
on the same task_id, attaching a diagnosis plan, until verification
passes — and to spawn a different-angle subagent only when the original
loops.
Adds a shared <boulder_completion_response> section composed by
shared-prompt.ts. When the hook injects the BOULDER COMPLETE nudge,
Atlas now knows to print TOTAL ELAPSED + per-task elapsed times in the
exact summary shape, confirm boulder.json state, and only mark
pass-final-wave after the Final Wave reviewers approve.
Atlas was delegating tasks one-by-one because the workflow framed parallel
as a conditional ("if tasks can run in parallel..."), letting models default
to the safer sequential path. The new shared ATLAS_PARALLEL_BY_DEFAULT block
flips the default: parallel is mandatory; sequential requires a NAMED
blocking dependency (input dependency or file conflict).
Adds two new prompt variants — kimi (K2.6 thinking-mode calibration:
commitment framing + concrete budgets) and opus-4-7 (counters 4.7's lower
default subagent count and literal-following bias). Recalibrates default
(Claude 4.6 family), gpt (GPT-5.5 outcome-first / decision rules over
absolutes), and gemini (preserves TOOL_CALL_MANDATE; replaces stale
session_id with task_id). All five variants share the parallel mandate
positioned BEFORE the workflow so "mandate above" references resolve.
Strengthens the orchestrator-direct-edit reminder hooks
(ORCHESTRATOR_DELEGATION_REQUIRED + DIRECT_WORK_REMINDER) with the central
challenge "Do you ACTUALLY need to be the one doing this?" — replacing the
previous bullet-heavy framing.
Tests now parametrized over all 5 variants. Adds prompt-routing.test
covering GPT/Gemini/Kimi/Opus 4.7/default routing and edge cases, plus a
session_id rejection test (every variant must use task_id for retries).
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
OpenCode Desktop 1.14.x filters agents by `mode` field. The `mode` was
only present on the factory function as a static property, but not copied
to the generated AgentConfig object.
This fix copies `source.mode` to `base.mode` in `buildAgent()` when:
- source is a factory function (has `mode` static property)
- the generated config doesn't already define `mode`
Test: agent-builder.test.ts (4 pass)
Closes: #3835
Related: #3762, #3812, #3794, #3475, #3474, #3829, #3831, #3824, #3826, #3721, #3806, #3188
- Add isGpt5_2Model type guard\n- ORACLE_GPT_5_2_PROMPT consolidating all knowledge from Claude default, GPT-5.4 generic, and GPT-5.5 variants (XML-tagged blocks, concrete verbosity clamps, long-context re-grounding, anti-narration tool rules, high-risk self-check)\n- MOMUS_GPT_5_2_PROMPT preserving blocker-finder philosophy with new tool_usage_rules block for parallel reference verification\n- Momus GPT-5.2 reasoningEffort set to xhigh per evaluation rigor needs
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>