Skip to content

feat(openai): support prepared image Decisions - #176133

Merged
vincentkoc merged 3 commits into
mainfrom
feat/openai-decisions-v2-20261018
Oct 18, 2026
Merged

vincentkoc merged 3 commits into
mainfrom
feat/openai-decisions-v2-20261018

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

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

  • Signed head 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.
  • Registered OpenAI host proof: all 8 cases passed, including native registered-provider preparation, mixed and locked profiles, unresolved header SecretRefs, custom-auth precedence, permitted/denied private networking, and actual secret-generation invalidation during DNS preparation. The invalidated call reaches neither final admission nor HTTP; successful controls do. This is synthetic local HTTP proof, not authenticated vendor proof.
  • OpenAI adapter/provider proof: 38 adapter, 8 Decision-route, and 75 generic provider-policy cases passed. Exact-head shared inference (14), route (28), configured-reference (8), and Doctor billing (7) cases also passed. SDK/package boundary compilation and its negative canary passed. Prior-head unchanged-source proof also covered registered OpenRouter and configured catalog siblings.
  • Exact-head packaged build and Node compatibility passed on Node 26.1.0. Checkout matched the signed head; pnpm build completed 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.
  • Exact-head ClawSweeper review reports no source findings. Prepared catalog discovery and header-boundary findings are resolved; the remaining proof requests are addressed below.
  • Authenticated native qualification passed on the signed head and verified source capsule, using a Foundation-owned OpenAI Platform credential and the canonical https://api.openai.com/v1 endpoint. src/decisions/openai.live.test.ts executed 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 from gpt-6-luna. Native input-token usage was retained; no cost was invented. The isolated remote lease was released with cleanup complete.
  • The generic stored-data upgrade request has no affected persisted contract: compared with 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.

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.
@vincentkoc vincentkoc self-assigned this Oct 18, 2026
@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@vincentkoc
vincentkoc marked this pull request as ready for review October 18, 2026 07:33
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling extensions: openai size: XL labels Oct 18, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 18, 2026
@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This 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.

  • Before: The OpenAI Decision adapter accepts text and JSON evidence only.
  • After: The V2 adapter sends the inline PNG and preserves successful answers when another question is refused.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The source review and exact-head validation support the patch, but the explicitly required qualification gate remains incomplete.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: OpenAI Decision callers cannot evaluate image evidence or retain successful siblings when one question is refused.
Reason: The maintainer-authored direction adds a documented vendor capability through existing Decision V2 and provider-routing owners without adding user settings.

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
Reviewed head: 9aa2c401b40e96fd0e3a384d1fabfcf527b54e3a

Before merge

  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

None.

Tests

  • Missing end-to-end proof: Authenticated native text/image execution and a latest-stable upgrade preserving existing settings remain unshown; no baseline-red execution is claimed.
Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • OpenAI Decision wire format and refusals changes intended behavior with a stated reason (dd1776f: The original V1 contract carried text/JSON and could not represent per-question refusals.)
  • Prepared Decision credential ownership keeps the original intent (3dd7f57: Shared preparation owns agent/profile credentials, transport facts, and revocable authority rather than each adapter resolving credentials independently.)
  • Provider-owned physical routes keeps the original intent (1b1cebf: Effective endpoint and authentication requirements must agree across selection and execution.)
  • Configured model references and credential suffixes keeps the original intent (531e597: Configured discovery preserves credential pins while resolving model identity and conversational runtime preferences separately.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 1b1cebf adds src/plugins/provider-model-routes.ts:68 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 1b1cebfe4218; files: src/plugins/provider-model-routes.ts)

PR surface

Source +118, Tests +940, Docs +36. Total +1094 across 25 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 13 270 152 +118
Tests 10 1137 197 +940
Docs 2 45 9 +36
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 25 1452 358 +1094

Review metrics

Metric Value Why it matters
Production versus test changes Production TypeScript +248/-139; tests +1137/-197 Production growth extends existing routing and discovery owners; test growth covers distinct wire, credential, configuration, and final-effect boundaries.

Labels

Label changes:

  • add merge-risk: 🚨 compatibility: The PR expands public provider-route types and an SDK export, and moves OpenAI Decision execution from V1 to prepared V2; the maintainer-authored direction, documentation, and retained V1 bridge support that change.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.

Label justifications:

  • P2: This is a useful optional Decision-provider improvement with limited blast radius and no established urgent user regression.
  • merge-risk: 🚨 compatibility: The PR expands public provider-route types and an SDK export, and moves OpenAI Decision execution from V1 to prepared V2; the maintainer-authored direction, documentation, and retained V1 bridge support that change.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-18T07:50:19.581Z sha 40486e1 :: needs real behavior proof before merge. :: [P1] Include the selected Decision model in static preparation | [P2] Assert unresolved headers at the preparation boundary

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.
@openclaw-barnacle openclaw-barnacle Bot added the commands Command implementations label Oct 18, 2026
@clawsweeper clawsweeper Bot removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 18, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head 9aa2c401b40e96fd0e3a384d1fabfcf527b54e3a. The prepared catalog and SecretRef boundary findings are corrected. Normal CI and packaged build/compatibility passed. All 8 registered OpenAI host cases passed, including credential-generation invalidation during DNS preparation with zero final admission/HTTP; successful controls still dispatch.

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.

@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 18, 2026
@vincentkoc
vincentkoc merged commit 621f574 into main Oct 18, 2026
166 checks passed
@vincentkoc
vincentkoc deleted the feat/openai-decisions-v2-20261018 branch October 18, 2026 16:34
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 18, 2026
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 19, 2026
* 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
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 19, 2026
…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.
obviyus added a commit that referenced this pull request Nov 21, 2026
#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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 22, 2026
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]>
tideclaw-bot pushed a commit that referenced this pull request Nov 24, 2026
#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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations docs Improvements or additions to documentation extensions: openai merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant