Repository navigation
fix: preserve conversation workspace during local publication - #196168
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 changesThis PR publishes local checkouts through linked task conversations while preserving the initiating conversation’s workspace. Example: A conversation working in /work publishes committed changes from /work/repository-a, then edits /work/repository-b.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes workspace changes still present on main, and no actionable correctness or security defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe GitHub publication tool hands a selected checkout and requester authority to Gateway session and publication owners, which retain custody, execute publication, and deliver receipts to the initiating transcript. flowchart TD
A[Conversation and original workspace] --> B[GitHub publication tool]
B --> C[Gateway admission]
C --> D[Linked task checkout]
D --> E[Publication coordinator]
E --> F[GitHub transport]
E --> G[Durable receipt]
G --> A
Technical reviewBest possible solution: Keep publication custody in a linked task while preserving the initiating workspace, original requester authority, and durable completion delivery. Do we have a high-confidence way to reproduce the issue? Fetched main still commits local publication custody onto the initiating session; the PR records a failing base regression and successful public-Gateway replay, while this read-only review ran no target code. Is this the best way to solve the issue? The linked task is a coherent fix using existing session, worktree, authority, receipt, and delivery owners, and removes the local adoption branch without changing deliberate sandbox PR selection. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5aa6d59ccaf1. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +588, Tests +720, Docs +13, Other +3. Total +1324 across 31 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 HistoryReviewed November 9, 2026, 8:12 PM ET / November 10, 2026, 01:12 UTC (Revision 3). |
|
@clawsweeper re-review Please review current head The requested stable-created pending and terminal publication receipt upgrade proof now passes from shipped 2026.11.2 through candidate Doctor and real Gateway startup. Recovery, receipt lookup, original session identities and transcript readback, exactly-once completion delivery, and unrelated-session isolation were verified; synthetic GitHub transport blocked external writes. The PR body records scope and remaining native-only shell proof limitations. The branch-caused test-type failure was reproduced and repaired; that CI lane now passes. Current-head CI has settled: its sole lint diagnostic is inherited from the exact main merge base, with identical UI file bytes and matching main-run error, as linked in the PR body. Please use the normal full review scope. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Please review current head The current-head Vito-shaped replay now covers same-human-turn recovery through the actual tool/handoff and public Gateway, non-admin success, original workspace/read and parent-report correlation, accepted pending recovery after restart, a fresh human publication, and an accepted task revoked before any external write then rejected after another restart. The latter settled The body also records the red-on-prior-head/green-on-fix regression, 38 passing affected cases, full-range local code review without findings, existing stable-created receipt upgrade proof, and the explicitly incomplete current-head unified declaration build. No merge or deployment is requested. |
|
🦞👀 Re-review progress:
|
…aw#196168) * fix: publishing a local checkout changes the conversation workspace * fix: preserve publication requester compatibility contracts * fix: explain publication source selection for unbound chats
What Problem This Solves
Fixes: publishing a committed local checkout changes the conversation workspace, so later work in another repository hits the publication checkout’s file boundary.
User Impact
Users can publish a task and continue working from the same conversation’s original workspace, including after publication fails. An unbound conversation that omits the source path receives a direct instruction to retry with its known committed checkout’s absolute
workspacePath, without administrative binding repair. Existing tool, host-path, project-access, and GitHub permissions still apply. Conversations adopted by earlier versions use the documented linked-conversation recovery; this change does not rewrite their history or move their files.Why This Change Was Made
Local
github_publish(workspacePath)gives the accepted snapshot to a linked publication task instead of adopting it into the initiating conversation. The existing publication owners retain requester authority, retries, receipts, and delivery to the initiating conversation across restarts. Explicit sandboxprepare_prkeeps its deliberate workspace selection.This replaces the local adoption branch and uses existing session and receipt storage, without a new schema, configuration option, or permission mode. Custody, receipt lookup, and completion delivery must change together so a successful tool handoff cannot strand the result in the task conversation. Project handoffs retain the current visibility and repository-identity checks.
Related: #184531, #195039.
Evidence
Original parent-workspace regression fails on base
2f5980d2887e0ea27dce0d268c029c5035a99341; the candidate passes through the registered Gateway handler with real Git checkouts and isolated GitHub transport.All 294 cases across 14 focused publication, authority, receipt, transcript, action, workspace-policy, retained PR-adoption, and prompt-prefix suites pass in an isolated Linux VM. Private-project, restricted System-bridge, and changed-visibility handoffs also fail when the project check is deliberately removed and pass with it restored.
Fresh independent review of the original 28 changed files found no P0–P2 issues. Four targeted TypeScript graphs, 25-file lint/parity, formatting/parity, the exact test-line ratchet, and the docs-link audit all pass. The supported
build:strict-smokealso passes, including AI/package/unified declarations, runtime/plugin distributions, CLI bootstrap, and all 162 public SDK subpaths. Current-base UI/full-default-build coverage is left to PR CI; these files do not change UI or packaging contracts.Live Codex/Gateway evidence confirms publication yield and controlled failure, automatic resume, a real relative read/edit/read through OpenClaw
exec, and the delivered final response. The parent workspace and both Codex turn-context working directories stayed original; the committed source stayed unchanged. GitHub writes were blocked.The native-only live probe remains failed at its tool-selection assertion: the model used OpenClaw
execrather than Codexexec_command. This is partial live evidence, not a passing native-shell test; native-shell execution remains unverified. No product code was changed to force that route.Full local ClawSweeper committed-range review completed on
2f5980d2887e0ea27dce0d268c029c5035a99341→c5765bc4b14555c43018498599363a3652b88bea(runnereae7a713e211392f2a57ab91880a761efa1ae359, full coverage, read-only). It found no concrete correctness or security issue. Its requested persisted-state compatibility coverage now includes the successful stable-created receipt upgrade below.Stable-created receipt upgrade proof passed in 213.6 seconds from shipped
2026.11.2(b556fdf457b026574bf0f1e7b4914b15f3f179ce) to clean-builte6d50eed45c4293c63256d3656f56c2076a18236. Stable publicsessions.create/sessions.github.publishhandlers created a terminal failed receipt and a second accepted pending receipt held before any GitHub write. After a controlled Gateway crash, candidate Doctor and real Gateway startup preserved all three sessions’ IDs, lifecycle revisions, working directories, worktree metadata, original public transcript readback, thinking/label settings, config, and historical file access. The pending receipt recovered after the existing lease-expiry/backoff cycle, reached the blocked synthetic transport, and delivered exactly one final failure report to its original session. The prior terminal receipt stayed identical without duplicate delivery; an unrelated session received neither report. The direct API fixture has no original agent run; separate live evidence above covers run attribution. A synthetic token and task-local trusted HTTPS account endpoint supplied identity; real GitHub and Git network effects were blocked, and no authority or lease guard was changed.Stable has no local
workspacePathadoption flow, so recovery of conversations adopted on earlier development versions is covered by the separate regression suite rather than a fabricated stable fixture. Native-only shell execution remains the acknowledged live-proof gap.Initial CI run 42668459261 settled with one branch-caused test-type failure. Commit
e6d50eed45c4293c63256d3656f56c2076a18236preserves exact claim/session requester equality while checking released requester input/output compatibility in both directions, allowing the new optional metadata. The reporting API now explicitly returns its existing report type. The exact failing root-other TypeScript graph was reproduced red before the repair and passes afterward; focused lint/parity and format/parity also pass. Independent review of this two-file correction found no actionable issue; it changes no runtime behavior or net line counts. Current-head CI 42701702402 settled with the corrected typecheck and all other selected lanes passing apart from inherited UI lint. The only diagnostic iseslint(no-shadow)forrowatui/src/e2e/sidebar-rail-alignment.e2e.test.ts:201; main run 42702382436 on the exact CI merge baseb09f5e65212882bdc68df70fd1da833c9a9c8f33reports the identical diagnostic, and the UI file has the same blob on main and the tested merge. The aggregate CI gate remains red for this inherited failure; no check is waived or rerun.Hosted ClawSweeper re-review completed on exact head
e6d50eed45c4293c63256d3656f56c2076a18236with the updated evidence (successful workflow 42707727432). It accepted the stable-created pending/terminal receipt upgrade coverage requested in the earlier review, found no actionable code or security issues, listed no before-merge items, and marked the PR ready for maintainer review. Native-only shell execution remains explicitly unverified; the reviewer found the exercised Gateway path sufficient for this workspace fix.Follow-up
d74bf34d2f9773f72135ee21809a56be38d44119classifies an unbound omitted-path call at the worktree reader after current-session validation. It asks the agent to retry with the known absolute checkout path; it never guesses a checkout or repairs binding. Expected accepted selections, missing registered custody, and replaced sessions retain lifecycle failures. The new registered-handler regression reproduces the generic lifecycle message one6d50eed45c4293c63256d3656f56c2076a18236, then passes with the fix, checking no first-attempt effects/task and same-key explicit recovery. All 38 cases in the two changed suites pass (662.38 seconds including cold compilation; summed case time: 217.995 seconds for session access and 51.551 seconds for availability). Targeted production and Gateway-method test TypeScript graphs, lint, formatting parity, MDX, and exact 720-line allocation pass. The 19 net additional regression lines reuse existing cases; no test case, schema, setting, permission, or production owner was added.Full local ClawSweeper committed-range review completed on
2f5980d2887e0ea27dce0d268c029c5035a99341→d74bf34d2f9773f72135ee21809a56be38d44119with runner066e625998e61b8045704618e21d3ab9d73d7329. It found no concrete introduced correctness/security defect or actionable code findings. Its source-only context lacked the executed runtime/upgrade evidence already recorded above; its requested accepted-task revocation proof is addressed by the runtime result below. Existing latest-stable receipt upgrade evidence is reused because this follow-up changes only unbound-source error classification.Vito-shaped runtime replay passed on clean-built
d74bf34d2f9773f72135ee21809a56be38d44119in the task-owned Linux VM (807.0 seconds for the proof case, including cold worker compilation; 811.94 seconds overall). Real public WebSocketsessions.create/chat.send, the actualgithub_publishtool/handoff, registered Gateway owners, native durable receipts, and two real Gateway restarts were exercised. The ordinary conversation had no managed binding. Its requester held exactlyoperator.sessions.readandoperator.sessions.write; the owner-onlyopenclawtool and administrative RPC stayed denied. The first tool call really omittedworkspacePath; the model consumed the new guidance and retried its human-supplied checkout in the same turn. That publication, an accepted pending publication after restart, and a fresh human publication all reachedpublished, with exactly one request-correlated assistant report each in the initiating history. Original parent workspace/bindings and source HEAD/index stayed unchanged, and each relevant turn's own relative read was matched to the model's consumed tool output. Persisted authority retained the original scope ceiling, null grant, exact parent lifecycle and original run IDs. A read-only requester and a fresh revoked requester received GatewayFORBIDDENwithout writes. A fourth task was accepted and held at a repository GET before any write, then its requester was revoked and the Gateway restarted: it settledfailed / identity_changedwithout dispatching a push or PR POST. This directly addresses the local review's accepted-task revocation request.Runtime-proof limits: the Responses model was deterministic and GitHub identity/network effects were isolated at the external transport; the publication/authority/custody owners were real, with no fabricated accepted receipts or substituted owner decisions. No test content was written to GitHub. This proves supported runtime prevention and same-turn recovery, not live-model retry reliability, a direct-to-GitHub contract test, or Vito's exact historical failed predicate. The historical argument shape now yields actionable recovery; an arbitrary checkout is never inferred.
Current-head
gatewayWatchruntime build passed in 8m 14.8s, including runtime/plugin distributions, CLI bootstrap, postbuild load/Doctor closure checks and clean exact-head stamps. A separate current-headbuild:strict-smokeattempt was stopped after unified declaration generation produced no result for ten minutes; it is incomplete, not passed or a product failure. No source or guard was changed for that limitation. The earlier full strict-smoke result above belongs to its earlier revision; current targeted typechecks pass, and CI supplies its own selected build evidence.The complete change adds 588 net production lines and 720 net test/support lines against the base, replacing the local-adoption path rather than adding a parallel workspace policy. The separate 720-line test allocation covers parent-workspace continuity, private task custody, revocation, restart/retry/receipt delivery, missing-source recovery, and linked recovery of previously adopted conversations; it leaves the shared test ceiling unchanged.