Repository navigation
fix: project chats can't publish their checkout ("already has another source") - #195039
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 real behavior proof before merge. What this changesThis PR lets project chats publish local checkouts belonging to their project's repository. Example: A chat for the project at /work/openclaw publishes a committed checkout at /work/openclaw-task.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 5 items remain Keep open: this maintainer-authored PR addresses a current publication failure, but its repository comparison rejects valid linked-worktree projects and its test growth fails the test-line gate. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Gateway receives a session publication request and checkout path, validates requester and workspace ownership, binds a managed worktree, and hands publication to the existing GitHub coordinator. flowchart LR
A[Project chat] --> B[Publication RPC]
B --> C[Requester authority]
C --> D[Workspace adoption]
D --> E[Managed session worktree]
E --> F[GitHub publication coordinator]
F --> G[Push and pull request]
Technical reviewBest possible solution: Compare both checkouts through the existing repository identity resolver while retaining the existing adoption, binding, and publication owners. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically rejects an otherwise eligible project session because projectId alone triggers the competing-source refusal; no target code was executed during this read-only review. Is this the best way to solve the issue? Extending the existing adoption owner is appropriate, but repository identity must be normalized on both sides rather than comparing a primary checkout with a recorded project checkout path. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 04d0d241c166. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: No concrete authorization bypass was found, but the newly admitted project-session path needs final-effect authority verification. EvidenceWhat I checked:
PR surfaceSource +23, Tests +63. Total +86 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel 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 Reviewed November 8, 2026, 12:58 AM ET / 05:58 UTC. |
Project chats that work directly in the project checkout were refused by PR workspace adoption with "This conversation already has another source", because any projectId counted as a competing source. #184531 let local chats publish an authorized task checkout but left project chats out. Allow a project chat to adopt a local checkout only when that checkout belongs to the project's repository, so a project chat with a worktree still means the worktree comes from that project's repository. Without a local source (the sandbox path), project chats are still refused, and the project must stay unchanged until the worktree is saved. Co-authored-by: obviyus <[email protected]>
CI runners have no global Git identity, so the plain git commits in the new project-chat cases failed there. Use the same fixed identity and isolated config as the publication fixture. Co-authored-by: obviyus <[email protected]>
Co-authored-by: obviyus <[email protected]>
Keeps the new project-chat cases within the test-lines ratchet. Co-authored-by: obviyus <[email protected]>
Co-authored-by: obviyus <[email protected]>
25abfd8 to
279f117
Compare
|
Merged via squash.
|
… source") (openclaw#195039) * fix: let project chats publish their local checkout Project chats that work directly in the project checkout were refused by PR workspace adoption with "This conversation already has another source", because any projectId counted as a competing source. openclaw#184531 let local chats publish an authorized task checkout but left project chats out. Allow a project chat to adopt a local checkout only when that checkout belongs to the project's repository, so a project chat with a worktree still means the worktree comes from that project's repository. Without a local source (the sandbox path), project chats are still refused, and the project must stay unchanged until the worktree is saved. Co-authored-by: obviyus <[email protected]> * test: give project publication fixtures a git identity CI runners have no global Git identity, so the plain git commits in the new project-chat cases failed there. Use the same fixed identity and isolated config as the publication fixture. Co-authored-by: obviyus <[email protected]> * fix: explain a removed project instead of a repository mismatch Co-authored-by: obviyus <[email protected]> * test: reuse the publication fixture's git for project cases Keeps the new project-chat cases within the test-lines ratchet. Co-authored-by: obviyus <[email protected]> * test: fold the project outcome condition Co-authored-by: obviyus <[email protected]> --------- Co-authored-by: obviyus <[email protected]>
… source") (openclaw#195039) Backport the bounded runtime fix for LOCAL11.8; preserve unrelated baseline behavior. (cherry picked from commit f4976c9) Co-authored-by: obviyus <[email protected]> Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit c3253039580ec385a8b432286b82822b956089de)
What Problem This Solves
Fixes: publishing a PR from a project chat fails with "This conversation already has another source. Its files were preserved." when the agent publishes a committed checkout with
github_publishandworkspacePath.User Impact
Project chats that work directly in their project's checkout, or in a linked worktree of it, can publish through the Gateway again. Previously, almost every Control UI chat started inside a project hit this refusal.
A project chat that tries to publish a checkout from a different repository gets a clear error instead. Nothing is created or moved.
Why This Change Was Made
#178756 added workspace adoption for sandboxed ordinary chats and refused any chat already tied to another source, including any
projectId. #184531 extended adoption to local chats with an authorized task checkout, butprojectIdstayed on the refusal list. Neither PR's review discussed project chats.This change lets a project chat adopt a local checkout only when that checkout belongs to the project's repository. Repository identity comes from
git worktree list, so linked worktrees count as the same repository. This keeps the existing rule that a project chat's managed worktree comes from that project's repository, whichworktree-workspace-migration.tsdepends on. Without a local source (the sandbox path), project chats are still refused. The project must stay unchanged until the prepared worktree is committed.The publisher itself is unchanged: credentials stay in the Gateway, the accepted commit and tree are pinned, the branch is updated with compare-and-swap, the push uses a lease, and requests are journaled for recovery.
Evidence
github-publication-session-access.test.ts:origin/main, all three project cases fail with the exact user-facing "another source" error. With this change,github-publication-session-accessandsession-pr-workspace-adoptionpass 23/23 on the rebased head; format and lint are clean.openclawproject chats with no managed worktree.gh pr createfallbacks across 49 chats.server.sessions.create.workspace-policy.test.tshas 6 failures that are identical on unmodifiedorigin/main.2fa5c4160a2balready removed the readinessselect_bound_sessionremedy, which also led agents to give up on unbound chats.