Skip to content

fix(cron): Codex max thinking drops to default effort on cron and hook turns - #165444

Merged
obviyus merged 1 commit into
openclaw:mainfrom
Oldrich333:fix/cron-thinking-capability
Oct 5, 2026
Merged

obviyus merged 1 commit into
openclaw:mainfrom
Oldrich333:fix/cron-thinking-capability

Conversation

@Oldrich333

@Oldrich333 Oldrich333 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Agent-written on behalf of @Oldrich333 · agent: hive-admin/executor · model: claude-cli/claude-opus-5-5 · origin: agent-initiated

Closes #164812
Related: #161100, #161103

What Problem This Solves

Fixes: Codex-harness turns configured with thinking max run at the model's default effort when they are started by a cron job or a /hooks agent mapping.

User Impact

User impact: scheduled and webhook-driven Codex agents set to max now get max reasoning effort, as chat, channel and agent-command turns already do. Other levels are unchanged.

Why This Change Was Made

The isolated cron runner already hydrates the candidate's thinking catalog (Codex model/list efforts) and resolves the level from it, but it never passed the prepared model thinking capability to the embedded run. Without it the runtime model carries no effort list and the Codex harness sends max as null. This passes the same capability the reply path (#161103) and the agent command prepare: prepareModelRunCapabilities([thinkingCatalog, []], [provider, model, runtime]). No new catalog load; no catalog row → undefined → unchanged behaviour; the existing resolvePreparedModelThinkingCompat guard keeps it inert when provider/model/harness differ from the final route. CLI candidates are untouched.

Evidence

Tests (new file src/cron/isolated-agent/run.thinking-capability.test.ts):

  • pnpm test src/cron/isolated-agent/run.thinking-capability.test.ts --maxWorkers=1: 2/2 pass; wall time cold 44.6 s, warm 20.4 s (vitest duration 37.9 s / 14.5 s). CI duration: unavailable (not yet run).
  • base (merge base, source change reverted): passes the hydrated Codex effort list so max is not dropped FAILS (modelThinkingCapability undefined); head: passes. The no-catalog-row case passes on both.
  • whole family src/cron/isolated-agent: 50 files, 572 tests pass on head.
  • node scripts/run-tsgo.mjs -p tsconfig.core.json and -p test/tsconfig/tsconfig.core.test.services-cron.json: exit 0; oxfmt --check + oxlint on changed files: clean.

Real behaviour (production gateways, the identical expression applied as a local patch to the installed 2026.9.8 dist; Codex app-server harness, openai/gpt-6-luna, thinkingDefault: max), first turn_context of each Codex rollout:

/hooks agent mapping turns, before the patch (2026-09-29 .. 2026-10-05): effort null  ×61 (of 61)
/hooks agent mapping turn,  after the patch:                              {"effort":"max", collaboration reasoning_effort "max"}
one-shot isolated cron job (agentTurn, model gpt-6-luna, thinking max), after: {"effort":"max", collaboration reasoning_effort "max"}

Agent-command turns into the same agent were already max before and after.

Maintainer verification

Independently exercised built Gateways in isolated Docker containers at current main e8915f68f3cb87cffb90fc7e7799a2d70edeb45e and candidate f82e6d4cb81c3924f96334e0f8ed11b391b13be4. A configured fake Codex app-server advertised the effort catalog and recorded actual turn/start requests; no product code or authentication behavior was altered for the fixture. The agent default was max.

Entry point Main Candidate
openclaw cron run, thinking max effort: null (default), collaboration effort null Both max
openclaw cron run, thinking high Both high Both high
Gateway chat.send, thinking max Both max Both max

The regression file passes both tests on the candidate (37.43 s wall time); against current main, its max case fails at the missing capability assertion and its no-catalog control passes (35.99 s). The isolated Gateways were built with pnpm build:docker.

A separate candidate Gateway completed one real gpt-5-mini request with thinking low, configured output budget 4096, and response LIVE_GATE_OK (one assistant turn, no tools or fallback). The first live setup attempt made no model request because the fixture omitted the explicit model catalog row; correcting that fixture produced the successful call.

Personally inspected the sibling Codex protocol at c248f6d48b97eb4a2aa56147a0b11b7d763278b9, codex-rs/protocol/src/openai_models.rs:59-84: ReasoningEffort::Max serializes as max.

No overlap with Pash/Sarah changes. Contributor implementation and credit are unchanged. No CHANGELOG changes.

The isolated cron runner hydrates the candidate's thinking catalog but never passed the prepared
model thinking capability to the embedded run, so harness-native effort lists (Codex max) were
lost and max reached the app-server as null. Pass the same capability the reply path (openclaw#161103)
and the agent command prepare.

Fixes openclaw#164812.
@clawsweeper

clawsweeper Bot commented Oct 5, 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.

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 5, 2026
@clawsweeper

clawsweeper Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 5, 2026, 4:29 AM ET / 08:29 UTC.

ClawSweeper review

What this changes

Passes the selected model’s prepared reasoning capabilities into scheduled and webhook-driven agent runs so Codex honors maximum thinking effort, with regression coverage.

Merge readiness

✅ Ready for maintainer review

This remains necessary: current main and v2026.9.8 retain the cron-path omission, while the merged reply-path fix covers a different entry point. The supplied production evidence supports the repair, and no blocking patch defect was found.

Priority: P1
Reviewed head: f82e6d4cb81c3924f96334e0f8ed11b391b13be4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-reusing repair with relevant production before/after evidence and regression coverage.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (logs): The supplied production Gateway rollout logs exercise the cron executor’s capability handoff through real Codex hook and isolated-cron turns after the identical installed-code patch, recording max effort where hooks previously recorded null. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (logs): The supplied production Gateway rollout logs exercise the cron executor’s capability handoff through real Codex hook and isolated-cron turns after the identical installed-code patch, recording max effort where hooks previously recorded null. No stored-data contract changes.
Evidence reviewed 9 items Pinned introduced change: The merge-base-to-head delta adds the existing capability preparation owner to the embedded cron invocation and adds two regression cases. The unrelated endpoint drift is base-branch work.
Current-main necessity: Current main hydrates the candidate thinking catalog but its embedded invocation supplies no modelThinkingCapability. The verified test merge has the pinned main and head parents and preserves the same focused repair.
Latest release still affected: The v2026.9.8 executor likewise passes the thinking level without the prepared capability. Local release-blob inspection failed; the read-only GitHub contents endpoint supplied the release source.
Findings None None.
Security None None.

How this fits together

Scheduled jobs and agent webhooks share OpenClaw’s isolated cron runner. It selects the model and thinking level, then hands the turn to the embedded runtime and Codex app-server.

flowchart TD
  A[Scheduled job] --> C[Isolated cron runner]
  B[Agent webhook] --> C
  D[Model reasoning catalog] --> C
  C --> E[Prepared capability handoff]
  E --> F[Final model and runtime checks]
  F --> G[Codex reasoning effort]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +10, Tests +89. Total +99 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 11 1 +10
Tests 1 89 0 +89
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 100 1 +99

Review metrics

Metric Value Why it matters
Production versus regression growth Production +10 lines; tests +89 lines Production growth is explained by reusing the existing capability projection at the missing handoff.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #164812
Summary: This PR addresses the remaining isolated-cron handoff defect; the earlier merged repair covers the separate reply entry point.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Use the existing capability owner consistently across cron, command, and reply turns while preserving final-route validation.

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

Yes, from source: configure max for a Codex model advertising that effort and invoke an isolated cron or agent hook turn; current main omits the metadata needed to avoid null effort. No runtime reproduction was executed during this review.

Is this the best way to solve the issue?

Yes. Reusing the existing capability preparation and final-route checks is the narrow repair, and the supplied production rollout evidence covers both affected entry points.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P1: Reported production cron and webhook workflows silently lose the configured maximum reasoning effort.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The supplied production Gateway rollout logs exercise the cron executor’s capability handoff through real Codex hook and isolated-cron turns after the identical installed-code patch, recording max effort where hooks previously recorded null. No stored-data contract changes.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The supplied production Gateway rollout logs exercise the cron executor’s capability handoff through real Codex hook and isolated-cron turns after the identical installed-code patch, recording max effort where hooks previously recorded null. No stored-data contract changes.

Label justifications:

  • P1: Reported production cron and webhook workflows silently lose the configured maximum reasoning effort.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The supplied production Gateway rollout logs exercise the cron executor’s capability handoff through real Codex hook and isolated-cron turns after the identical installed-code patch, recording max effort where hooks previously recorded null. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied production Gateway rollout logs exercise the cron executor’s capability handoff through real Codex hook and isolated-cron turns after the identical installed-code patch, recording max effort where hooks previously recorded null. No stored-data contract changes.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head delta adds the existing capability preparation owner to the embedded cron invocation and adds two regression cases. The unrelated endpoint drift is base-branch work. (src/cron/isolated-agent/run-executor.ts:611, f82e6d4cb81c)
  • Current-main necessity: Current main hydrates the candidate thinking catalog but its embedded invocation supplies no modelThinkingCapability. The verified test merge has the pinned main and head parents and preserves the same focused repair. (src/cron/isolated-agent/run-executor.ts:604, a9f4080f9749)
  • Latest release still affected: The v2026.9.8 executor likewise passes the thinking level without the prepared capability. Local release-blob inspection failed; the read-only GitHub contents endpoint supplied the release source. (src/cron/isolated-agent/run-executor.ts:636, fc23bc864e45)
  • Existing capability owner and safeguards: The preparation helper projects thinking metadata, and its consumer checks the final provider, model, runtime, and applicable transport route before merging it. Missing metadata remains inert; the patch introduces no competing policy or additional catalog request. (src/agents/model-catalog-lookup.ts:102, f82e6d4cb81c)
  • Observable failure and dependency signal: The Codex adapter returns null for max when supportedReasoningEfforts is absent. Its collaboration settings consume the same metadata. This directly establishes that the repair and its proof depend on the Codex app-server protocol. (extensions/codex/src/app-server/reasoning-effort.ts:61, f82e6d4cb81c)
  • Personally inspected Codex protocol: GitHub verified the sibling revision belongs to openai/codex. Personally inspected model.rs:130, which exposes supported reasoning efforts, and openai_models.rs:59–84, where Max serializes as max. The inspected thread protocol also accepts reasoning effort settings. (codex-rs/app-server-protocol/src/protocol/v2/model.rs:130, a956835d0207)

Likely related people:

  • yashas-13: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@obviyus
obviyus merged commit 4995bef into openclaw:main Oct 5, 2026
128 checks passed
@obviyus

obviyus commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Landed as 4995bef. Thanks @Oldrich333!

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 6, 2026
…k turns (openclaw#165444)

Codex-harness agents configured with thinking `max` ran at the model's default effort when a cron job or `/hooks` mapping started the turn, while chat and channel turns already used `max`. The isolated cron runner now resolves `max` against the hydrated Codex effort catalog, the same way the interactive paths do. Codex lists `max` as a first-class `ReasoningEffort` (codex-rs/protocol/src/openai_models.rs).

Proof: built Gateways with a configured fake Codex app-server that records `turn/start` requests. On a cron run, main sends a null (default) effort and this change sends `max`. Cron `high` stays `high`, and chat-initiated `max` stays `max`, on both. The regression test fails on main and passes here.

Fixes openclaw#164812.

Co-authored-by: Ayaan Zaidi <[email protected]>
RomneyDa pushed a commit that referenced this pull request Oct 11, 2026
…k turns (#165444)

Codex-harness agents configured with thinking `max` ran at the model's default effort when a cron job or `/hooks` mapping started the turn, while chat and channel turns already used `max`. The isolated cron runner now resolves `max` against the hydrated Codex effort catalog, the same way the interactive paths do. Codex lists `max` as a first-class `ReasoningEffort` (codex-rs/protocol/src/openai_models.rs).

Proof: built Gateways with a configured fake Codex app-server that records `turn/start` requests. On a cron run, main sends a null (default) effort and this change sends `max`. Cron `high` stays `high`, and chat-initiated `max` stays `max`, on both. The regression test fails on main and passes here.

Fixes #164812.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 4995bef)
LibraHo added a commit to LibraHo/openclaw that referenced this pull request Oct 21, 2026
…irs for 8.35-D

Adapt official PRs openclaw#140388, openclaw#156842, openclaw#168738, openclaw#169010, openclaw#165444, openclaw#164633 and openclaw#169029 to the existing synchronous 2026.8.35 custom queue and plugin baseline. Preserve prior A/B/C repairs, UI, locked dependencies, database schemas, configuration and build customizations.

Canonical build source: 7fdcb8a1f5b9cec7c1e9d66bc8ae551a38f0ed70
Verified complete source tree: 6511c79
Upstream base: 713ba57

Selected regression boundaries: 247 tests passed; core and plugin production typechecks passed; bounded P0 autoreview scoped-clean. Broader Windows cleanup/symlink EPERM limits are recorded in local verification. No live Telegram-group test or full repository-green claim.

Saved ordinary inbound final text permits one retry after typed ambiguous transport failure, at most two total sends, with possible duplicate after a lost acknowledgement. Media, controls and accepted partial/identityless evidence remain excluded. This does not grant all cron/invest completion paths replay permission.

Candidate build only; no production deployment or memory reset.
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Oct 22, 2026
…k turns (openclaw#165444)

Codex-harness agents configured with thinking `max` ran at the model's default effort when a cron job or `/hooks` mapping started the turn, while chat and channel turns already used `max`. The isolated cron runner now resolves `max` against the hydrated Codex effort catalog, the same way the interactive paths do. Codex lists `max` as a first-class `ReasoningEffort` (codex-rs/protocol/src/openai_models.rs).

Proof: built Gateways with a configured fake Codex app-server that records `turn/start` requests. On a cron run, main sends a null (default) effort and this change sends `max`. Cron `high` stays `high`, and chat-initiated `max` stays `max`, on both. The regression test fails on main and passes here.

Fixes openclaw#164812.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 4995bef)
(cherry picked from commit 9e8edb8)
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

P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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 harness drops thinking level max (effort null) on cron jobs and /hooks agent turns (isolated cron runner)

2 participants