Skip to content

fix: stuck publication error after worktree cleanup; compact Publish PR card - #165219

Merged
steipete merged 1 commit into
mainfrom
steipete/dashboard-redesign-error-fix-b3ad0f
Oct 5, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/dashboard-redesign-error-fix-b3ad0f

Conversation

@steipete

@steipete steipete commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

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_at set, 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):

Publication card before and after

  • Regression src/gateway/github-publication-sqlite.test.ts: retires the session worktree after a receipt exists; on the old code it fails with GitHub 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).
  • Control UI unit tests (chat-pull-requests, chat-github-publication, chat-shared-publication): 76 passed.
  • Playwright e2e (chat-pull-requests, chat-pr-publication-state, chat-github-publication, chat-github-publication-guest): 39 passed. Assertions that required the long server prose to be visible now check it is attached (it lives in the collapsed details); the two refreshes in queued/publishing states click "Check publication".
  • pnpm tsgo:ui, oxlint, stylelint, oxfmt, pnpm ui:i18n:verify clean; new English strings only (locale refresh runs post-merge).
  • Root cause confirmed read-only against the Team state database (worktree row retired with snapshot ref after the publication was published).

…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.
@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime size: M labels Oct 5, 2026
@steipete
steipete marked this pull request as ready for review October 5, 2026 00:37
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 5, 2026
@clawsweeper

clawsweeper Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 8:42 PM ET / October 5, 2026, 00:42 UTC.

ClawSweeper review

What this changes

The 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
Reviewed head: 8f9082e826e17839e75ee80c51781d6ed864c7f2

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with useful visual evidence and reported validation; no blocking patch defect was found.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: Repository State identifies member-authored work, so the external-contributor proof gate does not apply. Inspected before/after captures prove the visible card layout; the reported Team database diagnosis and regression are supplemental rather than live after-fix recovery proof. No stored-data format changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Repository State identifies member-authored work, so the external-contributor proof gate does not apply. Inspected before/after captures prove the visible card layout; the reported Team database diagnosis and regression are supplemental rather than live after-fix recovery proof. No stored-data format changes.
Evidence reviewed 7 items Pinned introduced patch: Inspected the merge-base-to-head patch. Its production changes concern publication observation and card presentation; unrelated base-branch changes are excluded.
Still necessary on current main: Fetched main retains the worktree-owner exception and full-width refresh rendering. No inspected source establishes an already-merged replacement for this fix.
Observation and execution remain separate: The changed reader returns absence for missing or replaced workspaces, retains repository session/agent mismatch rejection, and preserves explicit terminal-receipt history. Execution still requires a live matching worktree through requirePublicationWorktreeOwner.
Findings None None.
Security None None.

How this fits together

The 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
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +137, Tests +23. Total +160 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 5 195 58 +137
Tests 6 39 16 +23
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 234 74 +160

Review metrics

None.

Technical review

Best 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.

Labels

Label changes:

  • add P2: This repairs a bounded publication-status failure after worktree cleanup and improves its recovery presentation.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Repository State identifies member-authored work, so the external-contributor proof gate does not apply. Inspected before/after captures prove the visible card layout; the reported Team database diagnosis and regression are supplemental rather than live after-fix recovery proof. No stored-data format changes.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository State identifies member-authored work, so the external-contributor proof gate does not apply. Inspected before/after captures prove the visible card layout; the reported Team database diagnosis and regression are supplemental rather than live after-fix recovery proof. No stored-data format changes.

Label justifications:

  • P2: This repairs a bounded publication-status failure after worktree cleanup and improves its recovery presentation.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository State identifies member-authored work, so the external-contributor proof gate does not apply. Inspected before/after captures prove the visible card layout; the reported Team database diagnosis and regression are supplemental rather than live after-fix recovery proof. No stored-data format changes.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Repository State identifies member-authored work, so the external-contributor proof gate does not apply. Inspected before/after captures prove the visible card layout; the reported Team database diagnosis and regression are supplemental rather than live after-fix recovery proof. No stored-data format changes.

Evidence

What I checked:

  • Pinned introduced patch: Inspected the merge-base-to-head patch. Its production changes concern publication observation and card presentation; unrelated base-branch changes are excluded. (src/gateway/github-publication-shared-read.kernel.ts:45, 8f9082e826e1)
  • Still necessary on current main: Fetched main retains the worktree-owner exception and full-width refresh rendering. No inspected source establishes an already-merged replacement for this fix. (src/gateway/github-publication-shared-read.kernel.ts:81, 869657375d2d)
  • Observation and execution remain separate: The changed reader returns absence for missing or replaced workspaces, retains repository session/agent mismatch rejection, and preserves explicit terminal-receipt history. Execution still requires a live matching worktree through requirePublicationWorktreeOwner. (src/gateway/github-publication-availability.ts:129, 8f9082e826e1)
  • Focused retirement regression: The added test inserts a receipt, retires its registered worktree, and asserts that current-publication discovery returns undefined. The body reports pre-fix failure and post-fix success, plus 76 UI unit tests and 39 browser tests; these were not executed during this read-only review. (src/gateway/github-publication-sqlite.test.ts:67, 8f9082e826e1)
  • Inspected visual proof: Viewed the prepared before/after image linked in the captured PR body. It directly shows the compact failed-publication card and expanded failure history with recovery guidance and icon refresh controls. The body accurately identifies these as synthetic mock-Gateway captures; they do not establish live worktree-retirement recovery. (ui/src/pages/chat/components/chat-github-publication.ts:267, 8f9082e826e1)
  • Prior merged-area routing: Current-main logs identify Peter Steinberger’s shared-receipt worker refactor and Shakker’s guest-publication work. GitHub commit reads resolve their logins to steipete and shakkernerd. These support routing, not causal introduction attribution. (ui/src/pages/chat/components/chat-github-publication.ts, df8c0ee207c1)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • shakkernerd: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit a2affcf into main Oct 5, 2026
199 of 202 checks passed
@steipete
steipete deleted the steipete/dashboard-redesign-error-fix-b3ad0f branch October 5, 2026 01:10
@steipete

steipete commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 5, 2026
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
…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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant