[Bug]: runtime_fallback can never resolve a chain for `general` — normalizeAgentName gates on AGENT_NAMES and no category is registered
Background
runtime_fallback resolves a chain in getRawFallbackModelsForSession, in this order:
SessionCategoryRegistry.get(sessionID)→categories[cat].fallback_modelsagents[name].fallback_models(andagents[name].category→categories[cat].fallback_models)- the plan-inherits-prometheus special case
- an agent name matched inside the session id via
agentPattern
There is no global default. A session that matches none of them gets nothing and the hook logs No category/agent fallback models resolved for session.
Path 2 is reached only through normalizeAgentName, which returns undefined for any name outside AGENT_NAMES:
function normalizeAgentName(agent) {
if (!agent) return
const normalized = agent.toLowerCase().trim()
if (AGENT_NAMES.includes(normalized)) return normalized
const match = normalized.match(agentPattern)
if (match) return match[1].toLowerCase()
return
}AGENT_NAMES is sisyphus, oracle, librarian, explore, prometheus, atlas, metis, momus, hephaestus, sisyphus-junior, build, plan, multimodal-looker. general is not in it, and agentPattern is built from the same list, so path 4 cannot rescue it either.
Path 1 does not apply because SessionCategoryRegistry.register only fires if (args.category), and a plain task() dispatch landing on general carries no category.
Consequence
general can never have a fallback chain, by any configuration. Writing an agents.general block with fallback_models or category in omo.jsonc is silently dead config: the lookup never runs for that name.
This matters because general is the most-used agent in practice. In one local install: 90 sessions on general against 48 on build. Every quota lockout on those subagent sessions is terminal, while the parent agent recovers.
Observed on oh-my-openagent 4.19.4 with opencode 1.18.9:
[runtime-fallback] No category/agent fallback models resolved for session {"sessionID":"ses_..."}
[runtime-fallback] first-prompt-watchdog: subagent silent past 90000ms with no fallback configured {"sessionID":"ses_...","model":"openai/gpt-5.6-sol"}The session in question resolved to agent=general, parent=<a Prometheus session>. The same applies to plugin-owned agents, e.g. opencode-mem-structured.
Steps to reproduce
- Enable
runtime_fallbackand give every agent and category afallback_modelschain. - Have an orchestrator delegate with
task()without a category, so the child lands ongeneral. - Exhaust the provider quota for the configured model.
- The child session errors out.
/tmp/oh-my-opencode.logshowsNo category/agent fallback models resolved for session.
Suggested fix
Any one of these would close the gap:
- Add
general(and the other opencode-native agents) toAGENT_NAMESso path 2 resolves. - Add a configurable global default chain used when all four paths miss.
- Have the delegation path register a default category when the caller supplies none, so path 1 resolves.
The first is the smallest change and makes agents.general.fallback_models behave the way the schema already implies it should, since categories.agents accepts arbitrary keys today.
Related
- 6730 describes orchestrators bypassing the category system and delegating to
general, which is what produces these uncategorised sessions. - 7226 covers a different gap in the same feature (main/interactive TUI session).
Source: code-yeongyu/oh-my-openagent