[Bug]: runtime_fallback can never resolve a chain for `general` — normalizeAgentName gates on AGENT_NAMES and no category is registered

Author: netbrainCreated Sep 16, 2026Updated Sep 16, 2026

Background

runtime_fallback resolves a chain in getRawFallbackModelsForSession, in this order:

  1. SessionCategoryRegistry.get(sessionID)categories[cat].fallback_models
  2. agents[name].fallback_models (and agents[name].categorycategories[cat].fallback_models)
  3. the plan-inherits-prometheus special case
  4. 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:

javascript
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

  1. Enable runtime_fallback and give every agent and category a fallback_models chain.
  2. Have an orchestrator delegate with task() without a category, so the child lands on general.
  3. Exhaust the provider quota for the configured model.
  4. The child session errors out. /tmp/oh-my-opencode.log shows No 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) to AGENT_NAMES so 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