Repository navigation
fix(models): preserve session selection across fallback turns - #119325
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 7, 2026, 3:39 AM ET / 07:39 UTC. ClawSweeper reviewWhat this changesAdds session-scoped model selection while changing model fallback, auth-profile, transcript, context-engine, and channel-picker behavior. Merge readiness⛔ Blocked until stronger real behavior proof is added - 6 items remain Keep open for a maintainer decision: the PR now combines a new public context-engine contract with model/fallback repairs, and its supplied runtime proof predates the current head. Priority: P1 Review scores
Verification
How this fits togetherChat commands and picker callbacks persist model and profile state for a session; that state then drives provider fallback, agent execution, transcript persistence, and context-engine turn handling. flowchart LR
A[Chat and picker input] --> B[Model selection]
B --> C[Session and profile state]
C --> D[Provider fallback]
D --> E[Agent runtime]
E --> F[Transcript and context engine]
F --> G[Channel acknowledgement]
Decision needed
Why: This is a compatibility-sensitive public plugin API and lifecycle policy; source review cannot choose its long-term contract without owner intent. Before merge
Agent review detailsSecurityNone. Review metrics
Stored data modelPersistent data-model change detected: Mantis proof suggestionA Telegram Desktop recording can directly show the changed picker acknowledgement and active-session scope. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Separate the public context-engine contract from the session-model repair, or obtain explicit owner approval plus exact-head fault, retry, legacy-plugin, and channel proof for the combined design. Do we have a high-confidence way to reproduce the issue? No: the current head could not be inspected or executed locally, and the supplied runtime proof covers an earlier head rather than the current state-lifecycle changes. Is this the best way to solve the issue? No: session-scoped selection may be useful, but the current branch entangles it with a permanent plugin API and durable-turn redesign that needs an explicit compatibility decision. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ea4466e5dce5. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (14 earlier review cycles; latest 8 shown)
|
d70cef2 to
dace4d0
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Head Focused proof: 170 tests passed; targeted Oxlint and |
|
Merged via squash.
|
What problem this solves
Session model selection had split ownership and persistence semantics:
/modelcould claim a configured-default write even when immutable config skipped it or an async write failed;The result was operator-visible scope drift: acknowledgements, docs, fallback behavior, and the actual persisted state could disagree.
Canonical fix
Maintainer decision: retain the combined ContextEngine transcript/
commitTurncontract in this PR. The additive SQLite lifecycle and legacy-engine behavior are accepted as the permanent owner boundary, with exact-head fault/recovery, projection, and channel proof below.-s/--sessionas the explicit public session-only model scope, including configured aliases and session reset.commitTurnnow receives the same constrained host-param projection as other guarded methods.ClawSweeper findings resolved
-s.commitTurnhost parameters are projected and regression-tested.User impact
Evidence
138ca82774a66cbf63b5f3c70beb588d8946ca805be96428aac7d4bbf3f69dc98644879783448c0d0accepted/actionable findings, correctness0.98.tbx_01kzdj9chs92k7qa1bw1scs6v1;pnpm check:changedpassed in 1,639s. Run: https://github.com/openclaw/openclaw/actions/runs/31158163614310c639beab7fb4e6df82f126a5b5957ce4f15001d8f061a74319418c8f21569.6125c3bf8c59045b912ef8e367c6584d57479fbfd02869a6cb2ba98727336988.openclaw/ci-gate. One untouchedsrc/skills/lifecycle/upload-store.test.tstiming/state assertion failed in the initial 4,375-test shard; the failed-job retry passed without a source change.Dependency contract check
Direct sibling Codex source was inspected for the exact CLI/app-server/config/turn-history behavior:
../codex/codex-rs/cli/src/main.rs:500-545,1090-1135../codex/codex-rs/app-server/README.md:72-88,930-940,1350-1405../codex/codex-rs/config/src/config_toml.rs:345-395../codex/codex-rs/app-server-protocol/src/protocol/v2/turn.rs:50-175../codex/codex-rs/app-server-protocol/src/protocol/common.rs:1595-1635../codex/codex-rs/app-server-protocol/src/protocol/thread_history.rs:1145-1198../codex/codex-rs/app-server/src/bespoke_event_handling.rs:130-205,1150-1195,1545-1580Repair metrics
+4,839/-1,535(net+3,304)+6,650/-788(net+5,862)+112/-36(net+76)The positive production delta is justified by the permanent public session-scope contract, canonical fallback/session/context-engine ownership, durable SQLite completion recovery, and channel/runtime sibling behavior. The test delta covers the original failure, owner boundary, lifecycle order, recovery, and sibling paths.
The branch merged current
mainat1574723997c; latermainis a descendant and GitHub's exact-head merge candidate remains conflict-free.