anomalyco / anomalyco/opencode
[FEATURE]: allow agents to opt into a small/fast model for lightweight turns
@jlongster is already working on this.
Since Sep 3, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Long-running multi-step agent tasks are slower than they need to be because every turn in the session runner resolves the session's main model. Lightweight turns — plain-text confirmations, status updates, short continuations — pay the same latency and token cost as the heavy reasoning turns.
The codebase already has the machinery for this: Catalog.model.small() resolves a cheap/fast model by keyword (nano/flash/lite/mini/haiku/small/fast) plus cost/age scoring, and it's already used for title generation (SessionPrompt.ensureTitle). It just isn't wired into the agent step loop.
What I'd like to see: an opt-in small flag on an agent so the runner prefers Catalog.model.small(providerID) for that agent's turns, falling back to the session model when no small model is available. This is a no-op for every existing agent (flag defaults to absent) and it never fails a turn just because a small model is missing.
I have a working implementation of this with unit tests in PR #46928 (that PR got auto-closed for missing the PR template, which I'm fixing separately).
Benefits:
- Lower per-turn latency and token cost for agents that spend most steps on non-critical work, which is the dominant cost in long autonomous runs.
- Reuses the existing
Catalog.model.small()selection logic rather than inventing new heuristics.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.