Skip to content

Manage each harness's default model and add it to Getting started - #141

Merged
SaladDay merged 13 commits into
mainfrom
codex/web-default-models
Sep 25, 2026
Merged

SaladDay merged 13 commits into
mainfrom
codex/web-default-models

Conversation

@SaladDay

@SaladDay SaladDay commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Manage each harness's default model from the System page, and add a "Set a default model" step to Getting started (phase 3 of the new-user install plan). The Core routes and shared-client methods merged in #140.

System page: Default model

  • One card per harness (listHarnesses).
    • Enabled and default are shown read-only, with a hint that they change in config.json and apply with parsar apply.
    • The provider shows protocol, base URL, whether a key is configured, the context window and max output tokens when set, and when it was updated.
  • Set / Replace. The form's API key is required every time. It's never prefilled or shown, and it's forgotten when the form closes. Clear asks for confirmation.
  • Errors.
    • A 4xx shows Core's message.
    • A timeout or other 5xx shows "outcome not confirmed" and rereads.
    • A 503 credential_storage_unavailable shows a configuration error: installer-based installs configure the key automatically, and manual deployments set AGENTS_API_CREDENTIAL_KEY_FILE.
    • Writes are never retried.
  • Key safety. The key lives only in the form's local state, so it never reaches React Query mutation state, storage, the URL or logs (e2e-checked).
  • Scope (help tip).
    • Applies to Core-hosted Sessions and Sessions without an environment.
    • Self-hosted Sessions bring their own key.
    • A provider in the request or on the Agent takes priority.
  • Shared labels. Harness and protocol labels now live in lib/harness-labels.ts, shared by the Agent and System pages.

Getting started: Set a default model

  • Step 2 of 4. It's done when the default: true harness has a model provider; if none is marked default, any enabled harness counts.
  • Action. "Open System" focuses the default harness's Set/Replace button.
  • Copy. It says apps can also pass a model per request or save one on the Agent, so this step only sets the default.
  • Existing checklists. A checklist that was already closed stays closed.

Tests

  • Web e2e:
    • list, set, replace, clear;
    • mcode limits error;
    • the 503 configuration error;
    • the Getting started step leading to System and turning done;
    • no key in storage, the URL or cookies.
  • Results: 30/30 in the full e2e run. agents-client 601, web 342, typecheck and build all pass.

docs/web (for the backend session's review)

  • README.md:24
  • protocol-coverage.md:115-116 and :118-127 (new Default models table)
  • roadmap.md:19-21 and :46

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

System gains a Default model section with one card per harness from
GET /core/v1/harnesses: its read-only startup state (enabled, default;
set in config.json and applied with parsar apply) and its deployment
default model provider, or Not set. Set/Replace opens a form whose API
key is required, never prefilled and dropped with the form; Clear asks
for confirmation. Writes are never retried and are followed by a reread;
Core's 400 message is shown beside the form.
The fixture serves /core/v1/harnesses and the model-provider routes as
Core does: 404 while unset, 400 with Core's message and param for a
missing key or mcode without limits, a list that reflects writes and an
idempotent DELETE. It never keeps an API key.
The section help now says what Core confirmed: the default applies to
Core-hosted Sessions and Sessions without an environment, after a
provider in the request or on the Agent; self-hosted Sessions bring
their own key. The zh-CN key label keeps the API term in English.
PRODUCT.md and the console surface note that System manages each
harness's default model; DESIGN.md describes its cards, the set/replace
form whose key is never shown, and Clear's confirmation.
The System row in docs/web/README.md and the deployment-configuration
item of the admin backend requirements (en, zh-CN) now describe the
/core/v1/harnesses routes the console uses, the write-only key and where
the default applies.
apps/web/.shoot-click.mjs was a local screenshot helper marked for
deletion before commit; nothing references it.
Both pages read one map of harness product names and one of provider
protocol names from lib/harness-labels.ts instead of keeping copies.
A 503 credential_storage_unavailable on saving a default model now says
Core has no credential encryption key and how to configure one, instead
of an unconfirmed outcome, and triggers no reread. The fixture gains a
credentials=none reset mode and the System acceptance test covers it.
Between sandboxes and the project key, the checklist asks for a default
model: done once the default harness has a deployment default model
provider, or, without a default harness, once any enabled harness has
one; Unknown when the harness list cannot be read. Open System lands on
the default harness's Set or Replace. A closed checklist stays closed.
The demo fixture's default harness now has a default model, so a
set-up deployment still reads You're set; the System tests start from a
fresh install.
PRODUCT.md and DESIGN.md list the fourth Getting started step and its
Open System action; docs/web/protocol-coverage.md records how the console
uses the /core/v1/harnesses routes, and roadmap.md the new step and
browser coverage.
@SaladDay
SaladDay force-pushed the codex/web-default-models branch from 63e4638 to 2f063aa Compare September 25, 2026 22:58
The fixture now answers as Core's handler does: its 404 texts, one
body-shape message for wrong types, negative limits and int32 overflow,
the JSON body gate with the route's 32 KiB limit, the 16384-byte key
limit, and no param fields Core does not send.
The protocol is the one Core accepts for the harness, shown read-only
and still sent. Limits above 2147483647 are refused in the form, and max
output needs a context window at least as large, as Core requires. Field
errors are linked with aria-describedby and the Base URL error sits
outside its label. Save is the form's submit button, so Enter saves,
guarded against a second submit. The dialog title follows the latest
list after a reread. The Clear consequence names Sessions without an
environment. Acceptance adds an unconfirmed 500 save (one PUT, one
reread) and checks the key is not in the page after the form closes.
The Getting started step says Core-hosted Sessions and Sessions without
an environment need a model provider, which apps may also pass per
request or save on the Agent.
@SaladDay
SaladDay merged commit 974df32 into main Sep 25, 2026
1 of 2 checks passed
@SaladDay
SaladDay deleted the codex/web-default-models branch October 7, 2026 06:38
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