Repository navigation
fix(ui): show sessions while remote projects clone - #130192
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Create remote-project sessions before cloning, expose workspace preparation progress, and retain private restart-safe project intent until the workspace binds.
25a227d to
d3d1b3d
Compare
|
Codex review: found issues before merge. Reviewed August 26, 2026, 11:48 AM ET / 15:48 UTC. ClawSweeper reviewWhat this changesThis PR creates a remote-project session before cloning so the Control UI can open the chat immediately and report workspace preparation progress. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open: the new remote-project path regresses existing remote Worktree sessions with an initial prompt by sending a parameter combination the Gateway rejects. Priority: P1 Review scores
Verification
How this fits togetherThe Control UI turns a repository selection and first message into a Gateway session request. The Gateway persists the session, prepares the selected repository, then binds that workspace before agent dispatch. flowchart LR
A[Remote project selection] --> B[Control UI session request]
B --> C[Gateway session creation]
C --> D[Durable pending project]
D --> E[Repository preparation]
E --> F[Workspace binding]
F --> G[Agent dispatch]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +254, Tests +684. Total +938 across 24 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Mantis proof suggestionA redacted Control UI chat proof would directly demonstrate immediate session navigation and preparation status for the non-Worktree path. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Use session-owned preparation only for non-Worktree remote first turns; keep pre-session materialization for remote Worktree starts and add a focused regression covering that supported flow. Do we have a high-confidence way to reproduce the issue? Yes—source establishes the path: select an unregistered remote project, enable Worktree, enter a first prompt, and the UI emits projectGitUrl with worktree:true, which the Gateway rejects. Is this the best way to solve the issue? No: session-owned preparation is appropriate for the non-Worktree path, but bypassing materialization must not include the existing remote Worktree flow. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 20eef858aafb. 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
|
|
Addressed the ClawSweeper P1 on head Remote selections with Worktree enabled now remain on the established Proof after the fix:
Both listed rank-up moves are applied. Exact-head hosted CI is waiting on the active GitHub Actions outage; GitHub Status reports traffic is being ramped back gradually. |
|
Land-ready at exact head The ClawSweeper P1 and both rank-up moves are addressed:
Verification:
Source LOC: +303/-49 (net +254) | Tests: +866/-150 | Generated clients: +4/-0. Proof gap: the 141-second pre-fix timing is from the real Stable Gateway; the fixed UI states are browser-harness proof rather than a deployed Stable run. The changed owner boundaries and actual clone behavior are covered by Gateway tests using temporary Git repositories. Provenance: the blocking clone-before-session ordering was introduced by #122906 ( |
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(ui): show sessions while remote projects clone This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Merged via squash.
|
* fix(ui): show sessions while projects prepare Create remote-project sessions before cloning, expose workspace preparation progress, and retain private restart-safe project intent until the workspace binds. * fix(ui): materialize remote projects before worktree sessions * fix(protocol): refresh session create clients
Selecting a GitHub repo from the new-session project search (or pasting a clone URL) hid the branch/worktree chip entirely on Local placement and blocked cloud placement, even though the submit flow already materializes remote projects via projects.add before creating worktree sessions (#130192). The draft repository model classified a selected remote repo as unknown (kind idle) when it is git by construction. New pending-clone repository state makes remote selections worktree- capable everywhere availability is consulted: the detail chip renders, cloud profiles enable, and switching to a device placement no longer drops the selected repo. Repository discovery now runs through one planRepositoryDiscovery classifier plus a single adoptResolvedRepository reconciliation that owns preference restore and non-git rejection for both immediate and RPC results (previously duplicated across four branches). The submission-flow test no longer mocks worktreeAvailable.
…#131100) Selecting a GitHub repo from the new-session project search (or pasting a clone URL) hid the branch/worktree chip entirely on Local placement and blocked cloud placement, even though the submit flow already materializes remote projects via projects.add before creating worktree sessions (#130192). The draft repository model classified a selected remote repo as unknown (kind idle) when it is git by construction. New pending-clone repository state makes remote selections worktree- capable everywhere availability is consulted: the detail chip renders, cloud profiles enable, and switching to a device placement no longer drops the selected repo. Repository discovery now runs through one planRepositoryDiscovery classifier plus a single adoptResolvedRepository reconciliation that owns preference restore and non-git rejection for both immediate and RPC results (previously duplicated across four branches). The submission-flow test no longer mocks worktreeAvailable.
…openclaw#131100) Selecting a GitHub repo from the new-session project search (or pasting a clone URL) hid the branch/worktree chip entirely on Local placement and blocked cloud placement, even though the submit flow already materializes remote projects via projects.add before creating worktree sessions (openclaw#130192). The draft repository model classified a selected remote repo as unknown (kind idle) when it is git by construction. New pending-clone repository state makes remote selections worktree- capable everywhere availability is consulted: the detail chip renders, cloud profiles enable, and switching to a device placement no longer drops the selected repo. Repository discovery now runs through one planRepositoryDiscovery classifier plus a single adoptResolvedRepository reconciliation that owns preference restore and non-git rejection for both immediate and RPC results (previously duplicated across four branches). The submission-flow test no longer mocks worktreeAvailable.
Closes #130189.
Related: #124966 and #125100 cover the separate managed-worktree startup lifecycle. This PR fixes the earlier unregistered remote-project materialization step, which still blocks those flows before worktree startup begins.
What Problem This Solves
Fixes an issue where users starting a Control UI session with an unregistered remote GitHub project remained on the New Session page with only a spinner while the Gateway cloned and installed the repository.
In the observed
openclaw/openclawcase,projects.addblocked for 141,257 ms beforesessions.createbegan. No authoritative session, navigation target, progress state, or session-owned failure existed during that interval.Why This Change Was Made
Remote-project intent now enters the existing
sessions.createowner. The Gateway persists the session immediately, acknowledges the canonical initial run, emits the existing workspace-preparation status, and binds the prepared project before agent dispatch.The pending repository intent is bounded, credential-free, durable across Gateway restarts, and private from public/plugin session projections. Exact session, run, lifecycle-generation, cancellation, and runtime-authority checks fence every awaited preparation boundary. Empty repository sessions retain the existing
projects.addthenprojectIdpath so users can create first and prompt later.This deliberately does not replace the broader managed-worktree lifecycle proposed in #125100.
User Impact
Users are taken into the real session immediately and see the submitted message plus the animated Preparing workspace… status while cloning runs. Clone or sandbox failures remain visible and retryable in that session, cancellation cannot bind or dispatch late work, and a Gateway restart cannot cause the next message to run silently in the default workspace.
Evidence
Observed live before the fix on Stable:
projects.add: 141,257 mssessions.create: 104 ms, only after project materialization completednode_modules)Regression proof:
expected +0 to be 1because no session existed whileprojects.addwas pending.projects.add.Final local verification:
pnpm check:changedequivalent changed-file gate: formatting, five TypeScript lanes, lint, Plugin SDK boundaries, database guards, and import cycles passedgit diff --check: passedThe attached proof shows current
mainwaiting on the inert New Session page, the repaired immediate session with workspace preparation, and the actionable failure state. Fixed UI proof uses the mocked Gateway browser harness; the 141-second before timing is from the real Stable Gateway.Source LOC: +303/-49 (net +254) | Tests: +866/-150 | Generated clients: +4/-0
The production growth is the durable private recovery state plus exact run/session/lifecycle authority needed to prevent restart, cancellation, or stale-workspace dispatch from silently running in the wrong directory.
AI-assisted: yes. The final source and behavior were independently reviewed, and the author understands the ownership and recovery flow.