Skip to content

Add codex and xai-oauth to the credential catalog and adapter contract - #689

Merged
TheGreatAxios merged 8 commits into
mainfrom
cl-7510-inferencecatalog-contract
Sep 8, 2026
Merged

TheGreatAxios merged 8 commits into
mainfrom
cl-7510-inferencecatalog-contract

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

  • codex and xai-oauth join SupportedCredentialProvider, PROVIDER_TEST_CONFIG, AdapterPluginId (new openai-responses), the connector registry (new oauth-loopback auth kind), the catalog seeds, and the inference effective list. xai remains the existing API-key provider, untouched.
  • Codex is probeless — its backend has no live model catalog and no free auth-check endpoint, so the loopback token exchange is the proof; xai-oauth probes cli-chat-proxy.grok.com as a bearer GET. seedCatalog rejects placeholderCredential: true for the OAuth-only ids with a named PlaceholderCredentialError; api-key providers keep their seeded placeholder path.
  • The vendored model-provider plugin enum accepts openai-responses in both @intx/types and the @intx/db schema (recorded local deltas, kill-date hashes updated), so real-token seeds pass the live hub validators; a contract test drives the real CreateModelProvider validator and a parse-row round trip.
  • Loopback connectors never enter the hub web-redirect flow: the OAuth start/callback routes refuse oauth-loopback with a typed error and /oauth-configured omits them — they connect through the sidecar-hosted lane.
  • The sidecar's default adapter manifest registers createCodexResponsesAdapter and createXaiResponsesAdapter; the launch-resolution seam rewrites only the launched source's provider (and material key) to the adapter registry key for ollama/codex/xai-oauth — a recorded vendor/intx/db delta.
  • The descriptors source their OAuth identity (client ids, redirect URIs, scopes, extra params) from new browser-safe ./constants subpaths of the two provider packages, so the descriptor cannot drift from the adapter's refresh path; those subpaths are ruled into the browser-safe-subpaths check.

Verification

  • bun run check exits 0 (typecheck, lint, full test matrix, structural checks incl. check:killdates and browser-safe-subpaths).
  • The real-validator contract test, the gate tests, the loopback-refusal route tests, the manifest parse test, and the buildSource dispatch tests all pass; bun test packages/connections packages/seeding packages/inference-settings templates: 595 pass / 0 fail.
  • Independent review: three rounds — round 1 caught the missing vendored plugin enum (blocking) plus loopback-route leakage and a scope divergence; round 2 and 3 verified the fixes and the manifest wiring; all findings fixed.

Closes CL-7510

Both providers authenticate only through a loopback OAuth login (no
API-key path), speak the OpenAI Responses protocol, and therefore ride
the new openai-responses adapter plugin id end to end: credential-test
provider entries, connector descriptors under a new oauth-loopback auth
kind, catalog seeds, and the effective-list display names.

Codex's config is deliberately probeless — it publishes no live model
catalog and has no free auth-check endpoint, so the token exchange that
mints the credential is the only proof. seedCatalog now rejects
placeholderCredential for these OAuth-only ids with a named
PlaceholderCredentialError: a fake secret could never authenticate and
would only make the offering look launchable. Codex's offerings carry
the host-identity quirks bag its adapter refuses to default.
packages/folded-runs/src/launch.ts no longer exists, and the
launch-time provider rewrite it described is gone with it: the
launched InferenceSource.provider is resolved straight from the
catalog provider row's plugin column at serving time, in
vendor/intx/db/src/model-source-resolution.ts's buildSource. Cite
that live dispatch site instead.
The card list is pinned to supportedCredentialProviders, which now
includes codex and xai-oauth; neither can have a key-paste card until
the loopback OAuth login is wired, so the pin excludes exactly those
two ids. Also applies the formatter to the new connector descriptors
and their tests.
CreateModelProvider and the model_provider.plugin column both rejected
the plugin id the codex/xai-oauth seeds carry, so a real-token
seedCatalog would 400 at create time and parseModelProviderRow would
throw on read. Recorded as a local delta on the vendor/intx/types and
vendor/intx/db rows (VENDORED.md delta notes, kill-date tree hashes).
The contract test drives the real validator and the real row parser,
not the seedCatalog fake API that accepts everything.
The oauth start/callback routes redirect any descriptor carrying an
oauth config, so codex/xai-oauth would send a browser to their consent
pages with a localhost redirect_uri — a dead-end consent — and
/oauth-configured reported them as configured. Both routes now refuse
oauth-loopback descriptors with a typed loopback_connector error and
the configured report omits them; these providers connect through the
sidecar lane instead. Also pins the codex descriptor's authorize scope
to the upstream CODEX_SCOPES list (including api.connectors.read/
invoke) and drops the probeless config's dead isKeyRejected stub;
the xai-oauth probe comment no longer claims live confirmation.
The DEFAULT_ADAPTER_MANIFEST gains codex -> createCodexResponsesAdapter
and xai-oauth -> createXaiResponsesAdapter (workspace deps, hoisted at
the root like @corbits/ollama-adapter so the vendored manifest loader
can import them). Catalog provider rows keep the wire-format plugin
"openai-responses"; the launch-resolution seam in @intx/db's
buildSource — a recorded local delta on the vendor/intx/db row with
its kill-date hash — rewrites only the launched
InferenceSource.provider to the adapter registry key, the same
correction withOllamaAdapterKey used to perform (the ollama entry in
the rewrite table also makes the shipped ollama manifest key actually
reachable). Also drops the conflicting noEmit from the ported provider
packages' referenced tsconfigs.
The inline codex/xai-oauth literals duplicated values the ported
provider packages now export and carried a stale 'until the packages
land' comment; both descriptors now read the packages' constants
subpath (new browser-safe export: constants.ts is pure data, so the
web bundle can keep building — the exchange closures stay plain fetch
because the oauth-core-backed exchange helpers are node-only).
VENDORED.md's vendor/intx/db delta note now names both fields the
launch seam rewrites (InferenceSource.provider and the credential
material's providerKey).
@linear-code

linear-code Bot commented Sep 8, 2026

Copy link
Copy Markdown

CL-7510

@TheGreatAxios

Copy link
Copy Markdown
Contributor Author

Self-review (code-review skill): three independent review rounds ran on this branch. Round 1 returned one blocking finding (the vendored plugin enum rejected openai-responses, masked by the fake API in unit tests) and two should-fixes (loopback descriptors reachable through the web-redirect flow; codex scope divergence from upstream) — all fixed with a real-validator contract test. Rounds 2 and 3 verified the fixes; round 3's two hygiene findings (unenforced browser-safe subpath ruling, stale test comment) were applied exactly as the reviewer prescribed, with bun run check and check:browser-safe-subpaths green in-session.

@TheGreatAxios
TheGreatAxios merged commit cb6f879 into main Sep 8, 2026
24 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.

1 participant