Skip to content

[FEATURE]: Plugin can change the active model and have it stick #18667

Closed as not planned

Description

@v1truv1us
  • I have verified this feature I'm about to request hasn't been suggested before.

I've been working on a plugin that dynamically routes prompts to different models based on task type. The chat.message hook already lets me mutate output.message.model — which is great — but the change only lasts for that single turn. After the prompt completes, the model picker reverts to whatever was selected before, and the next turn uses the old model again.

What I actually need: when my plugin changes the model, it should change it for real. The model picker should update, future turns should use it, and subagents should inherit it.

I put together tests for the inheritance chain (chat-message-model-routing.test.ts) and everything flows correctly within a single turn — user message → assistant → subagent. The missing piece is persisting the active model state so it carries over.

This is related to #17870 (subagents ignoring parent model) but takes it a step further — I want plugins to be able to actually set the model, not just observe it.

Not a duplicate of #16932 — that proposes a new hook for blind benchmarking. This is about making the existing hook actually update the active model.

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 22, 2026
  2. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  3. github-actions commented on Jul 4, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions