Skip to content

fix(ui): skip publication options for removed workspaces - #205909

Merged
obviyus merged 1 commit into
mainfrom
fix/refusal-watch-d0
Nov 26, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/refusal-watch-d0

Conversation

@obviyus

@obviyus obviyus commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

When cleanup removes a conversation's managed worktree, the chat replaces the composer with the "Restore workspace" prompt. The pane still attached the GitHub publication owner, so every page load requested sessions.github.options for that session.

For session-scoped members (operator.sessions.read without operator.read), the Gateway qualifies the publication source; the session still points at a worktree whose registry record has removedAt, so preparePublicationWorktreeRead throws GitHubPublicationSessionChangedError (src/gateway/github-publication-worktree-owner.ts:130) and the handler returns FORBIDDEN "GitHub publication session lifecycle changed." The request can never succeed until the workspace is restored.

Production (one Team Gateway, 2026-11-24 to 11-26): 114 of these refusals over 100 Control UI connections and 10 users. 93 came less than 2 s after connect (page load), usually two calls per load. The same users clicked "Restore workspace" within a minute of these refusals.

Fix

synchronizeChatPanePublication already detaches the publication owner when the pane cannot read options. A row whose worktreeState is not ready now takes the same detach path. When the restore brings the row back to ready, the pane attaches again and reads options as before. No Gateway change.

User impact

  • Members no longer get a refused publication read behind the restore prompt.
  • Operators with operator.read no longer load publication options for a removed workspace. There is nothing to publish until the workspace is restored; the restore prompt is the only action.

Evidence

  • ui/src/pages/chat/chat-pane-publication.test.ts: red on base (2 failed: removed-snapshot, removed-fresh attached the owner), green with the fix; the ready case attaches on both.
  • Root cause reproduced in a throwaway Gateway handler test (real sessions.github.options handler, registry record with removedAt): operator.sessions.read → FORBIDDEN from github-publication-worktree-owner.ts:130 for concurrent and later calls; operator.read → success.
  • Also ran ui/src/e2e/chat-worktree-restore.e2e.test.ts and ui/src/e2e/chat-github-publication.e2e.test.ts: green.
  • Head E2E (isolated Gateway, real agent turn) on 6616476e897b: Q (queued input refused visibly, refusal sentence in transcript), R (running turn finishes), S (stop cancels) all pass.
  • Local review on 6616476e897b: complete, "patch is correct", no findings.

- A session whose managed worktree was removed by cleanup has nothing to publish until the chat restore prompt brings it back.
- The pane still read sessions.github.options on every page load; session-scoped members got FORBIDDEN "GitHub publication session lifecycle changed." (113 refusals on Team since 11-24).

Co-authored-by: obviyus <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:auth-provider Auth, provider routing, model choice, or SecretRef resolution may break. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. labels Nov 26, 2026
@obviyus
obviyus merged commit dfc7eb7 into main Nov 26, 2026
99 checks passed
@obviyus
obviyus deleted the fix/refusal-watch-d0 branch November 26, 2026 10:50
@obviyus

obviyus commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

Landed as dfc7eb7. Bug: the chat pane read GitHub publication options for sessions whose managed worktree was removed, and session-scoped members got FORBIDDEN "GitHub publication session lifecycle changed." on every page load. Fix: the pane detaches publication until the restore prompt brings the workspace back to ready. Proof: red-on-base unit test, green CI, clean local review, Q/R/S E2E pass.

vincentkoc added a commit that referenced this pull request Nov 26, 2026
* commit '399057400013dcfa1923db08be96c6bf46cf7079':
  fix: keep known speakers on meeting notes with missing labels (#205923)
  fix(codex): let saved conversations recover after a remote failure (#201621)
  fix: distinguish namesakes in Google Meet transcript exports (#205915)
  refactor: share Discord meeting transcript publication (#205921)
  test: trim workflow and runtime performance coverage (#205782)
  fix(android): settle startup before checking archive refresh (#205891)
  fix: Gateway retains completed reply runtimes after catalog reloads (#195479)
  fix: clear unused-export failures in dependency checks (#205905)
  refactor: share browser routing for meeting captions and cleanup (#205916)
  fix(ui): update Workshop file preview mode (#205872)
  refactor(android): decouple shared JSON values from node handlers (#202840)
  fix(ci): remove bot credit from release notes (#205914)
  fix: pause interrupted shell turns when their result is unknown (#205859)
  fix(ui): skip publication options for removed workspaces (#205909)
  fix: preserve indentation in document previews (#205834)
  improve(ci): avoid full fixture builds for volume checks (#205903)
  refactor(android): derive connection readiness from its owner (#202898)
vincentkoc added a commit that referenced this pull request Nov 26, 2026
…oid-chat-preview-grapheme-boundary

* commit '0bea7ecb3029583dd49d83f760d4f40c9e1f543c': (129 commits)
  fix(android): settle startup before checking archive refresh (#205891)
  fix: Gateway retains completed reply runtimes after catalog reloads (#195479)
  fix: clear unused-export failures in dependency checks (#205905)
  refactor: share browser routing for meeting captions and cleanup (#205916)
  fix(ui): update Workshop file preview mode (#205872)
  refactor(android): decouple shared JSON values from node handlers (#202840)
  fix(ci): remove bot credit from release notes (#205914)
  fix: pause interrupted shell turns when their result is unknown (#205859)
  fix(ui): skip publication options for removed workspaces (#205909)
  fix: preserve indentation in document previews (#205834)
  improve(ci): avoid full fixture builds for volume checks (#205903)
  refactor(android): derive connection readiness from its owner (#202898)
  fix: preserve side chat text when dictating at the limit (#205710)
  improve(telegram): polling workers start faster and use half the memory (#190890)
  fix: keep speaker identities distinct in meeting notes (#205860)
  fix: wait for cancellation before releasing ACP test preparation (#205893)
  fix: bound workers retained after deleting sessions across agents (#197409)
  fix(memory): keep a child's memory audience after its parent resets (#205887)
  refactor(android): give installed skills one data owner (#202892)
  fix(cli): share process failure listeners across invocations (#205732)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 27, 2026
…5909)

## Problem

When cleanup removes a conversation's managed worktree, the chat replaces the composer with the "Restore workspace" prompt. The pane still attached the GitHub publication owner, so every page load requested `sessions.github.options` for that session.

For session-scoped members (`operator.sessions.read` without `operator.read`), the Gateway qualifies the publication source; the session still points at a worktree whose registry record has `removedAt`, so `preparePublicationWorktreeRead` throws `GitHubPublicationSessionChangedError` (`src/gateway/github-publication-worktree-owner.ts:130`) and the handler returns FORBIDDEN "GitHub publication session lifecycle changed." The request can never succeed until the workspace is restored.

Production (one Team Gateway, 2026-11-24 to 11-26): 114 of these refusals over 100 Control UI connections and 10 users. 93 came less than 2 s after connect (page load), usually two calls per load. The same users clicked "Restore workspace" within a minute of these refusals.

## Fix

`synchronizeChatPanePublication` already detaches the publication owner when the pane cannot read options. A row whose `worktreeState` is not `ready` now takes the same detach path. When the restore brings the row back to `ready`, the pane attaches again and reads options as before. No Gateway change.

## User impact

- Members no longer get a refused publication read behind the restore prompt.
- Operators with `operator.read` no longer load publication options for a removed workspace. There is nothing to publish until the workspace is restored; the restore prompt is the only action.

## Evidence

- `ui/src/pages/chat/chat-pane-publication.test.ts`: red on base (2 failed: `removed-snapshot`, `removed-fresh` attached the owner), green with the fix; the `ready` case attaches on both.
- Root cause reproduced in a throwaway Gateway handler test (real `sessions.github.options` handler, registry record with `removedAt`): `operator.sessions.read` → FORBIDDEN from `github-publication-worktree-owner.ts:130` for concurrent and later calls; `operator.read` → success.
- Also ran `ui/src/e2e/chat-worktree-restore.e2e.test.ts` and `ui/src/e2e/chat-github-publication.e2e.test.ts`: green.
- Head E2E (isolated Gateway, real agent turn) on `6616476e897b`: Q (queued input refused visibly, refusal sentence in transcript), R (running turn finishes), S (stop cancels) all pass.
- Local review on `6616476e897b`: complete, "patch is correct", no findings.

Co-authored-by: Ayaan Zaidi <[email protected]>
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 impact:auth-provider Auth, provider routing, model choice, or SecretRef resolution may break. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. P2 Normal backlog priority with limited blast radius. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant