Skip to content

models: add model sources to agent catalogs - #543

Merged
Logan Ramos (lramos15) merged 7 commits into
mainfrom
agents/model-provider-selection-20261022
Nov 24, 2026
Merged

Logan Ramos (lramos15) merged 7 commits into
mainfrom
agents/model-provider-selection-20261022

Conversation

@TylerLeonhardt

@TylerLeonhardt TylerLeonhardt commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Note: Logan Ramos (@lramos15) updated this PR after roblourens's review while TylerLeonhardt is out of office.

Summary

Lets an agent group its models by source, such as different services or subscriptions, so clients can label and group them in a model picker.

  • Adds ModelSourceInfo { id, displayName } and an optional AgentInfo.modelSources. A source can have no models.
  • Adds an optional SessionModelInfo.modelSourceId, which must match an entry in the same agent's modelSources.
  • SessionModelInfo.id is unique within an agent's models. When two sources serve the same upstream model, the host gives each entry its own ID and maps it to the upstream model. ModelSelection is unchanged: id plus config.
  • Model IDs are stable. A host keeps a model's ID across catalog updates and never reuses an ID for a different source or upstream model, so a saved selection can't silently switch sources.

See Model sources.

Also fixes the Go generator so optional empty-object capability flags (ClientCapabilities.McpApps, ChangesetCapabilities.Review, AhpMcpUiHostCapabilities.Logging) keep {} on the wire. They are now pointer-to-map fields, which is a source change for Go callers. See the Go README.

No protocol version bump.

Changes after review

  • Removed ModelSelection.modelSourceId. A selection is id plus config.
  • Removed AgentCapabilities.modelSourceSelection and ClientCapabilities.modelSourceSelection.
  • Made SessionModelInfo.id unique within an agent's models.
  • Made model IDs stable across catalog updates, after Connor Peet (@connor4312)'s review. A host must not reuse an ID for a different source or upstream model, and a saved ID that's no longer listed is unavailable.
  • Removed legacy projection, exact-pair selection and failure rules, preservation tables, automation model ownership rules, and the related additions to chat-channel.md, automation-channel.md, and versioning.md.
  • Went back to "agent provider" wording, removed "not X" phrasing, and shortened the JSDoc and the root-channel section.
  • Replaced reducer fixtures 316–318 and round-trip fixtures 079–090 with 101-model-source-catalog and 102-client-capabilities-mcp-apps-presence. The second one fails without the Go fix.
  • Merged main twice. Generated files were regenerated, not hand-merged.

Validation

The local client runs below are from 78323520. The later main merge and the stable-ID change (comments and docs only) were checked with npm run generate twice, npm test, the Rust and Go formatting and round-trip checks, the TypeScript client tests, the docs build, and CI.

Check Command Result
Generation npm install && npm run generate, run twice Passed; the second run produced no changes
Root tests npm test 667 passed; typecheck, lint, metadata, changelog, fragment, and generated-file checks passed; 100% reducer branch coverage
TypeScript client cd clients/typescript && npm ci && npm run typecheck && npm test && npm run build 79 passed; typecheck and build passed
Rust cd clients/rust && cargo fmt --all -- --check && cargo clippy --workspace -- -D warnings && cargo test --workspace 104 passed
Go cd clients/go && go build ./... && gofmt -l . && go vet ./... && go test ./... Passed
Kotlin docker run --rm -e GRADLE_USER_HOME=/tmp/gradle-home -v "$PWD":/workspace -w /workspace/clients/kotlin docker.io/library/eclipse-temurin:17-jdk ./gradlew build --no-daemon --console=plain Build passed; 536 tests passed
Swift swift build && swift test on macOS with Xcode Passed; 104 XCTest tests
.NET CI dotnet job 701 passed; pack and Native AOT smoke test passed. Not run locally because the npm and NuGet registries were unreachable from my machine.
Docs npm run generate:docs && npm run docs:versions && npx vitepress build docs Passed
CI Run 45485351831 on 6199969a All 7 jobs passed

TylerLeonhardt and others added 2 commits October 22, 2026 15:26
Add per-harness model-provider catalogs and mutually gated exact model selections while preserving legacy unqualified behavior. Specify safe catalog projection, fail-closed routing requirements, and durable automation ownership using existing protocol surfaces.

Regenerate client/schema mirrors and add shared conformance coverage. Preserve Go empty-object capability markers and document the associated source migration and native validation requirements.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use model-source terminology for the unreleased catalog, qualifier and mutual capability marker to distinguish model access from the owning harness and model vendor.

Update normative docs, examples, changelog fragment and shared fixtures; regenerate all client/schema mirrors. Preserve existing provider harness fields, vendor metadata, raw model IDs and exact-selection behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@TylerLeonhardt TylerLeonhardt changed the title models: add provider-qualified model selection models: add source-qualified model selection Oct 23, 2026
@TylerLeonhardt
TylerLeonhardt marked this pull request as ready for review October 23, 2026 04:11
Comment thread types/channels-root/state.ts Resolved
Comment thread types/channels-root/state.ts Resolved
Comment thread types/channels-root/state.ts Resolved
Comment thread types/channels-root/state.ts Resolved
Comment thread types/common/commands.ts Resolved
Generated clients and schemas were resolved by regenerating with
`npm run generate`.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Logan Ramos (lramos15) added a commit that referenced this pull request Nov 20, 2026
Rename the proposed customization from ModelProvider to ModelSource so
it uses the term #543 already settled on, and rename the file to match.

Follow #543's direction after review: model IDs are unique in the
session's catalog, a selection is just a model `id`, and neither the
agent nor the client advertises a capability. Withdrawn models still
fail rather than fall back, now justified on their own.

Refs #619

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep model sources as labels and groups for pickers and select models by
`id` alone.

- Keep `ModelSourceInfo`, `AgentInfo.modelSources`, and
  `SessionModelInfo.modelSourceId`. Model IDs are unique within an
  agent's `models`; the host gives each source its own ID for a shared
  upstream model.
- Remove `ModelSelection.modelSourceId` and the client and agent
  `modelSourceSelection` capabilities, along with legacy projection,
  exact-pair failure rules, preservation tables, and automation
  ownership rules.
- Restore "agent provider" wording and shorten the JSDoc and the
  root-channel section.
- Replace the qualified-selection fixtures with one catalog round-trip
  and one `mcpApps` presence round-trip for the Go capability fix.
- Use a plain slice for Go `AgentInfo.ModelSources`.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lramos15 Logan Ramos (lramos15) changed the title models: add source-qualified model selection models: add model sources to agent catalogs Nov 20, 2026
Logan Ramos (lramos15) added a commit that referenced this pull request Nov 23, 2026
Propose a docs-only design for #619: clients register bring-your-own-key
model sources with an agent host. Registrations live in root state with
a host-reported status, a sharing policy, and a retention policy.
Clients add and remove them with client-dispatchable root actions,
deliver keys through `authenticate` with a `modelSource` target, and
select their models from #543's agent catalog by `id`.

A host-wide registry lets automations and long-running headless
sessions keep using a source after its client disconnects, and shows
the models before any session exists.

No `types/` changes, so no regeneration and no changelog fragment.

Refs #619

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep both sides' round-trip type imports, and renumber this branch's
fixtures to 101 and 102 after main's new 100.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@connor4312 Connor Peet (connor4312) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking findings. One P2: define what happens to saved selections when a model moves between sources or a source disappears.

Written by Connor's agent

Comment thread docs/specification/root-channel.md Resolved
A saved selection holds only a model ID, so hosts must not reuse an ID
for a different source or upstream model, even after the model leaves the
catalog. A saved ID that is no longer listed is unavailable.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lramos15
Logan Ramos (lramos15) merged commit 745899d into main Nov 24, 2026
8 checks passed
@lramos15
Logan Ramos (lramos15) deleted the agents/model-provider-selection-20261022 branch November 24, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants