Skip to content

Seeded models work without a click: declared App Studio bindings, a default Agents model - #1094

Merged
railgrid-prow[bot] merged 1 commit into
railgrid:mainfrom
mjudeikis:default-model-by-default
Nov 14, 2026
Merged

railgrid-prow[bot] merged 1 commit into
railgrid:mainfrom
mjudeikis:default-model-by-default

Conversation

@mjudeikis

Copy link
Copy Markdown
Contributor

A WorkspaceSeed can put a model connection into every tenant workspace (Switchboard's free grant does), but nobody is there to click through the setup the two providers expect. In Agents the seeded model mostly worked already; in App Studio the connection sat at Reachable=Unknown / ExplicitDiscoveryRequired with no model on it, so the assistant had nothing to run on.

App Studio

  • ModelProviderConnection.spec.models declares model bindings (id, model, optional name, default).
  • Once the key Secret resolves, the connection controller adds each declared model to the Studio registry as an active binding carrying the admitted snapshot, and sets defaultModel when the registry has none.
  • It is an offer, made once: an id that is already an active binding is left alone, and a binding the workspace later edits, archives or deletes is not put back. status.declaredModels records what was offered.
  • A connection that declares its models is Ready (Reachable Unknown, reason ModelsDeclared) without discovery. The controller still sends no request of its own.

Agents

  • ModelCredential.spec.default marks the workspace's default chat model (refused on harness identities).
  • An agent created over REST or MCP without a model gets it; the oldest wins when several are marked. An agent that names a model is never changed.
  • The create form prefers a ready default when there are several models. With exactly one ready model it already preselected it.

What a seed adds

# Agents ModelCredential
spec: {connectionRef: railgrid, model: default, default: true}

# App Studio ModelProviderConnection
spec:
  models:
  - {id: default, model: default, name: Railgrid, default: true}

Both need the providers released with the new schemas first; a seed carrying the fields before that is rejected on apply.

Tested

  • Go: new tests for the declared-binding controller path and for default selection on create; go test of the changed packages in both providers.
  • Agents portal: vue-tsc and the vitest suite.

Not tested: make verify, the e2e suites, and anything against a live hub. The create form's new preference has no UI test of its own. Not checked: whether App Studio's portal keeps spec.models when a person edits a seeded connection (losing it only drops the Ready reason; bindings are made once).

Most of the diff is regenerated CRDs and kcp schemas (make codegen-app-studio-provider, make codegen-agents-provider).

…efault Agents model

App Studio: a ModelProviderConnection can declare its models in
spec.models. The connection controller adds each to the Studio registry
once, as an active binding with the admitted snapshot, and makes one
marked default the workspace default while there is none. A connection
that declares its models is Ready without discovery; the controller
still sends no request of its own. A binding the workspace edits or
removes is not put back (status.declaredModels).

Agents: ModelCredential spec.default marks the workspace's default chat
model. An agent created over REST or MCP without a model gets it, and
the create form starts on it when there are several models.

Both are for objects a WorkspaceSeed creates, which nobody was there to
click through.
@mjudeikis

Copy link
Copy Markdown
Contributor Author

/retest

@mjudeikis

Copy link
Copy Markdown
Contributor Author

/approve

@railgrid-prow

railgrid-prow Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mjudeikis

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@railgrid-prow
railgrid-prow Bot merged commit 36e437e into railgrid:main Nov 14, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant