Repository navigation
feat(openai): support prepared image Decisions - #176133
Conversation
Select capability-specific Platform routes before credential resolution, and preserve prepared request authority for native V2 image and per-question refusal handling. Release note: OpenAI Decision models support inline PNG, JPEG, and WebP evidence with independent question refusals. Native authenticated qualification remains pending before landing.
|
🦞👀 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. What this changesThis PR adds prepared OpenAI Decision evaluations with inline images, independent question refusals, and capability-specific credential routing. Example: Evaluate a red PNG using openai/gpt-6-luna with Boolean, color-choice, and intensity-score questions.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this maintainer-authored feature open; both prior findings are addressed, and this review found no additional actionable code defect. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Decision host combines configured model selection, provider-owned route metadata, and prepared credentials before passing evidence to the OpenAI adapter; validated answers and usage return through the shared Decision runtime. flowchart LR
A[Decision caller] --> B[Shared Decision host]
B --> C[Prepared model catalog]
C --> D[Provider route policy]
D --> E[Prepared credential owner]
E --> F[OpenAI Decision adapter]
F --> G[Guarded Decisions HTTP request]
G --> H[Validated answers and usage]
Technical reviewBest possible solution: Keep capability selection with the existing provider route owner and credential authority with the prepared runtime, using the OpenAI adapter only for transport and result translation. Do we have a high-confidence way to reproduce the issue? Current-main source directly establishes the text/JSON-only V1 adapter and whole-batch refusal behavior; no target code was executed during this review. Is this the best way to solve the issue? The implementation follows the existing ownership boundaries, replaces the adapter's separate credential lookup, and introduces no unnecessary state owner or parallel transport path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c57ba363c29c. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +118, Tests +940, Docs +36. Total +1094 across 25 files. Added test files: 2. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 18, 2026, 4:36 AM ET / 08:36 UTC (Revision 2). |
Capture configured Decision selectors without changing conversational runtime selection. Normalize route metadata through the canonical SDK parser and repair registered OpenAI setup proof.
|
@clawsweeper re-review Please review exact head Native authenticated Platform API qualification remains pending and blocks landing. No eligible named Foundation key consumer is established; synthetic HTTP and packaged-build proof do not replace the native text/image live gate. The PR body records the exact proof and limitation. No merge is requested. |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
Decision references added by #176133 were being treated as direct chat provider IDs before the existing Decision contract-owner lookup. When the provider and plugin IDs differ, metadata selection falls back to the whole inventory. Provider activation still works, but startup does extra work. Let the existing capability lookup own Decision refs and preserve direct provider validation for the other configured models. Keep the per-agent regression and cover default Decision selection with the same contract. Validation: exact current-main failure reproduced in 31.49s. Native Bun startup siblings passed (15 tests, 45.02s); channel metadata siblings passed (87 tests, 18.86s). Core/test types, targeted lint/format, full packaged build (4m33.5s), and independent P2 review passed.
* feat(openai): support prepared image Decisions Select capability-specific Platform routes before credential resolution, and preserve prepared request authority for native V2 image and per-question refusal handling. Release note: OpenAI Decision models support inline PNG, JPEG, and WebP evidence with independent question refusals. Native authenticated qualification remains pending before landing. * fix(decisions): prepare capability-owned model references Capture configured Decision selectors without changing conversational runtime selection. Normalize route metadata through the canonical SDK parser and repair registered OpenAI setup proof. * test(openai): exercise native Decision dispatch authority
…w#176313) Decision references added by openclaw#176133 were being treated as direct chat provider IDs before the existing Decision contract-owner lookup. When the provider and plugin IDs differ, metadata selection falls back to the whole inventory. Provider activation still works, but startup does extra work. Let the existing capability lookup own Decision refs and preserve direct provider validation for the other configured models. Keep the per-agent regression and cover default Decision selection with the same contract. Validation: exact current-main failure reproduced in 31.49s. Native Bun startup siblings passed (15 tests, 45.02s); channel metadata siblings passed (87 tests, 18.86s). Core/test types, targeted lint/format, full packaged build (4m33.5s), and independent P2 review passed.
#201746) Root cause: src/agents/model-catalog-metadata.ts:127 (and :57 in `clearRouteBoundCatalogMetadata`) on main fd4807a turned any declared `inference` into `{ chat: false }` when the configured route differs from the catalog route, so GPT-6 Luna's `{ chat: true, decision }` catalog row became a chat veto on the ChatGPT/Codex subscription route. Fixes #201513 ## What Problem This Solves Since 2026.11.5, people who use GPT-6 Luna through a ChatGPT/Codex subscription get "does not support chat" on every turn, from `openclaw infer model run --local` and from the Gateway, before any request is sent. Other OpenAI models on the same route still work. ## User Impact User impact: `openai/gpt-6-luna` runs again on the ChatGPT/Codex subscription route, as it did on 2026.11.3. Models whose catalog says they cannot chat stay refused with the same message, and Luna's Decision settings stay tied to the OpenAI Platform route. ## Why This Change Was Made 2026.11.5 gave the bundled Luna row both chat and Decision capability (#176133). When the configured route differs from the catalog route, the catalog overlay drops route-bound facts, but it also replaced Luna's `chat: true` with `chat: false`. The overlay now decides inference once: on a changed route it keeps a veto only when the catalog row says `chat: false`, and otherwise drops the whole route-bound declaration, Decision facts included, so the model is treated as chat like the other OpenAI rows on that route. Two changes on top of @MertBasar0's commit: - The provider-config merge (`mergeProviderModels`) is left as on main. There a decision-bearing row is a discovered per-route grant, such as ClawRouter's granted Luna, and #186596 deliberately keeps vetoing it on another route because ClawRouter's catalog declares Luna typed-only (docs/providers/clawrouter.md). With the merge change, `utility-completion.clawrouter.test.ts` fails: the refreshed catalog lets typed-only ClawRouter Luna chat on a changed configured route. - With only the veto dropped, an API-only route change (which skips `clearRouteBoundCatalogMetadata`) let Luna's Decision facts ride along to the new route. The overlay now strips base inference and sets it once. Codex agrees on the subscription route: its backend `/models` metadata (`codex-rs/protocol/src/openai_models.rs:419-421`, `ModelInfo`) and `model/list` (`codex-rs/app-server/src/models.rs:16`, `model_from_preset`) carry no chat-or-Decision capability split, and `gpt-6-luna` is listed like any other agent model (`codex-rs/models-manager/models.json:1045`, `visibility: "list"`, `shell_type: "shell_command"`). Thanks @Caitoz for the report and the precise analysis, and @MertBasar0 for the fix this builds on. ## Evidence Real built CLI and Gateway with the issue's config verbatim (`openai-chatgpt-responses`, `https://chatgpt.com/backend-api/codex`, `auth: oauth`, `agentRuntime: openclaw`), a fixture ChatGPT OAuth profile and a local ChatGPT-backend fixture; the real bundled Codex app-server uses the same fixture. No real account. - Before (main fd4807a; also v2026.11.5): `infer model run --local` fails with "This model doesn't support chat; pick another model." (2026.11.5: "Model openai/gpt-6-luna does not support chat inference"); Gateway `models.list` hides Luna and `chat.send` gets the same refusal. The fixture receives no model request. - After (this PR): `infer model run --local` returns `FIXTURE-ACK`; Gateway lists Luna and `chat.send` answers `FIXTURE-ACK`; the fixture logs `POST /backend-api/codex/responses model gpt-6-luna`. - Controls, same before and after: typed-only `clawrouter/openai/gpt-6-luna` granted chat on ClawRouter's endpoint but configured on another route is still refused with the existing message and sends nothing; Luna on its own Platform catalog route reaches the provider; Luna on the native Codex runtime answers through Codex. - Regression: one case in `model-catalog-inference.test.ts` (a `chat: true` + Decision row on a new endpoint or API keeps no inference). On main both routes fail with `expected { chat: false } to be undefined`; on the contributor commit alone the API route fails with `expected { chat: true, decision: … } to be undefined`. Observed proof lines: #201746 (comment) Merge danger: two-way door. Only in-memory catalog metadata changes; nothing is written or migrated, and a revert restores the old behavior. Blast radius: models whose bundled catalog row declares `chat: true` together with Decision facts, used on a non-catalog route; today that is only `openai/gpt-6-luna`. Co-authored-by: Ayaan Zaidi <[email protected]>
openclaw#201746) Root cause: src/agents/model-catalog-metadata.ts:127 (and :57 in `clearRouteBoundCatalogMetadata`) on main 07aa1df turned any declared `inference` into `{ chat: false }` when the configured route differs from the catalog route, so GPT-6 Luna's `{ chat: true, decision }` catalog row became a chat veto on the ChatGPT/Codex subscription route. Fixes openclaw#201513 ## What Problem This Solves Since 2026.11.5, people who use GPT-6 Luna through a ChatGPT/Codex subscription get "does not support chat" on every turn, from `openclaw infer model run --local` and from the Gateway, before any request is sent. Other OpenAI models on the same route still work. ## User Impact User impact: `openai/gpt-6-luna` runs again on the ChatGPT/Codex subscription route, as it did on 2026.11.3. Models whose catalog says they cannot chat stay refused with the same message, and Luna's Decision settings stay tied to the OpenAI Platform route. ## Why This Change Was Made 2026.11.5 gave the bundled Luna row both chat and Decision capability (openclaw#176133). When the configured route differs from the catalog route, the catalog overlay drops route-bound facts, but it also replaced Luna's `chat: true` with `chat: false`. The overlay now decides inference once: on a changed route it keeps a veto only when the catalog row says `chat: false`, and otherwise drops the whole route-bound declaration, Decision facts included, so the model is treated as chat like the other OpenAI rows on that route. Two changes on top of @MertBasar0's commit: - The provider-config merge (`mergeProviderModels`) is left as on main. There a decision-bearing row is a discovered per-route grant, such as ClawRouter's granted Luna, and openclaw#186596 deliberately keeps vetoing it on another route because ClawRouter's catalog declares Luna typed-only (docs/providers/clawrouter.md). With the merge change, `utility-completion.clawrouter.test.ts` fails: the refreshed catalog lets typed-only ClawRouter Luna chat on a changed configured route. - With only the veto dropped, an API-only route change (which skips `clearRouteBoundCatalogMetadata`) let Luna's Decision facts ride along to the new route. The overlay now strips base inference and sets it once. Codex agrees on the subscription route: its backend `/models` metadata (`codex-rs/protocol/src/openai_models.rs:419-421`, `ModelInfo`) and `model/list` (`codex-rs/app-server/src/models.rs:16`, `model_from_preset`) carry no chat-or-Decision capability split, and `gpt-6-luna` is listed like any other agent model (`codex-rs/models-manager/models.json:1045`, `visibility: "list"`, `shell_type: "shell_command"`). Thanks @Caitoz for the report and the precise analysis, and @MertBasar0 for the fix this builds on. ## Evidence Real built CLI and Gateway with the issue's config verbatim (`openai-chatgpt-responses`, `https://chatgpt.com/backend-api/codex`, `auth: oauth`, `agentRuntime: openclaw`), a fixture ChatGPT OAuth profile and a local ChatGPT-backend fixture; the real bundled Codex app-server uses the same fixture. No real account. - Before (main 07aa1df; also v2026.11.5): `infer model run --local` fails with "This model doesn't support chat; pick another model." (2026.11.5: "Model openai/gpt-6-luna does not support chat inference"); Gateway `models.list` hides Luna and `chat.send` gets the same refusal. The fixture receives no model request. - After (this PR): `infer model run --local` returns `FIXTURE-ACK`; Gateway lists Luna and `chat.send` answers `FIXTURE-ACK`; the fixture logs `POST /backend-api/codex/responses model gpt-6-luna`. - Controls, same before and after: typed-only `clawrouter/openai/gpt-6-luna` granted chat on ClawRouter's endpoint but configured on another route is still refused with the existing message and sends nothing; Luna on its own Platform catalog route reaches the provider; Luna on the native Codex runtime answers through Codex. - Regression: one case in `model-catalog-inference.test.ts` (a `chat: true` + Decision row on a new endpoint or API keeps no inference). On main both routes fail with `expected { chat: false } to be undefined`; on the contributor commit alone the API route fails with `expected { chat: true, decision: … } to be undefined`. Observed proof lines: openclaw#201746 (comment) Merge danger: two-way door. Only in-memory catalog metadata changes; nothing is written or migrated, and a revert restores the old behavior. Blast radius: models whose bundled catalog row declares `chat: true` together with Decision facts, used on a non-catalog route; today that is only `openai/gpt-6-luna`. Co-authored-by: Ayaan Zaidi <[email protected]>
#201746) Root cause: src/agents/model-catalog-metadata.ts:127 (and :57 in `clearRouteBoundCatalogMetadata`) on main fd4807a turned any declared `inference` into `{ chat: false }` when the configured route differs from the catalog route, so GPT-6 Luna's `{ chat: true, decision }` catalog row became a chat veto on the ChatGPT/Codex subscription route. Fixes #201513 ## What Problem This Solves Since 2026.11.5, people who use GPT-6 Luna through a ChatGPT/Codex subscription get "does not support chat" on every turn, from `openclaw infer model run --local` and from the Gateway, before any request is sent. Other OpenAI models on the same route still work. ## User Impact User impact: `openai/gpt-6-luna` runs again on the ChatGPT/Codex subscription route, as it did on 2026.11.3. Models whose catalog says they cannot chat stay refused with the same message, and Luna's Decision settings stay tied to the OpenAI Platform route. ## Why This Change Was Made 2026.11.5 gave the bundled Luna row both chat and Decision capability (#176133). When the configured route differs from the catalog route, the catalog overlay drops route-bound facts, but it also replaced Luna's `chat: true` with `chat: false`. The overlay now decides inference once: on a changed route it keeps a veto only when the catalog row says `chat: false`, and otherwise drops the whole route-bound declaration, Decision facts included, so the model is treated as chat like the other OpenAI rows on that route. Two changes on top of @MertBasar0's commit: - The provider-config merge (`mergeProviderModels`) is left as on main. There a decision-bearing row is a discovered per-route grant, such as ClawRouter's granted Luna, and #186596 deliberately keeps vetoing it on another route because ClawRouter's catalog declares Luna typed-only (docs/providers/clawrouter.md). With the merge change, `utility-completion.clawrouter.test.ts` fails: the refreshed catalog lets typed-only ClawRouter Luna chat on a changed configured route. - With only the veto dropped, an API-only route change (which skips `clearRouteBoundCatalogMetadata`) let Luna's Decision facts ride along to the new route. The overlay now strips base inference and sets it once. Codex agrees on the subscription route: its backend `/models` metadata (`codex-rs/protocol/src/openai_models.rs:419-421`, `ModelInfo`) and `model/list` (`codex-rs/app-server/src/models.rs:16`, `model_from_preset`) carry no chat-or-Decision capability split, and `gpt-6-luna` is listed like any other agent model (`codex-rs/models-manager/models.json:1045`, `visibility: "list"`, `shell_type: "shell_command"`). Thanks @Caitoz for the report and the precise analysis, and @MertBasar0 for the fix this builds on. ## Evidence Real built CLI and Gateway with the issue's config verbatim (`openai-chatgpt-responses`, `https://chatgpt.com/backend-api/codex`, `auth: oauth`, `agentRuntime: openclaw`), a fixture ChatGPT OAuth profile and a local ChatGPT-backend fixture; the real bundled Codex app-server uses the same fixture. No real account. - Before (main fd4807a; also v2026.11.5): `infer model run --local` fails with "This model doesn't support chat; pick another model." (2026.11.5: "Model openai/gpt-6-luna does not support chat inference"); Gateway `models.list` hides Luna and `chat.send` gets the same refusal. The fixture receives no model request. - After (this PR): `infer model run --local` returns `FIXTURE-ACK`; Gateway lists Luna and `chat.send` answers `FIXTURE-ACK`; the fixture logs `POST /backend-api/codex/responses model gpt-6-luna`. - Controls, same before and after: typed-only `clawrouter/openai/gpt-6-luna` granted chat on ClawRouter's endpoint but configured on another route is still refused with the existing message and sends nothing; Luna on its own Platform catalog route reaches the provider; Luna on the native Codex runtime answers through Codex. - Regression: one case in `model-catalog-inference.test.ts` (a `chat: true` + Decision row on a new endpoint or API keeps no inference). On main both routes fail with `expected { chat: false } to be undefined`; on the contributor commit alone the API route fails with `expected { chat: true, decision: … } to be undefined`. Observed proof lines: #201746 (comment) Merge danger: two-way door. Only in-memory catalog metadata changes; nothing is written or migrated, and a revert restores the old behavior. Blast radius: models whose bundled catalog row declares `chat: true` together with Decision facts, used on a non-catalog route; today that is only `openai/gpt-6-luna`. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 39a215a) Companion disposition: bundled dual chat/Decision row and catalog overlay/matching contracts are present-equivalent. Codex d32063f96c models-manager/models.json:700 and app-server/src/models.rs:16 confirm the subscription route exposes Luna as a normal model; no Codex fork changes needed. No later same-path or PR follow-ups. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
OpenAI Decision evaluations cannot use image evidence, and a refusal discards otherwise successful questions. Decision-only configuration can also omit its model from prepared catalog discovery.
User Impact
Adds inline PNG, JPEG, and WebP evidence to
openai/gpt-6-luna, with per-question refusals and preserved successful siblings. Decisions select a Platform API-key route before credentials, independently of the primary chat runtime. Explicit profiles stay locked.Custom endpoints must implement the native Decisions question/image contract and author their model rows. Routing metadata does not validate an endpoint's implementation. No new configuration, account fallback, or Decision pricing assumptions.
Why This Change Was Made
The prepared V2 host receives capability-specific physical-route facts from the existing provider route owner. OpenAI consumes prepared model/auth/header context instead of resolving credentials again. Generic chat routing, providers without a route hook, and lossless V1 text/JSON callers retain their paths.
Canonical configured references now record the Decision role at collection. Preparation strips only that role's credential suffix and discovers its provider without treating it as a chat-harness selection. Setup diagnostics and Doctor billing comparisons preserve that distinction. The SDK exports the existing validated catalog normalizer for static provider metadata.
Production TypeScript: +248/-139 (net +109), for the pre-auth ownership contract, V2 wire/results and configured-selector ownership. Plugin metadata: +22/-13. Tests: +1137/-197; docs: +45/-9.
Release note: OpenAI Decision models support inline images and independent question refusals with capability-aware Platform authentication and Decision-only catalog preparation.
Evidence
9aa2c401b40e96fd0e3a384d1fabfcf527b54e3a: independent and external source reviews are clean. Exact-head normal CI passed: 47 successful jobs, 25 intentionally skipped, no failures; production/test types, lint, ratchets, and required gates passed.pnpm buildcompleted runtime/plugin bundles, declarations, SDK export checks and postbuild metadata. UI build, built-CLI help/status, singleton validation and 110 session tests passed. This is package/CLI proof, not a deployed-service claim.https://api.openai.com/v1endpoint.src/decisions/openai.live.test.tsexecuted once: 1 passed, 0 skipped. All five scenarios passed: technical text, billing text, and PNG/JPEG/WebP image batches, each with Boolean/Choice/Score answers fromgpt-6-luna. Native input-token usage was retained; no cost was invented. The isolated remote lease was released with cleanup complete.v2026.10.4(383c124cc32ffee3f8e56f549b88da94d269a4af),DecisionModelSchema,decision-model-setting.ts,model-ref-profile.ts, and the auth credential schema are unchanged. That release shipped the shared V1/selector contract but no OpenAI Decision adapter. This PR changes no stored config/database/auth schema; the capability tag is transient. Existing selector and V1 bridge regressions cover the preserved contract. This is a source-backed applicability disposition, not a claim that a full installed-release upgrade was run.No deployment or executed baseline-red proof is claimed.
Current official contracts: Decisions guide, create reference. The 4 MiB single-image envelope is an OpenClaw integration limit.