Skip to content

feat(ai): configurable model catalog for pickers and server/local agents - #196

Merged
camielvs merged 4 commits into
mainfrom
cvs/configurable-model-catalog
Nov 19, 2026
Merged

camielvs merged 4 commits into
mainfrom
cvs/configurable-model-catalog

Conversation

@camielvs

@camielvs camielvs commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add a strict, generic versioned catalog schema with protocols, defaults, replacement IDs, capabilities and explicit provider/model selections.
  • Load a trusted catalog file or authenticated HTTPS endpoint at server startup; fail startup if configured data is unavailable or invalid.
  • Publish catalog data to the picker and register dedicated runtime providers on both server and local hosts.
  • Deliver validated model data over the authenticated remote-host connection without catalog-fetch credentials.
  • Filter unsupported thinking levels and preserve standalone behavior when no source is configured.
  • Resolve pre-catalog model ids (openai/..., stale ids via replacements) on both server and picker, falling back to the catalog default with a warning; clamp thinking depth to what the resolved model supports.
  • Add max to THINKING_LEVELS: Pi 1.4 accepts it, so catalog max mappings now take effect.
  • No proprietary deployment model list or pricing is added to this public repo; fixtures use fictional models.

Validation

  • pnpm validate passes: all 33 typecheck/lint/build tasks.
  • All 724 server tests pass, including strict catalog parsing, matching provider registrations and local-host delivery.

Test setup / rollout

See docs/model-catalog.md. Configure TANGENT_MODEL_CATALOG_FILE or TANGENT_MODEL_CATALOG_URL (optionally TANGENT_MODEL_CATALOG_TOKEN), preserve the existing inference proxy configuration, and restart the server. Local agents require the updated host package and a configured proxy connection. No catalog means existing standalone settings.

Catalog pricing is unspecified and runtime cost metadata remains zero-filled/unknown; live inference and integrated deployment tests are not yet performed.

@camielvs camielvs left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 This is an AI-generated code review comment.

9 findings, inline below (1 High, 3 Medium, 5 Low).

Notes that are not line-specific:

  • The catalog block in apps/server/src/pi/extensions/proxyProvider.ts and packages/local-agent-host/resources/proxyProvider.ts is about 35 identical lines. Pi loads these standalone so a shared import is awkward, and the new parity test is a reasonable guard; just flagging that any fix to one now needs the other.
  • I could not verify from this checkout that Pi's registerProvider model entries honour a thinkingLevelMap field (no node_modules here). If Pi ignores unknown model fields, the DeepSeek xhigh → max mapping never takes effect on the agent side. Worth a quick check against the Pi types before relying on it.

What's good: catalog-fetch credentials are stripped from every spawned process and the remote command carries data only, with a test proving it; redirect: "error" plus the credentials-in-URL rejection; failing startup on a misconfigured catalog instead of silently falling back; the picker keeps AVAILABLE_MODELS behaviour when no catalog is configured.

Comment thread apps/server/src/modelCatalog.ts Resolved
Comment thread apps/server/src/routes/config.ts Resolved
Comment thread packages/shared/src/remoteSubagent.ts Resolved
Comment thread apps/server/src/modelCatalog.test.ts Resolved
Comment thread apps/server/src/modelCatalog.ts Resolved
camielvs and others added 3 commits November 18, 2026 13:41
A catalog-enabled spawn onto a local host with no proxy URL used to throw
from inside the PiAgent constructor, which the bridge did not catch: the
server never heard about it and a zombie agent stayed in the roster. Fail
it the same way a missing workspace folder fails, before spawning.

Also: accept [::1] as loopback for the catalog URL, document the config
router as partly installation-private now that it serves /models, stop
reassigning the picker's disabled prop, import the catalog type at the top
of the remote contract, and import the local-host test fixtures through the
workspace package instead of a relative path.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ides

A shared resolver maps pre-catalog ids (`openai/gpt-6.1-sol`), bare ids and
stale ids listed in `replacements` to the catalog model. The server uses it
when spawning and falls back to the catalog default with a warning when a
selection no longer exists, rather than handing Pi a provider the proxy
extension no longer registers. The picker uses the same resolver so old
selections show their label, highlight and thinking levels, and the remote
roster records the resolved values the spawn command carries.

Thinking depth is clamped to the nearest level the resolved model supports,
in the picker (sent together with a model change when needed) and again at
spawn for configs that predate the catalog.

Pi accepts a `max` thinking level, so THINKING_LEVELS now includes it; the
catalog's `max` mappings were previously dead data.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@camielvs
camielvs force-pushed the cvs/configurable-model-catalog branch from 29a8dea to 83b478b Compare November 18, 2026 20:42
…okie

Oasis authenticates requests through Minerva headers or the MINERVA_TOKEN
cookie and never reads an Authorization bearer, so the bearer-only loader
would 401 and fail startup. When the catalog URL is on the TANGLE_API_URL
origin the fetch now carries TANGLE_TOKEN as its Cookie header, the same
credential the server's other Tangle egress uses. An explicit
TANGENT_MODEL_CATALOG_TOKEN remains a bearer for catalogs served elsewhere.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@camielvs
camielvs merged commit b13da84 into main Nov 19, 2026
10 checks passed
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.

2 participants