Repository navigation
fix(gateway): honor selected model for worktree titles - #124902
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 1:13 AM ET / 05:13 UTC. ClawSweeper reviewWhat this changesRoutes managed-worktree title generation through the session’s selected provider, model, runtime, and auth profile for default, explicit, catalog, and inherited-parent creation paths. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readinessKeep open for normal maintainer review. Current main still starts worktree title generation without the selected session entry; the PR carries that route through the creation owner and adds focused coverage, with no blocking defect found. Its clean-but-behind branch needs merge-head validation. Priority: P1 Review scores
Verification
How this fits togetherGateway session creation selects a model route, optionally creates a managed worktree, and starts a title from the first message. The route used for title generation must agree with the stored session and its first chat turn. flowchart LR
A[Session creation request] --> B[Resolve selected model route]
B --> C[Prepare title generation]
C --> D[Create worktree]
D --> E[Persist session selection]
E --> F[Dispatch first chat turn]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +76, Tests +165. Total +241 across 6 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one validated selection projection in the session-creation owner, start direct titles from it, defer inherited titles until parent validation, and validate that route table on the final merge head. Do we have a high-confidence way to reproduce the issue? Yes—current main’s early title call omits the session entry, while the title helper resolves its route from that entry. The PR’s focused boundary test describes the failing explicit, catalog, and inherited routes, although this read-only review did not execute it. Is this the best way to solve the issue? Yes, with merge-head validation. Carrying a narrow validated selection through the existing creation and lifecycle owners avoids both a downstream workaround and restoration of a blocking live-catalog load. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d0b1b6d0ec3e. 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 (8 earlier review cycles)
|
|
@clawsweeper re-review The inherited-parent route now comes from the canonical parent-validation owner and has boundary coverage for title routing, branch naming, title persistence, and child selection. Exact-head focused, type, test-type, lint, and autoreview proof is recorded in the updated PR body. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Exact-head source update: preserve normalized category registration after the helper extraction and cover surrounding whitespace in the existing category test. Reviewed head: |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Carry the create request’s explicit or catalog-backed provider, model, runtime, and auth profile into create-time title routing without blocking on model-catalog loading. Related: #124787
Reuse the canonical model-policy resolver before prestarting title generation. Denied or invalid selections now skip title completion while persisted creation remains the sole live-catalog availability validator.
Preserve the null suppression sentinel at the preparation boundary while forwarding only the title generator’s optional entry shape.
Keep post-commit category registration aligned with the normalized category persisted by session creation after the helper extraction.
20d4036 to
9339f28
Compare
|
Land-ready proof for source head 9339f282e05dc3cfede818fc902a4e346a8476a1. Root cause: managed-worktree title generation started before the new session entry existed, so it could fall back to the agent default instead of the provider/model/profile selection already validated for the session. The canonical fix resolves that selection once in the session-creation owner and carries it through title generation, worktree naming, persistence, and the first chat turn. It does not add a blocking Coverage proves the default, explicit, catalog-backed, inherited-parent, and policy-denied selection paths. The denied path creates no title worktree or session row. The extracted post-create category registration also preserves the normalized category value. Presentation itself is unchanged; the related visual behavior is covered by #124787. Production LOC: +126/-50 (net +76) | Tests: +208/-43 (net +165). The mechanical rebase preserved the stable patch identity and the same six-file diff. Proof:
No docs, changelog, config, protocol, SQLite, dependency, or release changes are involved. |
|
Merged via squash.
|
* fix(gateway): honor selected model for worktree titles Carry the create request’s explicit or catalog-backed provider, model, runtime, and auth profile into create-time title routing without blocking on model-catalog loading. Related: openclaw#124787 * fix(gateway): validate worktree title route Reuse the canonical model-policy resolver before prestarting title generation. Denied or invalid selections now skip title completion while persisted creation remains the sole live-catalog availability validator. * fix(gateway): normalize denied title selection Preserve the null suppression sentinel at the preparation boundary while forwarding only the title generator’s optional entry shape. * fix(gateway): inherit worktree title route * fix(gateway): preserve normalized session categories Keep post-commit category registration aligned with the normalized category persisted by session creation after the helper extraction.
Related: #124787
What Problem This Solves
Fixes an issue where creating a managed-worktree session could generate its title and worktree name through the agent default route instead of the new session’s selected provider, model, runtime, and auth profile. This covered explicit models and registered session-catalog targets, and now also covers children that inherit their selection from a parent session.
Why This Change Was Made
One create-time selection resolver now handles default, explicit, catalog, and inherited-parent routes. Explicit and catalog routes retain the config-policy validation added by this PR. Parent inheritance is projected only inside the canonical session-creation owner, after that owner validates the parent, its ownership, and its model lock, then carries the narrow provider/model/runtime/profile selection into lifecycle preparation.
Title work still starts before repository resolution whenever the route is knowable at dispatch: default sessions without a parent, explicit models, and catalog targets. Parent-only requests defer title preparation until the validated inherited selection reaches the lifecycle callback. Denied or invalid direct selections continue to suppress title preparation entirely. The persisted create path remains the sole live model-catalog availability validator, so this does not restore the blocking catalog load removed by #122471.
User Impact
Create-time titles, managed-worktree branch names, persisted child selection, and the first chat turn now agree for default, explicit, catalog-backed, and parent-inherited sessions. A policy-rejected route cannot receive title content before the create request is rejected. Existing title persistence, timeout, and worktree fallback behavior is unchanged.
Evidence
node scripts/run-vitest.mjs src/gateway/server.sessions.create.test.ts src/gateway/dashboard-session-title.test.ts src/gateway/server-methods/chat-send-command-replies.test.ts src/agents/worktrees/name.test.ts src/agents/worktrees/service.naming.test.ts— 148 tests passed across five files.tbx_01m06nnsvarh61z99z2028s8dx: production types, all core test-type shards, and core oxlint passed. Run: https://github.com/openclaw/openclaw/actions/runs/31985343271git diff --check, and the final mandatory uncommitted autoreview passed with no accepted/actionable findings.sessions-create.tsnet -5 lines and under its max-lines budget without a suppression.