Repository navigation
feat(codex): enable Ultrafast for supported models - #158703
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 26, 2026, 9:29 PM ET / September 27, 2026, 01:29 UTC (Revision 4). ClawSweeper reviewWhat this changesThe Codex plugin adds an opt-in setting that requests Ultrafast when the selected model's authenticated app-server catalog entry advertises it, with configuration, documentation, and tests. Merge readiness⛔ Blocked before merge - 2 items remain Current main lacks model-aware Ultrafast selection, so this PR remains useful. The earlier Fast-mode and catalog-type findings are addressed in the current head, and this review found no new discrete code defect. A signed-in Codex turn is still needed to verify the native tier request. Priority: P2 Review scores
Verification
How this fits togetherThe Codex plugin turns OpenClaw model requests into native Codex app-server turns. Plugin settings and the shared Fast control determine a service tier, which is sent with the selected model in the turn request. flowchart LR
A[Plugin setting] --> C[Turn preparation]
B[Shared Fast control] --> C
C --> D[Selected native model]
D --> E[Authenticated model catalog]
E --> F{Ultrafast advertised?}
F -->|Yes| G[Ultrafast turn request]
F -->|No| H[Existing tier turn request]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +100, Tests +395, Docs +11, Generated 0. Total +506 across 17 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep tier selection in the Codex plugin and verify a supported turn and an unsupported-model fallback against the bundled, authenticated app-server before landing. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds a conditional tier option. Current main's configured service tier does not select Ultrafast per model. Is this the best way to solve the issue? Yes, a Codex plugin setting is the narrow owner for model-aware tier selection; the existing serviceTier setting cannot preserve another tier selectively across models. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 030a6eca356e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
662b846 to
f19af83
Compare
|
The updated commit preserves the existing shared Fast contract: on selects Commit: f19af83 @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
The final revision adds warm-turn regressions for a previously accepted Ultrafast override followed by Fast off, inactive auto, or unsupported model support, plus configured retry baselines. The earlier Fast-off fixture now follows current main when no tier is inherited: it omits the override. Production behavior is unchanged from the reviewed correction; fresh independent review of the complete candidate found no actionable issues. Commit: 442ff62 @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
The requested supported-model opt-in and its default The final review reports no code findings. The requested signed-in trace remains an acknowledged evidence gap, as stated in the PR body. Existing protocol validation and the registered turn fixtures establish the scoped catalog-to-turn contract, while live provider routing is not claimed. I accept that limitation for this default-off opt-in and am proceeding through the ordinary protected landing gates. |
## Why Release users need the optional supported-model Ultrafast setting while preserving their existing tier and shared Fast preferences. ## What Problem This Solves An unsupported requested native tier can clear the override instead of retaining the selected speed. This backports the reviewed conditional upgrade from [#158703](#158703). ## User Impact `appServer.enableUltrafast` defaults to `false`. When enabled, the actual authenticated Codex catalog must advertise Ultrafast for the selected native model before OpenClaw upgrades the turn. Unsupported models, unavailable catalogs, and disabled opt-in preserve the existing tier. Shared Fast off and inactive auto remain off. ## Why This Change Was Made Backport merged source commit `9c2335a2d07e397ac2e30aa73f9412b77479a9e9` onto the existing `sjf_openclaw_2026-09-04` branch. Package version stays `2026.9.4`. Compatibility changes retain this release's existing `openai` provider handling, schema and model normalization, and request owner. No newer protocol snapshot or provider modules are imported. The release's generated plugin budget increases only from 4141 to 4142 for the approved boolean; core and channel budgets stay unchanged. ## Evidence Source proof and release proof are separate: - Source PR completed exact-head ClawSweeper review with no code findings and passed its protected CI gates before merging. - Fresh independent review of the complete release candidate found no actionable P0–P2 findings. The final export-only correction also received clean independent review. - Release catalog/configuration tests: 215 passed. Registered turn-entry cohort: 22 passed, covering opt-out, unsupported native models, retained warm turns, inactive auto, and restoration of the original configured tier on retries. - Owning extension production and test type graphs passed. Scoped formatting passed. The generated configuration baseline check passed with only the approved plugin setting added. - Scoped type-aware lint passed for every changed Codex TypeScript file. Hosted CI on the final candidate is pending; no required hosted checks are configured for this existing release branch. No full build, live Gateway execution, or signed-in provider routing proof is claimed for this backport. Backport-Of: #158703 Release-Target: sjf_openclaw_2026-09-04
|
Merged via squash auto-merge.
|
33 upstream commits, including two low-value test batches (d048, d049) and Ultrafast for supported models (openclaw#158703). No file outside the generated set changed on both sides. Two conflicts, both generated: docs/.generated/config-baseline.counts.json and docs/.generated/config-baseline.sha256. This time the two sides moved different columns. This branch took the channel count from 3748 to 3750, and upstream's openclaw#158703, the only upstream commit on those files, took the plugin count from 4349 to 4350, so the combined count is channel 3750 and plugin 4350. Both files came from upstream and were regenerated, along with the channel metadata, which upstream did not touch. build:docker ran in a separate detached checkout of this commit outside the nested node_modules install. Regenerating there changed the counts and hash files and left the channel metadata identical, giving core 2463, channel 3750, plugin 4350 as predicted, this branch's channel hash and upstream's plugin hash. The three generated-file checks pass there. The lockfile did not move. No test this branch moved was deleted upstream in this range. The one test file upstream deleted outright (openclaw#159298) is one this branch never touched. Feishu: 105 files and 1850 tests in the extension project, 17 files and 319 tests in the database-workers project, all 122 Feishu test files on disk. The forwarder test and the routing guards pass, 1964 tests. tsgo:core, tsgo:extensions, tsgo:extensions:test, tsgo:test:root, the line-cap, max-lines and assertion-safety ratchets against upstream/main, oxlint and oxfmt on the 42 changed code files all pass.
* feat(codex): enable Ultrafast for supported models * test(codex): preserve unconfigured Fast off selection * test(codex): cover Ultrafast persistence and retry baselines * docs(codex): register optional Ultrafast config baseline * fix(codex): type advertised model service tiers --------- Co-authored-by: Sarah Fortune <[email protected]>
…olicies (#190036) ## Summary - **Problem:** `modelPolicy.allow` had two grammars under one name. Operator roles accepted a model-name prefix such as `openai/gpt-*`; agent policies rejected it. Role matching used a separate glob matcher, and five other callers detected wildcards by hand (`endsWith("/*")`, `slice(0, -2)`, `startsWith`). The copies agreed today but could drift, for example on padded refs like `"openai / *"`. - **Fix:** `src/config/model-policy-ref.ts` now owns one parser (`parseModelPolicyWildcardRef`: `provider/*`, `provider/namespace/*`, `provider/family-*`) and one matcher (`modelPolicyWildcardMatches`). Role policy matching, config validation, `isModelKeyAllowedBySet`, configured model entries, alias candidates, `models status` and the legacy Codex wildcard migration use them. The role-only parser, the role glob matcher and the role-only validation branch are deleted. - **User impact:** agent policies now also accept model-name prefixes such as `openai/gpt-*`. Existing agent and role configs keep their meaning; no config is invalidated. ## Evidence **Live Gateway, real operator-role identity.** Setup: - Candidate Gateway (`openclaw.mjs gateway run` from this branch) on an isolated HOME, state and loopback port. - `gateway.auth.mode: "trusted-proxy"` with a loopback proxy that sets `x-forwarded-user: [email protected]`. - `gateway.roles.default: "limited"`, with `modelPolicy: { allow: ["fixture/echo-*"], deny: ["fixture/echo-restricted*"] }`. - A loopback fake OpenAI-completions provider that logs every request. - The client is the real `GatewayClient` (webchat mode, device identity, no token), so the proxy-verified user is its only credential. ```text (1)+(2) sessions.patch fixture/echo-restricted -> FORBIDDEN "Your operator role cannot use this model…" sessions.patch fixture/echo-restricted-mini -> FORBIDDEN sessions.patch fixture/other-x -> FORBIDDEN (outside allow) sessions.patch fixture/echo-main -> ok agent run on that session -> status ok provider log: POST /v1/chat/completions model=echo-main (only request; no echo-restricted* or other-x call) (3) live reload narrows the role: deny += "fixture/echo-main*" [reload] config change detected; evaluating reload (gateway.roles.definitions.limited.modelPolicy.deny) next agent run on the pinned echo-main session -> status error "Your operator role cannot use this model…" provider requests before=2 after=2 (no new provider call) (4) upgrade cell, same state directory: published [email protected] Gateway writes and serves the role config: echo-restricted / echo-restricted-mini / other-x -> FORBIDDEN, echo-main -> ok, provider called with echo-main stop; candidate `doctor --fix` (agent DB schema 25 -> 39, role config untouched); candidate Gateway on that state: identical sessions.patch decisions (diff: IDENTICAL), provider called only with echo-main ``` **Role policy compatibility (main vs this PR, real owner code).** One script prepared role policies through `prepareOperatorModelPolicy` on an `origin/main` checkout and on this branch. It evaluated `allows()` for 12 models under 5 policies (family deny `vendor/restricted-v1*`, family allow `vendor/gpt-*`, nested `router/anthropic/*`, padded ` VENDOR / gpt-* ` with deny `vendor/gpt-5.5*`, inherited-source deny `vendor/restricted-*`). It also captured the `main` snapshots with `captureOperatorModelPolicySnapshot` and restored them on this branch with `restoreOperatorModelPolicySnapshot`. ```text prepared decisions, main vs PR: 0 differences / 60 main snapshots restored on PR vs main: 0 differences / 60 familyDeny on PR: vendor/restricted-v1 false, vendor/restricted-v1-mini false, vendor/restricted-v2 true, vendor/primary true ``` **Admission proof.** New case in `src/gateway/sessions-patch.operator-model-policy.test.ts` drives `projectSessionsPatchEntry` (the `sessions.patch` owner that admits a model before any run or provider request) with role policy `allow: ["fixture/*"]`, `deny: ["fixture/restricted-v1*"]`, once with the freshly prepared policy and once with a policy restored from its captured snapshot: ```text fixture/restricted-v1 -> FORBIDDEN "operator role cannot use this model" fixture/restricted-v1-mini -> FORBIDDEN fixture/allowed -> ok; after the operator source is revoked, its commit guard -> FORBIDDEN ``` It fails with this PR's first matcher (strict length check) and passes now. Rebased onto #190019; `pnpm check:changed` and the auth-model-policy suites pass on the rebased head. Role admission suites that consume this predicate before provider calls also pass on this branch: model fallback, CLI runner, isolated completion and image fallback operator-policy suites, plus `operator-model-policy.test.ts` (65 tests). - New regression in `model-visibility-policy.test.ts` (agent policy `openai/gpt-5.6-*` allows `gpt-5.6-sol`, not `gpt-5.5`) fails on `origin/main` and passes here. - Validation table adds `openai/gpt-*` (valid for agents) and rejects `openai/gpt *` and `*`. - Focused suites pass: model visibility, config model-ref validation, operator model policy, role mutation authority, `models status`, legacy Codex model migration, configured model entries, model selection. - Role compatibility: `modelPolicyWildcardMatches` is a plain prefix test, the same set the old role glob (`^prefix.*$`) accepted, because the parser forbids any other `*`. A new operator-policy regression (`allow: ["vendor/*"]`, `deny: ["vendor/restricted-v1*"]` must deny `vendor/restricted-v1` itself) fails on the first head of this PR and passes now. Stored role snapshots keep the same canonical wildcard keys, so restored policies match as before. - `pnpm check:changed` (dead-code step skipped) passes; config docs baseline regenerated. ## Merge danger Two-way door: no stored state or migration; a revert restores the narrower agent grammar. Blast radius: model policy matching for agents and operator roles. Role semantics are unchanged (same prefix rule, same normalized `provider/model` key). Pash/Sarah check: Sarah's commits on these files (#161609, #162335, #161048, #161004, #159363, #158307, #158703, #151176, #123875) touch Agents API, Codex and Slack config help/validation entries. This PR edits only model-policy wildcard parsing, matching and help text, so their behavior is unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
…olicies (openclaw#190036) ## Summary - **Problem:** `modelPolicy.allow` had two grammars under one name. Operator roles accepted a model-name prefix such as `openai/gpt-*`; agent policies rejected it. Role matching used a separate glob matcher, and five other callers detected wildcards by hand (`endsWith("/*")`, `slice(0, -2)`, `startsWith`). The copies agreed today but could drift, for example on padded refs like `"openai / *"`. - **Fix:** `src/config/model-policy-ref.ts` now owns one parser (`parseModelPolicyWildcardRef`: `provider/*`, `provider/namespace/*`, `provider/family-*`) and one matcher (`modelPolicyWildcardMatches`). Role policy matching, config validation, `isModelKeyAllowedBySet`, configured model entries, alias candidates, `models status` and the legacy Codex wildcard migration use them. The role-only parser, the role glob matcher and the role-only validation branch are deleted. - **User impact:** agent policies now also accept model-name prefixes such as `openai/gpt-*`. Existing agent and role configs keep their meaning; no config is invalidated. ## Evidence **Live Gateway, real operator-role identity.** Setup: - Candidate Gateway (`openclaw.mjs gateway run` from this branch) on an isolated HOME, state and loopback port. - `gateway.auth.mode: "trusted-proxy"` with a loopback proxy that sets `x-forwarded-user: [email protected]`. - `gateway.roles.default: "limited"`, with `modelPolicy: { allow: ["fixture/echo-*"], deny: ["fixture/echo-restricted*"] }`. - A loopback fake OpenAI-completions provider that logs every request. - The client is the real `GatewayClient` (webchat mode, device identity, no token), so the proxy-verified user is its only credential. ```text (1)+(2) sessions.patch fixture/echo-restricted -> FORBIDDEN "Your operator role cannot use this model…" sessions.patch fixture/echo-restricted-mini -> FORBIDDEN sessions.patch fixture/other-x -> FORBIDDEN (outside allow) sessions.patch fixture/echo-main -> ok agent run on that session -> status ok provider log: POST /v1/chat/completions model=echo-main (only request; no echo-restricted* or other-x call) (3) live reload narrows the role: deny += "fixture/echo-main*" [reload] config change detected; evaluating reload (gateway.roles.definitions.limited.modelPolicy.deny) next agent run on the pinned echo-main session -> status error "Your operator role cannot use this model…" provider requests before=2 after=2 (no new provider call) (4) upgrade cell, same state directory: published [email protected] Gateway writes and serves the role config: echo-restricted / echo-restricted-mini / other-x -> FORBIDDEN, echo-main -> ok, provider called with echo-main stop; candidate `doctor --fix` (agent DB schema 25 -> 39, role config untouched); candidate Gateway on that state: identical sessions.patch decisions (diff: IDENTICAL), provider called only with echo-main ``` **Role policy compatibility (main vs this PR, real owner code).** One script prepared role policies through `prepareOperatorModelPolicy` on an `origin/main` checkout and on this branch. It evaluated `allows()` for 12 models under 5 policies (family deny `vendor/restricted-v1*`, family allow `vendor/gpt-*`, nested `router/anthropic/*`, padded ` VENDOR / gpt-* ` with deny `vendor/gpt-5.5*`, inherited-source deny `vendor/restricted-*`). It also captured the `main` snapshots with `captureOperatorModelPolicySnapshot` and restored them on this branch with `restoreOperatorModelPolicySnapshot`. ```text prepared decisions, main vs PR: 0 differences / 60 main snapshots restored on PR vs main: 0 differences / 60 familyDeny on PR: vendor/restricted-v1 false, vendor/restricted-v1-mini false, vendor/restricted-v2 true, vendor/primary true ``` **Admission proof.** New case in `src/gateway/sessions-patch.operator-model-policy.test.ts` drives `projectSessionsPatchEntry` (the `sessions.patch` owner that admits a model before any run or provider request) with role policy `allow: ["fixture/*"]`, `deny: ["fixture/restricted-v1*"]`, once with the freshly prepared policy and once with a policy restored from its captured snapshot: ```text fixture/restricted-v1 -> FORBIDDEN "operator role cannot use this model" fixture/restricted-v1-mini -> FORBIDDEN fixture/allowed -> ok; after the operator source is revoked, its commit guard -> FORBIDDEN ``` It fails with this PR's first matcher (strict length check) and passes now. Rebased onto openclaw#190019; `pnpm check:changed` and the auth-model-policy suites pass on the rebased head. Role admission suites that consume this predicate before provider calls also pass on this branch: model fallback, CLI runner, isolated completion and image fallback operator-policy suites, plus `operator-model-policy.test.ts` (65 tests). - New regression in `model-visibility-policy.test.ts` (agent policy `openai/gpt-5.6-*` allows `gpt-5.6-sol`, not `gpt-5.5`) fails on `origin/main` and passes here. - Validation table adds `openai/gpt-*` (valid for agents) and rejects `openai/gpt *` and `*`. - Focused suites pass: model visibility, config model-ref validation, operator model policy, role mutation authority, `models status`, legacy Codex model migration, configured model entries, model selection. - Role compatibility: `modelPolicyWildcardMatches` is a plain prefix test, the same set the old role glob (`^prefix.*$`) accepted, because the parser forbids any other `*`. A new operator-policy regression (`allow: ["vendor/*"]`, `deny: ["vendor/restricted-v1*"]` must deny `vendor/restricted-v1` itself) fails on the first head of this PR and passes now. Stored role snapshots keep the same canonical wildcard keys, so restored policies match as before. - `pnpm check:changed` (dead-code step skipped) passes; config docs baseline regenerated. ## Merge danger Two-way door: no stored state or migration; a revert restores the narrower agent grammar. Blast radius: model policy matching for agents and operator roles. Role semantics are unchanged (same prefix rule, same normalized `provider/model` key). Pash/Sarah check: Sarah's commits on these files (openclaw#161609, openclaw#162335, openclaw#161048, openclaw#161004, openclaw#159363, openclaw#158307, openclaw#158703, openclaw#151176, openclaw#123875) touch Agents API, Codex and Slack config help/validation entries. This PR edits only model-policy wildcard parsing, matching and help text, so their behavior is unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
Why
Users want to enable Ultrafast wherever their selected Codex model supports it while keeping their existing speed preference on other models.
What Problem This Solves
A requested but unsupported Codex tier can clear the override instead of preserving the current speed selection.
User Impact
Add
plugins.entries.codex.config.appServer.enableUltrafast, defaulting tofalse. OpenClaw requestsultrafastonly when the actual authenticated app-server catalog advertises it for the selected native model. Unsupported models, custom providers, and unavailable catalogs retain the current tier.Why This Change Was Made
The optional upgrade runs at the turn boundary, after normal tier selection. The generated plugin configuration budget increases by exactly one for the explicitly requested opt-in boolean; core and channel budgets stay unchanged. Existing shared Fast behavior stays intact: on selects
priority, off or inactive auto clears the override, and no shared control uses the configured or bound native preference. Active auto and standalone enablement can use Ultrafast when supported. Catalog discovery has a bounded budget and preserves cancellation and live ownership checks, without an additional entitlement cache.Evidence
Final source head
64f0745b701ae4bc83b914326fc2b5e3f2ef4d29merged as9c2335a2d07e397ac2e30aa73f9412b77479a9e9. ClawSweeper reviewed that exact head with no code findings. The native verification below addresses its remaining signed-in app-server proof request.git diff --checkpassed. Independent compatibility review found no actionable issues.No full image build or deployed Gateway/Slack E2E result is claimed.
Native service-tier verification
The remaining native-contract check was completed on 2026-09-26 at 19:03 PDT against a signed-in Codex 0.155.1 app-server. The probe imported the actual tier selector from the merged existing-release backport,
06b999fa4fcb3d6cc1d5c3836420ca7532845cca(OpenClaw2026.9.4), and used the same authenticated client for catalog lookup and turn requests.Each new test thread began at
priority. The release selector received its actual selected model and the live catalog, with Ultrafast enabled. The following redacted trace summarizes the realmodel/list,thread/start,turn/start, and post-turnthread/resumeresponses. Model identifiers are consistently anonymized; both returned models were checked against the requested model.priority,ultrafastultrafastultrafastOKpriorityprioritypriorityOKBoth turns used text-only instructions, read-only sandboxing, and no approvals or tool calls. The two owned test threads were archived and the isolated probe process exited. The trace verifies native app-server acceptance and unsupported-model fallback. It does not measure backend processing-tier assignment or latency, and it is not a deployed Gateway or Slack E2E result.