2 Commits

Author SHA1 Message Date
NoxsMedia
104e844b55 feat(codex): persist managed reasoning effort overrides (#789)
* feat(codex): persist managed reasoning effort overrides

* fix(codex): protect managed catalog refresh state

* feat(codex): allow user reasoning overrides

Expose only owner-scoped managed Codex model metadata and validate updates against provider-supported reasoning levels. Add ordinary-user settings controls without granting model catalog or provider administration access.

* fix(codex): bind reasoning overrides to OAuth account

Persist only a one-way account binding on managed Codex profiles. Hide and reject stale or legacy-unbound reasoning controls until a successful catalog refresh, and do not carry overrides across account switches.

* fix(codex): reject stale cross-account overrides

* fix(codex): isolate account switches at runtime
2026-08-12 23:38:15 +08:00
Bingxi Zhao (Frank)
4041c75d8e feat(multi-user): let each account sign in to its own Codex (#781)
A Codex token authorizes one person's ChatGPT plan, so the profile is
correctly never grantable — but the OAuth endpoints were admin-only too,
which left ordinary users unable to reach Codex by any route: they could
neither be given the administrator's profile nor sign in for themselves.

What made per-user sign-in unsafe was where the profile landed:
``get_model_catalog_service()`` resolves a non-admin to the ADMIN catalog, so
a user's sync would have published their profile into the shared one. A
sign-in now publishes into the owner's own catalog, keyed by the same owner
resolution as the credential store, so a login and its profile can never
land in different places. Ordinary users get
``data/users/<uid>/settings/model_catalog.json``; an administrator gets the
shared catalog exactly as before.

``redacted_model_access`` — the one place grants are resolved — gains those
personal rows (source="personal") for the caller's OWN id only, so the
option list, the capability gate, and selection validation agree without
three separate merges, and an administrator inspecting somebody's grants
still sees only what they assigned. The resolution path merges the same
profiles so a personal selection resolves to a real profile, with the
owner's copy winning over a shared profile of the same managed id (the ids
are per-provider constants, and the administrator's copy lists their models,
not the user's).

Runtime token ownership needed no change: the provider already reads the
token per owner. Endpoint gating is narrower rather than absent — a partner
is refused, since it is a synthetic user whose owner is a real account and
admitting one would mean acting on that person's login, sign-out included.

The restricted-user Settings → LLM page grows the connect/refresh/sign-out
card (no catalog, no credentials), and a sign-in now drops the cached model
options so a freshly connected account does not keep seeing the old list.
2026-08-07 21:09:40 +08:00