Repository navigation
refactor(projects): resolve refresh ownership in state worker - #149392
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 16, 2026, 1:46 PM ET / 17:46 UTC (Revision 10). ClawSweeper reviewWhat this changesMoves managed repository refresh ownership checks into the shared state worker and preserves Windows environment settings while capturing inputs before asynchronous work. Merge readiness✅ Ready for maintainer review This PR remains useful: current main still performs refresh ownership lookup on the host. The previous Windows finding is resolved, and this review found no introduced blocking defect. Maintainer-authored work also remains protected from automatic closure. Priority: P2 Review scores
Verification
How this fits togetherProjects manages repositories used to create session worktrees. When a selected branch needs refreshing, the registry and checkout lease determine whether Git may fetch into the managed repository. flowchart TD
A[Session requests repository branch] --> B[Capture project and environment]
B --> C[Acquire checkout lease]
C --> D[State worker checks saved identity]
D --> E{Identity and lease valid?}
E -->|No| F[Refuse refresh]
E -->|Yes| G[Recheck ownership and refresh Git refs]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +41, Tests +168. Total +209 across 6 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep refresh on the existing shared-state worker while preserving the original checkout lease, registry identity predicate, and captured environment through Git completion. Do we have a high-confidence way to reproduce the issue? Not applicable to the primary internal refactor. The prior Windows defect has focused before/after coverage reported in the body and a source-verified repair; this review did not run tests. Is this the best way to solve the issue? Yes. The patch extends the established worker and lease-admission owners, removes the host refresh query, and preserves stored data and public contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b2a9dc036c3e. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (9 earlier review cycles; latest 8 shown)
|
65985f7 to
d4388c2
Compare
b514eda to
ce976b9
Compare
Preserve the reviewed removal change while inheriting the canonical wrapper fixture correction and current main ownership. This is a private source composition; prior timeout causes remain unattributed and qualification is still pending.
|
Merged via squash.
|
…aw#149392) * refactor(projects): move registry removal to the state worker * refactor(projects): move project listing to shared state worker * refactor(projects): register checkouts through shared state worker * refactor(projects): resolve refresh ownership in state worker * fix(projects): preserve Windows environment during refresh
Managed clone refresh moves its saved-ownership lookup to the existing shared-state worker. The worker matches the saved identity under the original checkout lease; the host captures inputs before awaiting and checks live ownership before and after refresh transport. Stale refusal and registered-project no-op behavior remain intact.
Refresh also uses the canonical platform-aware environment snapshot before worker-context capture, preserving mixed-case Windows state-directory and supervisor settings. This six-file change follows landed #149386. The other three environment-capture fixes remain in #150010, which extends the same test file from two refresh cases to eight producer cases.
Source
ecd22c71895e984ed6552aaabb885dd7d5eda5capassed independent P0–P2 review. Both refresh cases fail with the original plain spread and pass with the fix; the existing stale-refresh control also passed with current canonical workers. The environment cases mock Windows semantics, not a Windows OS run.Separately, artifact
db3194e0passed cold, display-name-only and reopened refresh through the actual source producer and canonical compiled workers, using three mocked transport calls. Samples were 432.53 ms cold, 3.76 ms display-name-only, 449.72 ms reopened, and 3.20 ms stale refusal. Host project-domain SQL counters stayed zero; native lease/bootstrap work remained. These are artifact-bound samples, not current-head benchmarks or whole-flow zero-SQL proof. Older1b295847samples used a 32-statement cache; current source uses 64.Exact-head CI passed: run 35126409623. No new build/package/update claim is made for this source carry. The earlier refresh timeout and mock-server exit remain unattributed.