Repository navigation
fix: sessions model default does not clear the override - #159587
Conversation
|
🦞👀 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 27, 2026, 6:50 AM ET / 10:50 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch makes the agent’s sessions tool clear a model override when asked for “default” and refreshes queued follow-ups to use the configured model after the Gateway commits the reset. Merge readiness✅ Ready for maintainer review Keep this PR open for the normal merge path. Current main still has the reported defect, while the current head addresses the earlier queued-follow-up finding and the PR body records real Gateway before-and-after observations. No blocking patch finding remains. Priority: P1 Review scores
Verification
How this fits togetherThe agent’s sessions tool sends model changes to the Gateway, which stores the session selection. Queued follow-ups carry a model selection into the next provider request, so they must reflect a committed reset. flowchart LR
A[Agent model request] --> B[Sessions tool]
B --> C[Interpret default]
C --> D[Gateway session patch]
D --> E[Stored session selection]
D --> F[Refresh queued follow-ups]
E --> G[Next provider request]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +2, Tests +64. Total +66 across 4 files. View PR surface stats
Review metricsNone. 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: Keep the tool’s reset sentinel aligned with the Gateway’s null-reset contract, and ensure queued follow-ups inherit the committed configured model. Do we have a high-confidence way to reproduce the issue? Yes. The PR records a before-and-after run through the actual sessions tool and Gateway, including the next provider request; current main still contains the behavior exercised in the baseline. Is this the best way to solve the issue? Yes. Reusing the tool’s existing model normalizer and the Gateway’s null reset is a narrow fix, and the added post-commit refresh covers the queued-turn failure identified in the prior review. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b505b36c45b3. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged as 4f227c5. Thanks @dh-js for the clear report. The agent |
* commit '69809d7a94277d01be964bd1cbbb7aa0ebc58c9b': (219 commits) perf(agents): serialize large model requests once (#159574) refactor(cli): share capability agent-selection test cases (#159616) fix(workers): restore installation type checks (#159629) test(channels,qa,providers): remove low-value tests (batch d065) (#159627) test(doctor): run isolated migration cases concurrently (#159609) feat(apple): show agent identities in native chat (#159528) chore(i18n): refresh native locales (#159635) fix(gateway): keep node provisioning's installation contract after overlapped preparation fix(models): keep shared catalog requests alive for remaining callers (#157191) feat: let agents query online people and device activity (#159117) perf(gateway): first cloud dispatch prepares worker artifacts one after another (#159520) refactor(android): deslop Android app third pass (#159589) test(qa-lab,openshell,slack,reef,team-reports): remove low-value tests (batch d064) (#159607) fix: align process liveness checks (#151107) thanks @ekinnee fix: sessions model default does not clear the override (#159587) fix(ios): preserve typing during reentrant SwiftUI updates fix(ci): frozen 2026.8.33 validation fails on inherited test clock (#159594) perf(gateway): avoid duplicate recipient row lookup (#159595) refactor(gateway): deslop gateway fourth pass (#158786) test(agents): split subagent task-settlement test support under the line cap (#159584) ...
* commit '69809d7a94277d01be964bd1cbbb7aa0ebc58c9b': (219 commits) perf(agents): serialize large model requests once (#159574) refactor(cli): share capability agent-selection test cases (#159616) fix(workers): restore installation type checks (#159629) test(channels,qa,providers): remove low-value tests (batch d065) (#159627) test(doctor): run isolated migration cases concurrently (#159609) feat(apple): show agent identities in native chat (#159528) chore(i18n): refresh native locales (#159635) fix(gateway): keep node provisioning's installation contract after overlapped preparation fix(models): keep shared catalog requests alive for remaining callers (#157191) feat: let agents query online people and device activity (#159117) perf(gateway): first cloud dispatch prepares worker artifacts one after another (#159520) refactor(android): deslop Android app third pass (#159589) test(qa-lab,openshell,slack,reef,team-reports): remove low-value tests (batch d064) (#159607) fix: align process liveness checks (#151107) thanks @ekinnee fix: sessions model default does not clear the override (#159587) fix(ios): preserve typing during reentrant SwiftUI updates fix(ci): frozen 2026.8.33 validation fails on inherited test clock (#159594) perf(gateway): avoid duplicate recipient row lookup (#159595) refactor(gateway): deslop gateway fourth pass (#158786) test(agents): split subagent task-settlement test support under the line cap (#159584) ...
) Closes openclaw#159538 ## What Problem This Solves Fixes the `sessions` tool treating `model: "default"` as a literal model name instead of clearing the session's model override. ## User Impact Agents can return a session to its configured model with `sessions action=patch model=default`, consistently with `/model default` and `session_status model=default`. No configuration, tool-schema, description, or public API changes. ## Why This Change Was Made Reuse the existing tool model-override normalizer and send the Gateway's existing null reset value. Explicit model ids and thinking-level patches keep their existing behavior. The Gateway's post-commit selection refresh also handles null resets, so an already queued follow-up does not retain the old override. No overlap with Pash/Sarah changes. ## Evidence Real isolated, freshly built Gateways with a scripted OpenAI Responses provider called the actual `sessions` tool through its advertised `tool_call` entry point: | Scenario | Before | After | | --- | --- | --- | | `default`, no model allowlist | Stored `mock-openai/default`; next provider request used `default` | Override cleared; next request used configured model | | `default`, configured allowlist | Rejected `mock-openai/default`; old override remained | Override cleared; next request used configured model | | Normal model id | Selected requested model | Unchanged | | `/model default` | Cleared override | Unchanged | | `session_status model=default` | Cleared override | Unchanged | | Unknown model id with allowlist | Rejected; old override retained | Unchanged | The scripted provider responds to all requested model names, so the no-allowlist proof demonstrates the wrong next-turn model request, not an upstream-provider failure. Without an allowlist, unknown ids remain accepted as before. The reset regression failed on the original implementation (`default` instead of null) and passes with the fix. Focused sessions-tool suite: 33 passing tests; response suite after moving the regression to avoid the existing file's line cap: 6 passing tests, 17.68s wall, regression 7ms. Touched-file type-aware lint/type checking and formatting passed. Both fresh builds completed; both reported existing Control UI size warnings, unrelated to this change. Pending-turn proof: held the current scripted provider response, submitted a follow-up, observed `pendingInputs.queuedCount > 0`, then released the response that calls `sessions action=patch model=default`. Before the queue-owner fix, the tool reported `updated` and the stored model was `configured`, but the queued provider request still used `override`. Afterward, that queued request used `configured`. A queued `session_status model=default` control also used `configured`. The baseline run completed the sessions case; its subsequent status-control setup encountered a transient session-access readiness error. The candidate completed both cases. The real queue-state regression failed before the queue-owner fix and passed afterward (630ms); all 29 queue-state sibling tests passed (32.22s combined wall). Scoped type-aware lint/type checking passed for the queue owner and regression. Co-authored-by: Ayaan Zaidi <[email protected]>
Closes #159538
What Problem This Solves
Fixes the
sessionstool treatingmodel: "default"as a literal model name instead of clearing the session's model override.User Impact
Agents can return a session to its configured model with
sessions action=patch model=default, consistently with/model defaultandsession_status model=default. No configuration, tool-schema, description, or public API changes.Why This Change Was Made
Reuse the existing tool model-override normalizer and send the Gateway's existing null reset value. Explicit model ids and thinking-level patches keep their existing behavior.
The Gateway's post-commit selection refresh also handles null resets, so an already queued follow-up does not retain the old override.
Evidence
Real isolated, freshly built Gateways with a scripted OpenAI Responses provider called the actual
sessionstool through its advertisedtool_callentry point:default, no model allowlistmock-openai/default; next provider request useddefaultdefault, configured allowlistmock-openai/default; old override remained/model defaultsession_status model=defaultThe scripted provider responds to all requested model names, so the no-allowlist proof demonstrates the wrong next-turn model request, not an upstream-provider failure. Without an allowlist, unknown ids remain accepted as before.
The reset regression failed on the original implementation (
defaultinstead of null) and passes with the fix. Focused sessions-tool suite: 33 passing tests; response suite after moving the regression to avoid the existing file's line cap: 6 passing tests, 17.68s wall, regression 7ms. Touched-file type-aware lint/type checking and formatting passed. Both fresh builds completed; both reported existing Control UI size warnings, unrelated to this change.Pending-turn proof: held the current scripted provider response, submitted a follow-up, observed
pendingInputs.queuedCount > 0, then released the response that callssessions action=patch model=default. Before the queue-owner fix, the tool reportedupdatedand the stored model wasconfigured, but the queued provider request still usedoverride. Afterward, that queued request usedconfigured. A queuedsession_status model=defaultcontrol also usedconfigured. The baseline run completed the sessions case; its subsequent status-control setup encountered a transient session-access readiness error. The candidate completed both cases.The real queue-state regression failed before the queue-owner fix and passed afterward (630ms); all 29 queue-state sibling tests passed (32.22s combined wall). Scoped type-aware lint/type checking passed for the queue owner and regression.