Repository navigation
Conversation
samjulien
requested review from
MikeRyanDev,
davidmckayv,
dustywusty,
guidovizoso,
mxmzb and
tylerslaton
as code owners
October 28, 2026 16:55
samjulien
force-pushed
the
codex/openbot-model-selector
branch
from
October 28, 2026 18:50
d8f48b9 to
6316d7d
Compare
This branch has not been deployed
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.
What this changes
Built-in Bots currently run on the deployment's configured model. This adds opt-in model selection for ordinary one-to-one conversations, including the first message: enable Admin → Enterprise controls → Models → Allow model selection, then choose a model beside Send. The setting defaults to disabled.
Why this is a small first phase
This implements the OpenBot selection, persistence, authorization, and execution boundary without requiring a routing service. It prepares three increments:
Per-agent token usage and cost reporting remain a future increment. Effective-model attribution is in place here, but token counts, routing attempts, actual served models, pricing, and estimated versus billed costs are not. Switchback could centralize routing telemetry; direct and account-backed calls would still need their own instrumentation.
Account sign-in and scope
Signing in with ChatGPT/OpenAI or Claude/Anthropic does not enable this selector yet, even when the admin setting is on. Existing account-backed execution is preserved, with no fallback to API-key billing. Groups, externally connected agents, deployment-owned remote Bots, and custom API base URLs are also outside this PR's selector scope.
This is an integration gap rather than a claim that subscriptions cannot choose models:
PlanModelsends prompts/tools to the owned harness but has no selected-model field or model-capability API. It reports a plan identity rather than the resolved model.BOT_MODELor its Bot configuration and uses LangChain's private_ChatOpenAICodeximplementation. It does not expose model discovery or a per-run model override. The official Codex app-server model/list contract provides account-aware options, but this harness does not currently use that transport.A follow-up can supply harness-specific available models, validate the selected model at the trusted server/harness boundary, and preserve account billing, refresh, and per-run consistency. API model lists should not be treated as subscription entitlements. Account behavior was inspected in source and covered by eligibility/plan tests; no live account-sign-in validation is claimed.
Where it runs
0066_lazy_dragon_man.sqladds nullable JSONBmodel_selectiontointelligence_channel_mappings. The existing per-user/channel mapping holds{agentId, provider, model}. The admin switch uses the existing shared enterprise-settings store. Most added lines are the generated Drizzle schema snapshot.Boundary and audit
Changelog
An Unreleased entry describes the default-off feature and additive migration.
Proof
6316d7d7, including tests, real Chromium, all Python harness regressions, builds, migrations, types, platform startup checks, charts, and the finalverifyjob. Conditional image jobs were skipped by the workflow.mainat4bb0c0b4, preserving name personalization alongside per-run model resolution and the updated new-conversation flow. Post-rebase verification passed 225 focused tests (148 server, 77 UI), app/server types, formatting/lint, and both builds. Chromium and Anthropic SDK test fixes are now inherited frommain.