fix(live): graded inference-provider provenance for Claude and Codex sessions - #103
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_providersentry) with honest, graded provenance. Documented as ADR-0021.session_metaand thestate_N.sqlitethreadstable spell the fieldmodel_provider; the adapters read a bareproviderthat doesn't exist, so observed evidence was silently dropped. Now read with legacy tolerance → sessions surfaceopenai/openrouter/azure/ollamaetc. as observed.CLAUDE_CODE_USE_BEDROCK/_VERTEX/_FOUNDRY,ANTHROPIC_BASE_URLgateway 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.session_metaidentity 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.11× claude → anthropic (inferred),25× codex session → openai (observed),64× codex subagent → openai (observed)— zero "Provider not established" where evidence exists.Grounding
model_providerin session_meta and threads schema (verified live + openai/codex session examples; custom providers per Advanced Configuration).🤖 Generated with Claude Code