Skip to content

Feature Request: Independent model assignment for librarian and fixer (break the inheritance chain) #1025

Description

Feature: Independent model assignment for librarian and fixer (break the inheritance chain)

Problem

Currently, when fixer has no explicit model set, oh-my-opencode-slim inherits the librarian's model. This makes it impossible to have:

  • librarian → cheap local model (e.g. ollama/qwen3.8:27B) for research/doc lookups
  • fixer → frontier/session model (e.g. zai-coding-plan/glm-5.2) for implementation work

Setting both explicitly works, but there's no way to say "use the session/orchestrator model" for one agent while pinning another to a local cheap model. The only workaround is an external plugin wrapper that strips the inherited model after the fact.

I want/need this librarian/fixer decorrelation because my cheap model is ollama local model, such as ollama/qwen3.8:27B, and i noticed too many issues when qwen is the fixer, I prefer to avoid it, but it's a really good model for other purpose (librarian, git-ops tasks, tracer, etc.). Maybe someday qwen 4.x or 5.x could fixes these issues in still a small distilled version, finger crossed :).

Current behavior (the inheritance chain)

librarian.model = "ollama/qwen3.8:27B"
fixer.model    = (not set)
  → fixer silently inherits librarian.model  ← unwanted coupling

Desired behavior

Option A — explicit sentinel (preferred):

{
  "agents": {
    "librarian": {
      "model": "ollama/qwen3.8:27B"
    },
    "fixer": {
      "model": "$session"   // or "$primary", "$orchestrator"
    }
  }
}

$session / $primary / $orchestrator would mean "follow whatever model the current session/orchestrator is using", breaking the librarian→fixer inheritance.

Option B — config flag (simpler):

{
  "agents": {
    "librarian": {
      "model": "ollama/qwen3.8:27B"
    },
    "fixer": {
      "model": "ollama/qwen3.8:27B",
      "inheritModelFrom": "session"   // or "orchestrator", "primary"
    }
  }
}

Option C — convention (zero-config):

If fixer has no model and librarian has an explicit model, treat fixer as "use the session model" rather than inheriting from librarian. This is the most intuitive behavior: the implementation agent should default to the session's main model, not the research agent's cheap local model.

Why this matters

  • Cost control: Librarian does heavy web/doc research on a cheap local model; fixer does code implementation on a frontier model. Mixing them means either expensive research or weak implementation.
  • Separation of concerns: Research quality and coding quality have different model requirements. Forcing them to share a model couples two unrelated cost/quality trade-offs.
  • Current workaround is fragile: Requires a custom plugin (oh-my-opencode-slim-plugin.ts) that intercepts the config hook and strips fixer.model post-build. This breaks on any internal refactor of the agent config shape.

Workaround today (for reference)

// oh-my-opencode-slim-plugin.ts
const wrapper = async (input: any) => {
  const hooks = await slim(input)
  if (Array.isArray(hooks.agent)) {
    hooks.agent.forEach(a => {
      if (a.name === "fixer" && a.config) a.config.model = undefined
    })
  }
  // also strip after config hook runs
  const originalConfig = hooks.config
  if (typeof originalConfig === "function") {
    hooks.config = async (cfg: any, ...rest: any[]) => {
      const result = await originalConfig(cfg, ...rest)
      if (cfg?.agent?.fixer) cfg.agent.fixer.model = undefined
      return result
    }
  }
  return hooks
}

Related

  • The inheritance behavior is documented implicitly in the codebase but not as a user-configurable feature.
  • Similar use case: any user who wants a cheap research lane + a strong coding lane in the same session.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions