Repository navigation
docs: model source registry proposal - #622
Open
Logan Ramos (lramos15) wants to merge 7 commits into
Open
Logan Ramos (lramos15) wants to merge 7 commits into
Logan Ramos (lramos15) wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Model IDs can be reused after withdrawal or authentication changes, allowing retained selections to send prompts to a different service instead of failing safely.
1 open issue
What changed in this PR
Adds a docs-only proposal for session-scoped, bring-your-own-key model sources delivered through plugins. It builds on #619 and #543 without changing protocol types or generated clients.
Changes:
- Sketches customization states, an
authenticatetarget, and ID-based model selection. - Defines lifecycle behavior, credential safeguards, and withdrawal rules that prohibit model fallback.
- Documents compatibility, implementation touchpoints, and open design questions.
| File | Description |
|---|---|
docs/proposals/model-source-customizations.md |
Proposes plugin-contributed model sources, authentication, selection, and lifecycle rules. |
Review effort: Balanced
This was referenced Nov 20, 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>
Logan Ramos (lramos15)
force-pushed
the
lramos15/model-provider-customizations
branch
from
November 23, 2026 22:52
550b354 to
a528f3f
Compare
Logan Ramos (lramos15)
added a commit
that referenced
this pull request
Nov 23, 2026
Implements the host-wide model source registry from the model source registry proposal (#622): - `RootState.modelSourceRegistrations` with `ModelSourceRegistration`, its sharing and retention policies, and the `starting`, `ready`, `authRequired`, and `error` states. - Client-dispatchable `root/modelSourceRegistrationSet` and `root/modelSourceRegistrationRemoved` actions (introduced in 1.2.0) with root reducers in TypeScript and every client. - `AgentCapabilities.modelSourceRegistration` listing the definition formats an agent reads. - A `modelSource` `authenticate` target for delivering a registered source's credential. - Generator registration, reducer and round-trip fixtures, spec and naming docs, and changelog fragments. Refs #619 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Validate a client-dispatched `Set` on its payload and authorize a `Removed` against the stored registration only, keeping removal of an unknown ID a no-op. The catalog collision check now ignores the entry the host publishes for the same registration, so a ready registration can still be updated or removed. Add a host-issued `credentialNonce` to each registration, echoed in the `modelSource` authenticate target. The host issues a new one whenever it drops the credential because the registration changed, and rejects a stale one with `Conflict`, so a delayed key for an old definition never reaches a new one. Refs #619 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- The host builds status updates from the current registration, so a late result can't undo a change or bring back a removed source. - Revocation reports `reason: expired`, so no client replays the revoked secret. - A model's upstream identity is its endpoint plus the endpoint's model identifier. Moving the endpoint mints new model IDs. - A client sends a stored secret only when the registration matches its own copy, and the host writes status descriptions and errors itself. - Restored registrations start in `starting`, untargeted model source credentials are rejected, and the credential drop list names every field that drops it. Refs #619 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Logan Ramos (lramos15)
added a commit
that referenced
this pull request
Nov 24, 2026
- `ModelSourceRegistration.credentialNonce` and the required `ModelSourceAuthenticateTarget.credentialNonce`, so a delayed `authenticate` can't reach a changed definition. The host rejects a stale nonce with `Conflict`. - Specs follow #622: `Removed` is checked only against the stored registration, status updates are built from the current registration, revocation reports `reason: expired`, moving the endpoint mints new model IDs, clients send a stored secret only when the definition matches their copy, and the host writes status text and errors itself. - Untargeted model source credentials are rejected with `InvalidParams`, and `ProtectedResourceMetadata.resource` notes the model source scheme exception. - Renumber the registry round-trip fixtures after main's new fixture, align the Azure fixture's resource with its endpoint, and note the TypeScript `AuthenticateTarget` narrowing in the migration fragment. Refs #619 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Like MCP servers, registrations have no per-client ownership: any client can use, change, or remove one and supply its credential. Remove the sharing policy, takeover, and permission checks, and keep retention as the one per-registration choice. A registration's `clientId` records who last wrote it. Report status with a host-only `root/modelSourceStateChanged` action, modeled on `session/mcpServerStateChanged`, instead of writing the whole registration back. Its reducer ignores unknown IDs, so a late status can't revive a removed registration or overwrite a newer definition. Issue a new `credentialNonce` on every credential change, including rotation, expiry, and revocation, and ignore failures from requests made with an older key. Refs #619 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Refs #619 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Once a registration has been ready, the host keeps its models listed through `starting` and `authRequired`, so a key rotation or expiry doesn't change the catalog or break a selection. It withdraws them on removal, when the contributing client leaves under `contributingClient` retention, on `error`, or when a change mints new model IDs. A turn that starts without a usable credential ends with a resumable error, like a mid-turn credential failure. This settles the open question about the catalog across a re-auth. Refs #619 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Authentication metadata is unavailable to clients connecting after a source becomes ready, preventing credential revocation, and stale discovery results can incorrectly mark recreated or updated registrations ready.
2 open issues
3 resolved since last review
Review effort: Balanced
Treat `credentialNonce` as the registration's generation. The host issues a new one when a registration is added or its provider, format, or definition changes, even with no credential held, as well as on every credential change. It tags every agent operation with the current nonce and discards any result with an older one, so a late result can't mark a re-registered or reverted registration ready. Move the credential's RFC 9728 metadata from the `authRequired` state to a host-reported `credentialResource` on the registration, kept in every state. A client that connects while a source is ready can then rotate or revoke its credential. `ModelSourceAuthRequirement` keeps `reason` and `description`. Refs #619 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Logan Ramos (lramos15)
marked this pull request as ready for review
November 24, 2026 15:55
Logan Ramos (lramos15)
requested review from
Connor Peet (connor4312) and
roblourens
as code owners
November 24, 2026 15:55
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Refs #619
Adds
docs/proposals/model-source-registry.md, which lets clients register bring-your-own-key model sources with an agent host:RootState.modelSourceRegistrations). The host reports each one's status (starting,ready,authRequired,error) with a host-only action, likesession/mcpServerStateChanged.modelSourceRegistrationwith the definition formats it reads.authenticateand amodelSourcetarget. The host keeps it in memory only.id.Docs only. No
types/changes. Builds on #543. The implementation in #627 is being updated to match.Changes from the previous revision
The previous revision made each source a session-scoped plugin customization. Review pointed out that BYOK configuration belongs to the user, not a session, and that automations and long-running headless sessions need sources that outlive one client's session. A host-wide registry covers both and shows the models before any session exists. Rules settled while implementing the previous revision carry over: a required
modelSourcetarget, a resumable error when a credential fails mid-turn, reserved model IDs, endpoints in any URL scheme, and best-effort redaction of tool output.Validation
npm testnpm run generate:docs && npm run docs:versions && npx vitepress build docsvitepress preview