feat(model-proxy): Ride all puts the owner's organizations on the instance model proxy, and a cliproxy preset starts a new one on the owner's models (#1873)
#1999
The instance owner's model proxy becomes the default for the owner's organizations (proxy-scope slice 1, lane ride-default).
cliproxy organization preset (packages/plugins/model-provider/cliproxy/index.mjs). A new organization can start on the owner's models. The preset routes the assistant to one usable row of the owner's catalogue. When it cannot be used it says why: set up the model proxy first, use Ride all, or sign in to an account.
Optional model on the org-service overlay (packages/organization/src/org-service.mjs, packages/webui/src/org-admin.mjs). A named model is accepted only when it is a usable row in the owner's catalogue and the preset is cliproxy. Otherwise 422 at $.model.
Ride all (packages/model-proxy/src/ride.mjs, admin-control.mjs, packages/webui/src/proxy-admin.mjs, serve.mjs, cli.mjs). POST /api/proxy/admin/ride-all adds cliproxy to each organization that can ride, through that organization's own bus plugins.set. Each skipped organization is listed with a reason. Only the instance owner gets through; everyone else gets 403 human-required. Each run writes a receipt to <dataRoot>/state/proxy-admin.jsonl.
Ride all never puts cliproxy back on an organization a person took it off. A removal is recorded in the proxy's receipts before the write, from the Console save and from mosaic org update (packages/cli/src/org.mjs). If the record cannot be written, nothing is saved. Ride all reads the receipts again before each add. When the code cannot tell, it skips the organization.
Page (packages/webui/src/public/display.js). The Model proxy page has a "Use your models in every organization" section: a Ride all button behind a confirm, an answer line, one line per skipped organization with its reason, and one line per stand-in organization with a Move button.
No new bus verb, no bus schema change, no new refusal code, no grant or role change, no config format change. Nothing under roles/, contracts/, packages/queue/ or packages/bus/.
Tests
New: packages/model-proxy/tests/ride-fence.test.mjs (a fenced proxy refuses each riding organization's launches with proxy-uncertain, direct anthropic included), the ride tests, packages/cli/tests/org-update-ride.test.mjs, and webui tests for the routes and the page.
Lead check in a clean environment on the rebased tip: 425 files, 4970 pass, 2 fail, 5 skipped. Neither red is in a file this branch touches. packages/conversation/tests/flows.test.mjs fails one test because the clean environment has no Python jsonschema module; it fails the same way in the Lead checks of earlier landings. packages/webui/tests/packs-workflows-browser.test.mjs timed out once in the run and passes 3 of 3 alone.
Review
Four rounds, each by a fresh claude-opus-5-5 reviewer. Re-check 3 found one P1 (mosaic org update removed cliproxy with no record), fixed in the last commit. Re-check 4 reviewed that commit line by line: approve, P1 0, P2 0, P3 2. The branch was then rebased onto 196505e6e; range-diff shows the four commits unchanged.
Left for later
P3-1: a Settings-page add then remove of cliproxy during a Ride all run can be put back, because the re-read before each add covers the proxy receipts and not the organization change log (packages/model-proxy/src/admin-control.mjs:72). It needs two actions inside one run. A fix lane follows this landing.
P3-2: on a single-business Console the bus-running skip line tells the owner to do something that cannot work (packages/webui/src/cli.mjs:233, display.js:774).
A receipts file that cannot be read makes every add skip as unreadable. That is fail closed and is named on the page.
## What changes
The instance owner's model proxy becomes the default for the owner's organizations (proxy-scope slice 1, lane ride-default).
- **cliproxy organization preset** (`packages/plugins/model-provider/cliproxy/index.mjs`). A new organization can start on the owner's models. The preset routes the assistant to one usable row of the owner's catalogue. When it cannot be used it says why: set up the model proxy first, use Ride all, or sign in to an account.
- **Optional `model` on the org-service overlay** (`packages/organization/src/org-service.mjs`, `packages/webui/src/org-admin.mjs`). A named model is accepted only when it is a usable row in the owner's catalogue and the preset is cliproxy. Otherwise 422 at `$.model`.
- **Ride all** (`packages/model-proxy/src/ride.mjs`, `admin-control.mjs`, `packages/webui/src/proxy-admin.mjs`, `serve.mjs`, `cli.mjs`). `POST /api/proxy/admin/ride-all` adds cliproxy to each organization that can ride, through that organization's own bus `plugins.set`. Each skipped organization is listed with a reason. Only the instance owner gets through; everyone else gets 403 `human-required`. Each run writes a receipt to `<dataRoot>/state/proxy-admin.jsonl`.
- **Ride all never puts cliproxy back on an organization a person took it off.** A removal is recorded in the proxy's receipts before the write, from the Console save and from `mosaic org update` (`packages/cli/src/org.mjs`). If the record cannot be written, nothing is saved. Ride all reads the receipts again before each add. When the code cannot tell, it skips the organization.
- **Page** (`packages/webui/src/public/display.js`). The Model proxy page has a "Use your models in every organization" section: a Ride all button behind a confirm, an answer line, one line per skipped organization with its reason, and one line per stand-in organization with a Move button.
No new bus verb, no bus schema change, no new refusal code, no grant or role change, no config format change. Nothing under `roles/`, `contracts/`, `packages/queue/` or `packages/bus/`.
## Tests
- New: `packages/model-proxy/tests/ride-fence.test.mjs` (a fenced proxy refuses each riding organization's launches with `proxy-uncertain`, direct anthropic included), the ride tests, `packages/cli/tests/org-update-ride.test.mjs`, and webui tests for the routes and the page.
- Lead check in a clean environment on the rebased tip: 425 files, 4970 pass, 2 fail, 5 skipped. Neither red is in a file this branch touches. `packages/conversation/tests/flows.test.mjs` fails one test because the clean environment has no Python `jsonschema` module; it fails the same way in the Lead checks of earlier landings. `packages/webui/tests/packs-workflows-browser.test.mjs` timed out once in the run and passes 3 of 3 alone.
## Review
Four rounds, each by a fresh claude-opus-5-5 reviewer. Re-check 3 found one P1 (`mosaic org update` removed cliproxy with no record), fixed in the last commit. Re-check 4 reviewed that commit line by line: approve, P1 0, P2 0, P3 2. The branch was then rebased onto 196505e6e; range-diff shows the four commits unchanged.
## Left for later
- P3-1: a Settings-page add then remove of cliproxy during a Ride all run can be put back, because the re-read before each add covers the proxy receipts and not the organization change log (`packages/model-proxy/src/admin-control.mjs:72`). It needs two actions inside one run. A fix lane follows this landing.
- P3-2: on a single-business Console the `bus-running` skip line tells the owner to do something that cannot work (`packages/webui/src/cli.mjs:233`, `display.js:774`).
- A receipts file that cannot be read makes every add skip as `unreadable`. That is fail closed and is named on the page.
A cliproxy organization preset offers a model from the owner's catalogue and says in plain words
why it can't be used: no proxy, no riding bus answered, or no catalogue model is available. The
organization service passes an optional model to a preset's overlay; other presets ignore it.
Ride all, an instance-owner action on the Model proxy page, adds cliproxy to each organization
through that organization's own plugins.set. It skips and names an organization whose change log
shows cliproxy removed, whose bus is down, or whose bus has no proxy client. Proxy admin status
names it as the next step. A fixture organization is listed as using stand-in models; one more
confirmed click moves a stopped one to the owner's models through the organization service's
existing whole-document update at the revision read.
A fenced proxy then refuses each riding organization's launches with proxy-uncertain, a direct
anthropic route included.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What changes
The instance owner's model proxy becomes the default for the owner's organizations (proxy-scope slice 1, lane ride-default).
packages/plugins/model-provider/cliproxy/index.mjs). A new organization can start on the owner's models. The preset routes the assistant to one usable row of the owner's catalogue. When it cannot be used it says why: set up the model proxy first, use Ride all, or sign in to an account.modelon the org-service overlay (packages/organization/src/org-service.mjs,packages/webui/src/org-admin.mjs). A named model is accepted only when it is a usable row in the owner's catalogue and the preset is cliproxy. Otherwise 422 at$.model.packages/model-proxy/src/ride.mjs,admin-control.mjs,packages/webui/src/proxy-admin.mjs,serve.mjs,cli.mjs).POST /api/proxy/admin/ride-alladds cliproxy to each organization that can ride, through that organization's own busplugins.set. Each skipped organization is listed with a reason. Only the instance owner gets through; everyone else gets 403human-required. Each run writes a receipt to<dataRoot>/state/proxy-admin.jsonl.mosaic org update(packages/cli/src/org.mjs). If the record cannot be written, nothing is saved. Ride all reads the receipts again before each add. When the code cannot tell, it skips the organization.packages/webui/src/public/display.js). The Model proxy page has a "Use your models in every organization" section: a Ride all button behind a confirm, an answer line, one line per skipped organization with its reason, and one line per stand-in organization with a Move button.No new bus verb, no bus schema change, no new refusal code, no grant or role change, no config format change. Nothing under
roles/,contracts/,packages/queue/orpackages/bus/.Tests
packages/model-proxy/tests/ride-fence.test.mjs(a fenced proxy refuses each riding organization's launches withproxy-uncertain, direct anthropic included), the ride tests,packages/cli/tests/org-update-ride.test.mjs, and webui tests for the routes and the page.packages/conversation/tests/flows.test.mjsfails one test because the clean environment has no Pythonjsonschemamodule; it fails the same way in the Lead checks of earlier landings.packages/webui/tests/packs-workflows-browser.test.mjstimed out once in the run and passes 3 of 3 alone.Review
Four rounds, each by a fresh claude-opus-5-5 reviewer. Re-check 3 found one P1 (
mosaic org updateremoved cliproxy with no record), fixed in the last commit. Re-check 4 reviewed that commit line by line: approve, P1 0, P2 0, P3 2. The branch was then rebased onto 196505e6e; range-diff shows the four commits unchanged.Left for later
packages/model-proxy/src/admin-control.mjs:72). It needs two actions inside one run. A fix lane follows this landing.bus-runningskip line tells the owner to do something that cannot work (packages/webui/src/cli.mjs:233,display.js:774).unreadable. That is fail closed and is named on the page.