Skip to content

ACP: a routed model on a non-root default line loses the model config option after load #2122

Done

Description

@yyhhyyyyyy

When a Session's conversation is on a line other than the root and that line's adopted model came through a Provider route (providers/set), session/load answers config options without model: only mode remains. The same routed adoption on the root line keeps the option, so the difference is the line the reply reads its configuration from.

Where it happens

The gateway emits the model option only when the adopted model id appears in the catalog under the adopted provider: config.rs L247-L256 compares model.provider with catalog_provider_id and falls back to the execution provider_id. A routed adoption executes under a fresh provider id and keeps the catalog provider id beside it in catalogProviderId (scoped_routes.rs L254-L300).

On the root line the load reply's configuration comes from session.attach, whose reply carries catalogProviderId (subscription.rs L632-L680), so the comparison finds the catalog row.

On any other line the load reads the line through session.model.get (gateway.rs L3449-L3454, L3506-L3511), whose ModelConfigurationView carries only model, capabilitySnapshot and modelPreferences (protocol.rs L446-L457, built at connection/tree.rs L646-L666). No catalog provider id is sent, so the gateway compares the routed execution id against the catalog, finds no row, and drops the option. The client type already reserves the optional field (wire.rs L70-L95), and the public context/configured view does carry catalog_provider_id (tree_protocol.rs L186-L191), but a line's configuration at load comes from the by-line read, not from a history event.

Reproduce

  1. Create a Session on a catalog model of a Provider that accepts a route, open a line from the root, and call session.branch_set_default for that line.
  2. Over ACP, session/load the Session: the config options are mode and model.
  3. Call providers/set for that Provider with its protocol and a base URL, then session/set_config_option with {"configId": "model", "value": "<model>"}: the reply still lists model.
  4. session/load again: mode remains and model is gone.
  5. Move the default back to the root with session.branch_set_default, call session/set_config_option with the same model there, and session/load: mode and model are both present.

After step 5 session.model.get answers a routed execution provider id on both lines, so the configuration each line runs is the same kind of adoption; only the root's load reply still names the model.

Verified

Reproduced end to end with a local test against origin/main at 4ff6b0a, with a real App Server, a catalog Provider that accepts a route, and the real ACP gateway. The line's load reply carried mode and model before the routed adoption and only mode after it; the root's load reply carried both.

Impact

providers/set is the way an ACP editor points a Provider at its own endpoint, which #2009 added, and #1963 makes the gateway read and write the default line. A client that reopens a Session whose conversation is on a line loses the model option for that Session whenever the line runs on a route, until the line adopts a configuration again; the permission mode stays usable, so what is lost is the model picker.

This shares its origin with #2118: #2009 wired the catalog provider id into the root's AttachResult only, and #1963 moves the client reads to the default line, where both gaps become reachable.

Design contract

model-configuration.md L200-L202 records catalogProviderId on the attach reply and catalog_provider_id on the event for scoped routes, and clients.md L173 makes session.model.get the read of a line's own adopted configuration. Whether that read should carry the catalog provider id is a decision for the fix: it adds a field to a public reply.

Refs #2118, #2009, #1963

Activity

  1. self-assigned this
    on Nov 23, 2026
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