Skip to content

fix(live): graded inference-provider provenance for Claude and Codex sessions - #103

Merged
pacphi merged 1 commit into
mainfrom
fix/live-provider-provenance
Jul 31, 2026
Merged

fix(live): graded inference-provider provenance for Claude and Codex sessions#103
pacphi merged 1 commit into
mainfrom
fix/live-provider-provenance

Conversation

@pacphi

@pacphi pacphi commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary

Every Live session showed "Provider not established" — including all Codex sessions, whose artifacts carry the provider. This PR makes the Live view answer who serves each session's models (Anthropic, Bedrock, Vertex, Foundry, OpenRouter, a custom gateway, or codex's configured model_providers entry) with honest, graded provenance. Documented as ADR-0021.

  • Codex (bug): rollout session_meta and the state_N.sqlite threads table spell the field model_provider; the adapters read a bare provider that doesn't exist, so observed evidence was silently dropped. Now read with legacy tolerance → sessions surface openai / openrouter / azure / ollama etc. as observed.
  • Claude (data absence): transcripts never name the serving endpoint. A new resolver mirrors Claude Code's documented selection surface — CLAUDE_CODE_USE_BEDROCK / _VERTEX / _FOUNDRY, ANTHROPIC_BASE_URL gateway classification (OpenRouter detected by hostname) — across settings layers (managed > project local > shared > user > shell env, empty string = unset). Explicit selections are configured; the first-party default is inferred; never observed.
  • Supporting invariants: projection retains established provider/model claims when later events carry none (server + mirrored browser reducer); bootstrap-learned codex session_meta identity persists into live tailing; UI names AWS Bedrock / Google Vertex AI / Microsoft Foundry / Custom gateway and resolves child (subagent-rooted) session cards.

Verification

  • pnpm run typecheck, pnpm run build, scoped eslint: clean.
  • Full suite: 1184 kit tests, 0 failures (+ all CJS suites).
  • Real-data smoke on a machine with 100 live/retained sessions: 11× claude → anthropic (inferred), 25× codex session → openai (observed), 64× codex subagent → openai (observed) — zero "Provider not established" where evidence exists.

Grounding

🤖 Generated with Claude Code

…sessions

Every Live session rendered "Provider not established". Two causes, fixed
per ADR-0021:

- Codex records its serving provider as model_provider (rollout session_meta
  and the state ledger threads table); the adapters read a bare provider field
  that does not exist, silently dropping observed evidence including custom
  model_providers entries (openrouter/azure/ollama). Read model_provider with
  legacy tolerance.
- Claude Code transcripts never name the serving endpoint. Resolve it from the
  host's documented selection surface (CLAUDE_CODE_USE_BEDROCK/_VERTEX/
  _FOUNDRY, ANTHROPIC_BASE_URL gateway classification) across settings layers
  (managed > project local > shared > user > shell, empty string = unset),
  yielding configured provenance for explicit selections and inferred for the
  first-party default — never observed.

Supporting invariants: projection retains established provider/model claims
when later events carry none (server + browser reducers); metadata learned
during transcript bootstrap (codex session_meta identity) persists into live
tailing; the UI names bedrock/vertex/foundry/gateway and falls back to
subagent-rooted nodes for child session cards.
@pacphi
pacphi merged commit 025ea18 into main Jul 31, 2026
11 checks passed
@pacphi
pacphi deleted the fix/live-provider-provenance branch July 31, 2026 09:24
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