Skip to content

fix: Luna utility completions fail through Codex - #196640

Closed
roboclaw-bot wants to merge 1 commit into
mainfrom
openclaw/sharp-crayfish-4
Closed

roboclaw-bot wants to merge 1 commit into
mainfrom
openclaw/sharp-crayfish-4

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #196617

Regression introduced by #177227. Related: #196344.

What Problem This Solves

Fixes: Luna utility tasks fail through Codex because internal sampling defaults are forwarded to routes that do not support them, affecting Activity recaps, session assessments, and progress narration.

User Impact

Utility completions can retain their selected ChatGPT subscription or API-key route instead of failing or relying on another model. No configuration changes, credential substitutions, or billing-route changes are introduced.

Internal utility sampling and output-budget defaults are advisory on subscription routes. Explicit caller token caps retain required-limit behavior unless the caller explicitly opts into advisory mode. API-key output limits remain intact.

Draft proof gaps: live Gateway/Luna verification and the complete SDK-wide API comparison remain unverified; details below. No running Gateway was changed or restarted.

Why This Change Was Made

Codex now reuses the normal OpenAI transport's temperature-capability policy, honoring catalog overrides rather than maintaining another model-name rule. The shared utility-completion owner marks internal defaults as preferred, and the existing Codex completion owner omits them for native ChatGPT subscription and token-sharing routes. Explicit isolated requests remain strict by default.

This covers the shared utility path rather than removing temperature separately from each caller. It overlaps the narrower token-sharing advisory-mode proposal in #196344 and adds API-key model-capability filtering plus legacy subscription coverage.

Simplification: one existing temperature policy, one utility-intent owner, no new configuration or state. Production delta is +25 lines; +57 test lines extend existing wire, native-process, account-ownership, and budget-propagation suites, with a matching test-line allocation.

Evidence

  • Published head: 0a6c6d7c1bb111b76fe87925265899df21ac2273. Its Git tree (5d75b68281a9fc9b300fe2ce1187152398e3fc72) exactly matches tested local candidate 9b92b12d9d16941e27a20119aa75439d6ab49046, based on c6fc5bd.
  • Red/green regressions: original code sends unsupported temperature in the actual native request, rejects advisory token-sharing defaults, and unnecessarily requires an inference relay for subscription defaults. The repair passes these regressions while retaining explicit-cap and account/endpoint checks.
  • Real pinned Codex 0.164.0 process: the native integration test captures one serialized Luna request with its 240-token cap and without temperature, then receives the synthetic provider answer. Provider responses and credentials are synthetic; this is not live Luna entitlement or inference proof.
  • 129 tests passed across 12 files / 7 Vitest shards, including affected utility consumers and prompt-prefix stability. Final local wrapper wall time: 174.80 seconds. CI duration is not yet available.
  • Core and extension production typechecks, affected core-test and extension-test typechecks, targeted lint, formatting, SDK export synchronization check, documentation MDX checks, whitespace, line-cap, and assertion-safety checks passed.
  • Fresh independent Auto Review through the OpenClaw engine (P0–P2), with relevant unchanged owner/transport context, found no actionable defects in the final source delta. The reviewer did not independently execute tests.
  • Personally inspected the pinned native Responses request contract; native requests do not own these sampling fields.
  • Incomplete: no task-scoped API key or ChatGPT subscription credential is available for a real Gateway/Luna run. The SDK-wide API-diff check first failed to allocate its install thread pool; a CPU-bounded retry completed dependency setup but timed out during baseline declaration rendering. Its processes and temporary worktrees were reconciled and cleaned up. Neither check is claimed passing.

Reported by @Marvinthebored. Related advisory-sampling work: #196344 by @jason-allen-oneal.

Work sessions

Linked for team reference; these sessions aren’t public.

Worked on by

Worked on by:
- @Marvinthebored

Co-authored-by: Marvinthebored <[email protected]>
OpenClaw-Publication: c7c47b74-c377-4f12-b43f-03a37a124f3b
@clawsweeper

clawsweeper Bot commented Nov 10, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling extensions: codex size: S labels Nov 10, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 10, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 10, 2026
@clawsweeper

clawsweeper Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR filters unsupported Codex temperature parameters and makes internal utility sampling defaults advisory on subscription routes.

Example: An Activity recap uses openai/gpt-6-luna with a 240-token budget and temperature 0.2.

  • Before: The API-key request includes temperature and receives HTTP 400.
  • After: The request omits unsupported temperature while retaining max_output_tokens: 240.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The source repair is coherent and has no actionable findings, but supplied tests do not satisfy the required product-level proof.
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: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Activity recaps, session assessments, and progress narration can fail or use a fallback because Codex receives unsupported internal sampling defaults.
Reason: The report establishes a concrete failure, and maintainer authorship supplies direction for the narrow advisory contract without changing credentials or adding configuration.

Regression provenance

Regression provenance — verified: source commit 8d922199c076 by Vincent Koc; canonical PR #177227 (blame-to-merge-commit).

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR addresses a source-confirmed regression with a focused patch and no actionable code findings.

Priority: P2
Reviewed head: 0a6c6d7c1bb111b76fe87925265899df21ac2273

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence lacks a Gateway run showing successful Luna utility results on the repaired routes and an upgrade check preserving existing model and account selections.
Agent review details

How this fits together

Gateway utility tasks enter the shared completion owner, which prepares the selected model and credential before Codex performs isolated inference and returns text.

flowchart LR
  A[Utility task] --> B[Utility completion owner]
  B --> C[Isolated completion owner]
  C --> D[Codex sampling policy]
  D --> E[Native Codex runtime]
  E --> F[Selected provider route]
  F --> G[Utility result]
Loading

Technical review

Best possible solution:

Retain the existing completion owners, capability-aware temperature filtering, advisory internal defaults, and strict explicit limits while coordinating one landing path with the overlapping PRs.

Do we have a high-confidence way to reproduce the issue?

Current-main source carries recap temperature into the Codex relay without capability filtering, matching the reporter's side-by-side API responses and fallback trace; no target code was executed during this review.

Is this the best way to solve the issue?

The patch is a small complete repair using existing owners and the shared temperature policy, with distinct coverage for wire parameters, native dispatch, account selection, and explicit limits.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5ac21026addd.

Provenance checked

  • Codex strict sampling and native dispatch changes intended behavior with a stated reason (8d92219: Preserve explicit caller limits through native inference and reject unsupported token-sharing limits before launch.)
  • Shared utility completion dispatch keeps the original intent (6861671: Centralize independent utility fallback handling while leaving runtime admission and credentials with isolated completion.)
  • Utility answer budgets changes intended behavior with a stated reason (2a64309: Reserve reasoning capacity for internal utility answers while keeping explicit caller token limits absolute.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit 8d92219 adds extensions/codex/src/app-server/isolated-completion.ts:75 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8d922199c076; files: extensions/codex/src/app-server/isolated-completion.ts)
  • Peter Steinberger: Raw commit 6861671 adds src/agents/utility-completion.ts:71 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6861671cda97; files: src/agents/utility-completion.ts)

PR surface

Source +25, Tests +57, Docs +9, Other +2. Total +93 across 13 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 6 28 3 +25
Tests 4 75 18 +57
Docs 2 9 0 +9
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 13 114 21 +93

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: The regression affects background utility results on particular Codex model and authentication routes, with fallback available in the reported setup.
  • add merge-risk: 🚨 compatibility: The optional public harness parameter changes sampling semantics for opted-in calls; the maintainer-authored direction explicitly retains strict omitted-mode callers.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The regression affects background utility results on particular Codex model and authentication routes, with fallback available in the reported setup.
  • merge-risk: 🚨 compatibility: The optional public harness parameter changes sampling semantics for opted-in calls; the maintainer-authored direction explicitly retains strict omitted-mode callers.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Provide Gateway evidence for the repaired utility behavior, redacting credentials and non-public endpoints.

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.

Reviewed November 10, 2026, 6:43 AM ET / 11:43 UTC.

@roboclaw-bot roboclaw-bot added the clawtributors PR from a clawtributor label Nov 10, 2026
@Marvinthebored

Copy link
Copy Markdown
Contributor

Superseded by 196641, thanks @obviyus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling clawtributors PR from a clawtributor docs Improvements or additions to documentation extensions: codex 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: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Codex isolated completions send temperature to models that reject it, so Activity recaps 400 on gpt-6-luna

2 participants