Skip to content

Prove each provider runs the bot's saved model on the intended account #415

Description

@linear-code

Problem

The model saved on a bot must control every turn for that bot, through the subscription or credential the user picked. CLI detection or a saved OAuth login does not prove that execution works. If a provider cannot honor the selected model, it must fail with an honest unsupported state, never quietly run a different model or credential.

Routing is implemented and covered by unit tests. What remains is real-turn evidence for each provider and credential path.

Providers on main (checked 2026-10-06)

Provider Driver kind Runtime Real-turn evidence
Codex (ChatGPT) codex Mastra AgentController Missing
Claude claudeAgent Mastra Missing
Grok grok Mastra Missing
Kimi For Coding kimi Mastra Missing. See AKR-66.
OpenCode Go opencodeGo Mastra Missing
Custom API customOpenai Mastra Missing
Standard OpenCode opencode Legacy adapter bridge Missing

The original list also named Cursor, Gemini, Amp, and later ACP CLIs:

  • Cursor is retired (RETIRED_PROVIDER_DRIVERS). It used cursor-agent ACP compatibility, not a direct subscription transport.
  • Gemini and Amp are not Akeru providers. They are reachable only as models inside standard OpenCode, for example google/gemini-3-pro and sourcegraph/amp.
  • ACP CLIs have no driver.

Goal

For every provider in the table, one real turn proves three things: it used the bot's saved model, it used the intended subscription or credential path, and its runtime (Mastra or legacy adapter) is recorded. A turn whose UI claims subscription support but executes on another credential or model counts as a failure.

Already done

Acceptance criteria

  • Each provider in the table has a recorded real turn with the saved model, the credential path, and the runtime, posted as a comment on this issue
  • A selected model that a provider cannot serve fails visibly in chat on every provider
  • No provider falls back to another model or credential except through a documented, user-visible rule (see open questions)
  • Adapter-level tests exist for every provider in the table

How to verify

vp test run apps/server/src/provider/Layers/AgentController.models.routing.test.ts apps/server/src/provider/Layers/AgentController.models.failures.test.ts apps/server/src/provider/Layers/AgentController.models.resume.test.ts

Then, in an isolated dev environment, connect each provider, set a non-default model on a bot, send one turn, and confirm the provider's request log or usage shows that model and account.

Out of scope

  • Adding Cursor, Gemini, Amp, or ACP CLIs as providers
  • Kimi feature parity beyond model routing, tracked in AKR-66

Open questions

  • Backup accounts (feat: backup provider accounts, better default models, and a bot-owned model picker #352) move a bot to the next account on the same provider connection after a usage limit. Is that allowed here because it is user-configured and shown in Settings, or does it count as "falls back to another credential"?
  • Grok's default grok-build is a product slug that means "the session's current model", and it reaches Mastra as Grok 4.7. Should a slug that resolves to a specific model count as honoring the saved model?

History

  • 2026-08-30: implementation evidence. Focused provider, reactor, workspace, browser, redaction, Settings, and contract checks passed (18 files, 418 tests), and server typecheck passed. The Grok review accepted the fail-closed fixes but did not approve Done.
  • 2026-08-31: ChatGPT, Claude, Grok, and Kimi had full custom-harness routing locally. Grok review passed. Live subscription testing was skipped on purpose. OpenCode stayed on its adapter path.
  • 2026-09-22 roadmap audit: saved-model routing has tests and Kimi fails closed. Real-turn evidence for every claimed provider and credential path is missing.
  • Original roles: GPT-6.1 Sol implements, Grok reviews.

Context

Blocks AKR-81. Related: AKR-66, AKR-67, AKR-72, AKR-123, LEO-294, LEO-331, LEO-344. Routing overview: docs/internals/providers.md.

Created with Claude Opus 5.5 in Claude Code.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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