Repository navigation
fix(codex): carry selected models into prompt hooks - #140488
Conversation
Include the logical provider and model for host-selected turns. Keep both supervised and independently native-owned models absent before startup confirms them, without exposing private transport overrides. Related: #130706. Nine affected cases and 21 shared-hook tests passed, with failing-before controls and actual callback-to-recall-selector proof using synthetic native clients. Independent P2 review and the full changed gate passed.
|
🦞👀 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 September 6, 2026, 6:31 PM ET / 22:31 UTC. ClawSweeper reviewWhat this changesPass the selected provider and logical model to Codex plugin hooks for OpenClaw-controlled turns, preserving unknown-model behavior for native-owned sessions and extending regression coverage. Merge readiness✅ Ready for maintainer review This remains a useful, focused repair: current main and the latest release omit the selected model from Codex prompt-hook context. No introduced correctness or security defect was found, and the protected maintainer-authored PR should remain open. Priority: P2 Review scores
Verification
How this fits togetherThe Codex plugin prepares hook context before starting native inference. Plugins such as Active Memory use that context to choose a model for supporting work instead of falling back to the agent’s configured default. flowchart TD
A[Selected turn model] --> C[Codex hook context]
B[Native session ownership] --> C
C --> D{OpenClaw owns selection?}
D -->|Yes| E[Include logical model]
D -->|No| F[Leave model unknown]
E --> G[Plugin model selection]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +6, Tests +39. Total +45 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep model facts at the Codex hook-context producer, preserving explicit plugin overrides, logical model identity, and native selection ownership. Do we have a high-confidence way to reproduce the issue? Yes, from source: select a host-controlled Codex model different from the agent default with no explicit Active Memory model override; current main omits the hook fields and the selector falls back to the default. This review did not execute that path. Is this the best way to solve the issue? Yes. Populating existing context fields at their producer is a narrow repair, and the exclusions preserve native ownership without exposing private transport model names. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e2a9f6eadb0c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Include the logical provider and model for host-selected turns. Keep both supervised and independently native-owned models absent before startup confirms them, without exposing private transport overrides. Related: openclaw#130706. Nine affected cases and 21 shared-hook tests passed, with failing-before controls and actual callback-to-recall-selector proof using synthetic native clients. Independent P2 review and the full changed gate passed.
Related: #130706
What Problem This Solves
Codex prompt hooks on turns controlled by OpenClaw did not receive the selected provider/model. Plugins such as active-memory could therefore use the agent default instead of the model selected for the current turn.
Why This Change Was Made
Supply the logical selected model through the existing hook context. Keep model fields absent when supervision or a preserved native binding owns selection: the hook runs before native startup confirms those facts. Private transport overrides remain separate.
User Impact
Supporting plugins can inherit the selected model on host-controlled Codex turns. Native-owned sessions retain their existing unknown-model behavior before startup. No configuration, protocol or persistence surface changes.
Evidence
openai/gpt-5.5over configuredopenai/gpt-5.4, and both native turns returned the injected marker. Requested/effective/response model facts agreed; no successful tool calls or reroute occurred.The full live driver remains failed on two
one-shot client cleanup could not be confirmedwarnings. The ten cleanup/transport/launcher files are unchanged across base, PR and main. An independent auth-free initialize/close probe, with no model turn or hook, reproduced{ exited: true, cleanup: "uncertain" }; all five recorded process identities were gone afterward. The live-test inventory found no matching survivors; three unreadable environment records were separately identified as host control-plane processes. All fixture roots were removed and the isolated Testbox was stopped and independently verified completed. Raw failed receipts remain unchanged.Follow-up: native Codex one-shot cleanup confidence after official launcher shutdown. Exact signal attribution remains unproven. This PR's changed hook behavior is live-verified; warning-free shutdown, a packaged Gateway build, full active-memory recall-subagent inference, and native-owned supervision live flows are not claimed.