Repository navigation
fix: stuck publication error after worktree cleanup; compact Publish PR card - #165219
Conversation
…the publication card Shared publication observation threw "session worktree owner is unavailable" when worktree GC retired a session's checkout after it published. Observation only qualifies the current workspace, so a retired or replaced checkout now reads as no current publication; execution still re-proves the live worktree. The publication outcome now shows one status line that expands to the account, server message, next action, and effects, with an icon refresh button.
|
🦞👀 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 October 4, 2026, 8:42 PM ET / October 5, 2026, 00:42 UTC. ClawSweeper reviewWhat this changesThe PR treats retired publication workspaces as having no current publication and compacts the chat publication card into expandable status details with an icon refresh button. Merge readiness✅ Ready for maintainer review The fix remains useful: current main still throws when publication discovery encounters a retired worktree. No blocking introduced defect was found, and the supplied member-authored classification also protects this PR from automatic closure. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway reads publication receipts against a session’s current workspace and supplies status to the Control UI. The chat publication card presents that status and offers publication or recovery actions. flowchart TD
A[Session workspace record] --> C[Gateway publication reader]
B[Stored publication receipts] --> C
C --> D{Current workspace available?}
D -->|Yes| E[Current publication status]
D -->|No| F[No current publication]
E --> G[Chat publication card]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +137, Tests +23. Total +160 across 11 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep current-publication discovery scoped to live workspaces while preserving receipt history and accessible recovery details. Do we have a high-confidence way to reproduce the issue? Yes, from source: a retained receipt and session binding combined with a retired worktree reach the current-main owner exception. The PR provides a focused regression; this review did not execute it. Is this the best way to solve the issue? Yes. Returning absence from the existing observation owner matches workspace availability without weakening publication execution, and the UI reuses existing recovery callbacks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 869657375d2d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
The worktree-GC fix in #165219 intentionally makes retired or replaced worktrees read as no current publication. The old fixture still expected an owner error for that state. Move the no-receipt versus unavailable-owner check to a repository workspace, whose ownership contract still rejects once a shared receipt exists. Keep both empty-discovery assertions and the strict rejection; the existing worktree-GC regression remains intact. Validation: 35 publication tests and 25 bundled-channel shape tests pass with --maxWorkers=1 (259.67s combined wall time). Changed-file checks and independent P2 review pass. No production behavior or test timers change.
…the publication card (openclaw#165219) Shared publication observation threw "session worktree owner is unavailable" when worktree GC retired a session's checkout after it published. Observation only qualifies the current workspace, so a retired or replaced checkout now reads as no current publication; execution still re-proves the live worktree. The publication outcome now shows one status line that expands to the account, server message, next action, and effects, with an icon refresh button.
The worktree-GC fix in openclaw#165219 intentionally makes retired or replaced worktrees read as no current publication. The old fixture still expected an owner error for that state. Move the no-receipt versus unavailable-owner check to a repository workspace, whose ownership contract still rejects once a shared receipt exists. Keep both empty-discovery assertions and the strict rejection; the existing worktree-GC regression remains intact. Validation: 35 publication tests and 25 bundled-channel shape tests pass with --maxWorkers=1 (259.67s combined wall time). Changed-file checks and independent P2 review pass. No production behavior or test timers change.
What Problem This Solves
Fixes: the session Publish PR card shows a permanent "GitHub publication session worktree owner is unavailable." error, with a full-width Refresh bar, after worktree cleanup retires the session's idle checkout, and failed publications fill the card with paragraphs of server text.
User Impact
User impact: sessions whose worktree was retired after publishing no longer show a stuck error, and the publication card collapses to a single status line ("Publication failed", "Publication queued", …) with the details one click away and a small refresh icon instead of a full-width button.
Why This Change Was Made
On Team, a session published its PR, then worktree GC snapshotted and retired the checkout (
removed_atset, snapshot ref kept) while the session entry still named it. The shared publication observation (status and latest-receipt discovery, polled by the Control UI) found the published receipt, demanded a live worktree, and threw. Observation only qualifies the current workspace, so a retired or replaced checkout now reads as "no current publication", matching what publication availability already reports. Execution paths still re-prove the live worktree and fail closed, and a repository workspace owned by a different session still throws as an integrity error.The UI now leads with a short status headline that expands to the account, server message, next action, and effects. In the "Publication attempt failed" history, which already has its own disclosure, the details render inline instead of nesting a second expander. Queued/in-progress states drop the refresh icon because their primary "Check publication" button already refreshes.
Evidence
Failed publication and failed-attempt history, before and after (synthetic mock Gateway captures from the e2e suite):
src/gateway/github-publication-sqlite.test.ts: retires the session worktree after a receipt exists; on the old code it fails withGitHub publication session worktree owner is unavailable., now passes (pnpm test <file> --maxWorkers=1: 3 tests, ~1 s of test time, ~105 s wall including cold worker preparation).pnpm tsgo:ui, oxlint, stylelint, oxfmt,pnpm ui:i18n:verifyclean; new English strings only (locale refresh runs post-merge).