Repository navigation
fix(projects): session-only checkouts are missing from project discovery - #191027
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. What this changesDiscover host-session Git checkouts from their canonical task directories and deduplicate checkout candidates before applying the limit. Example: Create one host session in checkout B and 50 host sessions in checkout A, then request projects.list with includeObserved enabled.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a concrete discovery bug still present on current main, preserves existing access checks, and has matching public-Gateway proof; no actionable findings remain. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway projects.list handler combines registered projects with optional observations from visible sessions and managed worktrees, resolves bounded Git identities, and returns authorized project summaries. flowchart LR
A[Session creation] --> B[Canonical session metadata]
B --> C[Visible checkout candidates]
D[Managed worktree registry] --> C
C --> E[Bounded Git identity discovery]
E --> F[Final disclosure checks]
F --> G[Project list response]
Technical reviewBest possible solution: Land the focused repair in the existing observed-project owner once required exact-head checks pass. Do we have a high-confidence way to reproduce the issue? Current-main source shows the producer/consumer field mismatch, and inspected public Gateway readbacks demonstrate the failure on the base and recovery on the unchanged production patch; this review ran no target code. Is this the best way to solve the issue? This is the smallest complete repair: consume canonical host task metadata and retain the newest representative per checkout inside the existing bounded discovery owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 37d681f0d323. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +18, Tests 0, Docs +4. Total +22 across 4 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 2, 2026, 6:32 AM ET / 11:32 UTC (Revision 2). |
What Problem This SolvesGit checkouts used only by host sessions are missing from observed project discovery even though the folders appear in recents. The discovery owner reads node-only Changes and User ImpactRetains Alix-007's repair at the existing observed-project owner: consume the canonical host task cwd and keep the newest session representative per checkout before applying the existing candidate bound. Repeated sessions in one checkout no longer crowd another visible checkout out of that window. Existing remote/node/device/repository-workspace exclusions, visibility filtering, bounded Git identity probes and final disclosure checks remain in force. No new scanner, project membership rule, SDK/protocol, configuration default or persisted schema. EvidenceBuilt main Adapted the contributor's published public-Gateway driver for archived built artifacts, explicit task-owned profiles/HOME/config/state, plus ordinary and outside-workspace controls. All source execution, dependencies, Git fixture creation, builds and Gateway runs stayed inside the task container. Each ref ran twice, with fresh Gateway state and real independently committed Git checkouts A and B under the selected fixture workspace. Public authenticated WebSocket
Candidate response shape after repeated sessions, normalized only here to omit disposable roots/timestamps: {"observedProjects":[{"name":"A","checkouts":[{"runnerId":"gateway","path":"<selected-workspace>/A"}]},{"name":"B","checkouts":[{"runnerId":"gateway","path":"<selected-workspace>/B"}]}],"sessionCount":51}Raw RPC replies and persisted-state readbacks are retained with the harness. Every observed checkout stayed under the selected fixture workspace; the unrelated outside Git repository was not scanned into the response. This is a negative discovery control, not a claim of a new filesystem authorization boundary. The Gateway config hash remained unchanged in all four runs. Cleanup: all four task Gateways stopped. Three exited with code 0; the first candidate run exceeded the driver's 10-second cleanup wait and was killed. Functional assertions had completed before cleanup; graceful-shutdown behavior is not claimed by that run. No production services, live user data or external channels were touched. Focused Checks and Simplification
Compatibility and Merge RiskTwo-way door: reverting restores the former candidate selection; no migration or new stored format. Blast radius is optional observed Git discovery for visible local host sessions. Registered projects, ordinary listing without observed discovery, remote placements and disclosure authority retain their existing owners and contracts. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Follow-up shutdown control on the same built production refs and same public 51-host-session workload (fresh state each cycle, candidate/main interleaved): candidate 177.995 ms and 183.411 ms; main 172.442 ms and 216.433 ms, measured from cleanup/SIGTERM initiation to child process close. All four exited code 0 without a signal or forced stop, and all completed below the original 10-second ceiling. The diagnostic driver allowed up to 60 seconds rather than killing at 10 seconds, but none needed the extra allowance. Discovery, session-count, ordinary-checkout, outside-workspace and opt-out assertions also passed in every cycle. Neither original main run required a forced stop. The original first-candidate cleanup outlier remains unexplained; these matched controls do not reproduce a candidate-specific shutdown hang or establish a discovery handle leak. No product change or repush was made. Task container stopped; timing receipts retained with the existing proof harness. |
|
@obviyus Thanks for the careful review, test consolidation, and landing this! |
…ery (openclaw#191027) fix: discover checkouts used by host sessions Checkout discovery did not find the Git checkouts that host sessions were using, so those checkouts were missing from the observed list. Discovery now includes the checkouts of host sessions in the selected workspace, each listed once. Registered checkouts are unchanged, checkouts outside the workspace are not discovered, and the discovery opt-out still works. Evidence: built Gateway on Node 24.22.1 in secretless Docker with real Git checkouts and public host-session creation. Main returned no observed checkouts twice; with this change both checkouts were discovered once each, twice, including after 50 sessions on one checkout. Registered-checkout, outside-workspace and opt-out controls were unchanged. Shutdown timing matched main in four extra cycles. Details: openclaw#191027 (comment) and openclaw#191027 (comment). Thanks @Alix-007. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Git checkouts used only by host sessions are missing from observed project discovery even though the folders appear in recents. The discovery owner reads node-only
execCwdinstead of the explicit host task directory persisted bysessions.createasspawnedCwd.Changes and User Impact
Retains Alix-007's repair at the existing observed-project owner: consume the canonical host task cwd and keep the newest session representative per checkout before applying the existing candidate bound. Repeated sessions in one checkout no longer crowd another visible checkout out of that window.
Existing remote/node/device/repository-workspace exclusions, visibility filtering, bounded Git identity probes and final disclosure checks remain in force. No new scanner, project membership rule, SDK/protocol, configuration default or persisted schema.
Evidence
Built main
e571cd1495c1358ab453c4496a645dc23af1602band contributor production headc15686d2a771d78896587e0bd4bea1ece1d231a6in secretlessnode:24.22.1Docker. Later changes consolidate tests and document the existing contract; production behavior remains the contributor's built repair.Adapted the contributor's published public-Gateway driver for archived built artifacts, explicit task-owned profiles/HOME/config/state, plus ordinary and outside-workspace controls. All source execution, dependencies, Git fixture creation, builds and Gateway runs stayed inside the task container.
Each ref ran twice, with fresh Gateway state and real independently committed Git checkouts A and B under the selected fixture workspace. Public authenticated WebSocket
sessions.create({cwd})created one B session and 50 A sessions. Readback confirmsspawnedCwdequals each selected checkout,execCwdis absent, andrunStartedis false. No provider/model call or direct session-store edit.sessions.listobservedProjectsfield absentobservedProjectsfield absentprojects.listprojects.listCandidate response shape after repeated sessions, normalized only here to omit disposable roots/timestamps:
{"observedProjects":[{"name":"A","checkouts":[{"runnerId":"gateway","path":"<selected-workspace>/A"}]},{"name":"B","checkouts":[{"runnerId":"gateway","path":"<selected-workspace>/B"}]}],"sessionCount":51}Raw RPC replies and persisted-state readbacks are retained with the harness. Every observed checkout stayed under the selected fixture workspace; the unrelated outside Git repository was not scanned into the response. This is a negative discovery control, not a claim of a new filesystem authorization boundary. The Gateway config hash remained unchanged in all four runs.
Cleanup: all four task Gateways stopped. Three exited with code 0; the first candidate run exceeded the driver's 10-second cleanup wait and was killed. Functional assertions had completed before cleanup; graceful-shutdown behavior is not claimed by that run. No production services, live user data or external channels were touched.
Focused Checks and Simplification
projects-observed.test.ts,projects.test.ts). Formatting applied to the changed tests.Compatibility and Merge Risk
Two-way door: reverting restores the former candidate selection; no migration or new stored format. Blast radius is optional observed Git discovery for visible local host sessions. Registered projects, ordinary listing without observed discovery, remote placements and disclosure authority retain their existing owners and contracts.