Repository navigation
fix: avoid prompt-derived worktree branch names - #153455
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 20, 2026, 3:51 AM ET / 07:51 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR replaces raw-prompt fallback session and worktree names with neutral crustacean names, updates documentation and regression coverage, and corrects a test import. Merge readiness✅ Ready for maintainer review The fix remains necessary on current main. No actionable patch defect was found, and the newly inspected screenshots resolve the previous visual-proof request. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway generates session titles from opening messages and supplies names to the managed Git worktree allocator. Saved titles appear in the sidebar, while allocated branches remain stable when titles arrive later. flowchart TD
A[New session request] --> B[Explicit name available]
B -->|Yes| E[Worktree allocator]
B -->|No| C[Automatic title generation]
C -->|Available| D[Saved session title]
C -->|Failure or wait expires| F[Neutral crustacean fallback]
D --> E
F --> E
D --> G[Session sidebar]
E --> H[Stable Git branch]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -2, Tests +61, Docs +6. Total +65 across 9 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Use the existing neutral-name allocator when automatic naming is unavailable, preserve established branch identities, and keep publication-destination changes separately scoped. Do we have a high-confidence way to reproduce the issue? Yes, by source: create an unnamed worktree session and make naming fail or exceed its wait; current main passes the raw source to the branch allocator. No runtime reproduction was executed in this review. Is this the best way to solve the issue? Yes. The patch repairs the title producer and both allocation callers while reusing existing naming, collision handling, and persistence guards. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 86f19c734de5. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
Prefer the generated session title and use the existing two-word crustacean fallback when automatic naming fails or times out. Remove raw title-source fallback from both worktree preparation paths while preserving explicit names and existing branches. Validation: 81 focused tests on Blacksmith Testbox, changed-file checks, docs MDX checks, and independent review passed. Related: #131480 and #131582.
Move generator-failure and title-wait recovery cases into the focused title suite. Assert the two-word fallback, saved fallback title, and stable branch after a late title. Remove duplicate success and failure cases while retaining no-initial-turn coverage. Validation: three focused recovery cases, formatting, line-cap checks, and fresh independent review passed.
Follow the factory move on main in the settled-replacement regression, preserving every assertion and the existing production owner. Validation: four model-runtime cases, three naming recovery cases, the Doctor database invariant, the agents-root typecheck, and fresh independent review passed.
eec844f to
8c5afd5
Compare
|
Merged via squash.
|
Follow up #153455 by centralizing joined title settlement and retries, reusing the async-resource owner for failure cleanup, and sharing discussion RPC handling. Preserve generated titles, two-word fallbacks, bounded waits, and source authority. Remove 103 net production lines.
* refactor: consolidate session title request ownership Follow up #153455 by centralizing joined title settlement and retries, reusing the async-resource owner for failure cleanup, and sharing discussion RPC handling. Preserve generated titles, two-word fallbacks, bounded waits, and source authority. Remove 103 net production lines. * test: retain subagent fixture state through cleanup The full Gateway agent suite reproduced a native-child RPC rejection because a preceding plugin fixture removed its database while an asynchronous worker was opening it. Reuse the canonical test-state fixture for the two leaking cases. Keep assertions, test order, timeouts, and production identity checks unchanged; the exact-merge Linux replay now passes 352 tests with no identity rejection. * test: prepare checkpoint history before the attempt deadline * test: bind ACP fixture cleanup to its state directory * test: import subagent bindings from their codec owner Use the extracted codec in the task-identifier regression without restoring a competing re-export. Incorporates the matching correction from #154048. Co-authored-by: VACInc <[email protected]> --------- Co-authored-by: VACInc <[email protected]>
* fix: avoid prompt-derived worktree branch names Prefer the generated session title and use the existing two-word crustacean fallback when automatic naming fails or times out. Remove raw title-source fallback from both worktree preparation paths while preserving explicit names and existing branches. Validation: 81 focused tests on Blacksmith Testbox, changed-file checks, docs MDX checks, and independent review passed. Related: openclaw#131480 and openclaw#131582. * test: preserve worktree naming recovery coverage Move generator-failure and title-wait recovery cases into the focused title suite. Assert the two-word fallback, saved fallback title, and stable branch after a late title. Remove duplicate success and failure cases while retaining no-initial-turn coverage. Validation: three focused recovery cases, formatting, line-cap checks, and fresh independent review passed. * test: use lifecycle owner for model replacement fixture Follow the factory move on main in the settled-replacement regression, preserving every assertion and the existing production owner. Validation: four model-runtime cases, three naming recovery cases, the Doctor database invariant, the agents-root typecheck, and fresh independent review passed.
* refactor: consolidate session title request ownership Follow up openclaw#153455 by centralizing joined title settlement and retries, reusing the async-resource owner for failure cleanup, and sharing discussion RPC handling. Preserve generated titles, two-word fallbacks, bounded waits, and source authority. Remove 103 net production lines. * test: retain subagent fixture state through cleanup The full Gateway agent suite reproduced a native-child RPC rejection because a preceding plugin fixture removed its database while an asynchronous worker was opening it. Reuse the canonical test-state fixture for the two leaking cases. Keep assertions, test order, timeouts, and production identity checks unchanged; the exact-merge Linux replay now passes 352 tests with no identity rejection. * test: prepare checkpoint history before the attempt deadline * test: bind ACP fixture cleanup to its state directory * test: import subagent bindings from their codec owner Use the extracted codec in the task-identifier regression without restoring a competing re-export. Incorporates the matching correction from openclaw#154048. Co-authored-by: VACInc <[email protected]> --------- Co-authored-by: VACInc <[email protected]>
Related: #131480 and #131582.
What Problem This Solves
Fixes new worktree branches retaining a slug of the opening prompt when automatic session naming fails or misses the worktree title deadline, even after the sidebar receives a useful title.
User Impact
New worktrees use a saved or generated session title when available, otherwise a two-word crustacean name. Failed automatic session naming uses that same fallback. Explicit names and existing branches remain unchanged; a late title can still update the sidebar without renaming the branch.
Why This Change Was Made
The canonical title owner no longer saves prompt-derived text after model failure, and both synchronous and deferred worktree preparation stop passing raw title-source text to the branch allocator. Existing title sharing, the 30-second wait, collision handling, and publication ownership remain intact.
This is a focused fallback repair. The broader proposal in #131582 to choose and persist a separate publication destination remains outside this change. No schema migration is required.
Evidence
7f67d3efe33e, covering actual Git worktree creation throughsessions.create, successful and failed naming, creation without an initial title, naming lifecycle/cancellation, retries, and branch collisions.tbx_01m2yg1q64g6jy0t3d1tz3f416completed with exit 0 and was stopped: run. The delegated Testbox result is authoritative; its backing Actions step can show cancellation after lease cleanup.check:changed, the two changed docs' MDX checks,git diff --check, and independent review passed.git range-diffconfirms both naming commits were unchanged by the rebase.Focused command:
Before and after: failed automatic naming
Inspected synthetic rendering proof on source
8c5afd5af32409aa77311354ff188667d1d4c466. The real Control UI uses maintained mock Gateway contracts and the same synthetic opening prompt. The before values come from the legacyderiveGoalSessionTitlefallback; the after values come from the currentcreateCrustaceanSlugfallback, with both branches formed by the production worktree slugifier. No real user data or provider credentials are present. These captures demonstrate rendering; the registeredsessions.createtests above prove failure selection, persistence, and actual Git allocation. Both captures were also delivered in the originating chat.Before:
After:
Required CI passed for
8c5afd5af32409aa77311354ff188667d1d4c466: CI run.