Repository navigation
fix(cron): Codex max thinking drops to default effort on cron and hook turns - #165444
Conversation
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.
|
🦞👀 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: needs maintainer review before merge. Reviewed October 5, 2026, 4:29 AM ET / 08:29 UTC. ClawSweeper reviewWhat this changesPasses 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 Review scores
Verification
How this fits togetherScheduled 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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +10, Tests +89. Total +99 across 2 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Landed as 4995bef. Thanks @Oldrich333! |
…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]>
…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)
…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.
…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]>
Closes #164812
Related: #161100, #161103
What Problem This Solves
Fixes: Codex-harness turns configured with thinking
maxrun at the model's default effort when they are started by a cron job or a/hooksagent mapping.User Impact
User impact: scheduled and webhook-driven Codex agents set to
maxnow getmaxreasoning 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/listefforts) 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 sendsmaxasnull. 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 existingresolvePreparedModelThinkingCompatguard 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).passes the hydrated Codex effort list so max is not droppedFAILS (modelThinkingCapabilityundefined); head: passes. The no-catalog-row case passes on both.src/cron/isolated-agent: 50 files, 572 tests pass on head.node scripts/run-tsgo.mjs -p tsconfig.core.jsonand-p test/tsconfig/tsconfig.core.test.services-cron.json: exit 0;oxfmt --check+oxlinton 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), firstturn_contextof each Codex rollout:Agent-command turns into the same agent were already
maxbefore and after.Maintainer verification
Independently exercised built Gateways in isolated Docker containers at current main
e8915f68f3cb87cffb90fc7e7799a2d70edeb45eand candidatef82e6d4cb81c3924f96334e0f8ed11b391b13be4. A configured fake Codex app-server advertised the effort catalog and recorded actualturn/startrequests; no product code or authentication behavior was altered for the fixture. The agent default wasmax.openclaw cron run, thinkingmaxeffort: null(default), collaboration effortnullmaxopenclaw cron run, thinkinghighhighhighchat.send, thinkingmaxmaxmaxThe regression file passes both tests on the candidate (37.43 s wall time); against current main, its
maxcase fails at the missing capability assertion and its no-catalog control passes (35.99 s). The isolated Gateways were built withpnpm build:docker.A separate candidate Gateway completed one real
gpt-5-minirequest with thinkinglow, configured output budget 4096, and responseLIVE_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::Maxserializes asmax.No overlap with Pash/Sarah changes. Contributor implementation and credit are unchanged. No CHANGELOG changes.