Skip to content

fix(canvas): skip /registry/:id/peers 401 noise on non-online workspaces - #1189

Merged
HongmingWang-Rabbit merged 3 commits into
stagingfrom
fix/peers-fetch-online-only
Apr 21, 2026
Merged

HongmingWang-Rabbit merged 3 commits into
stagingfrom
fix/peers-fetch-online-only

Conversation

@HongmingWang-Rabbit

Copy link
Copy Markdown
Contributor

Minor: DetailsTab fired a 401 fetch to /registry/:id/peers for every provisioning/failed workspace because that endpoint requires a workspace-scoped bearer the canvas session doesn't hold. Skip the fetch when status ∉ {online, degraded}. Peers section renders empty instead of showing an error banner.

HongmingWang-Rabbit and others added 3 commits April 20, 2026 17:31
staging → main: bootstrap-failed + console endpoints (PR #1168)
staging → main: canvas error logs + console modal (PR #1178)
The peers endpoint requires a workspace-scoped bearer token (see
validateDiscoveryCaller in handlers/discovery.go — designed for
agent-to-agent calls). The canvas session doesn't hold that token, so
every Details-tab open for a provisioning / failed / offline workspace
fired a 401 that cluttered devtools and lit up the error banner even
though the real UX here is "no peers — the workspace hasn't booted."

Gate the fetch on status ∈ {online, degraded} and render an empty
Peers list for everything else.

Follow-up: give the canvas a way to see peers for any workspace (admin
session should be enough). Tracked separately — this fix just quiets
the noise on the common case.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@HongmingWang-Rabbit
HongmingWang-Rabbit merged commit 93941a5 into staging Apr 21, 2026
0 of 7 checks passed
molecule-ai Bot pushed a commit that referenced this pull request Apr 21, 2026
fix(canvas): skip /registry/:id/peers 401 noise on non-online workspaces
molecule-ai Bot pushed a commit that referenced this pull request Apr 21, 2026
Post-review cleanup for the #1178 / #1189 bootstrap-watcher flow:

- ConsoleModal status-code matching uses \b regex anchors instead of
  raw substrings. Before, any error message containing "501" inside
  a longer digit run ("15012") would false-match into the self-hosted
  branch. Unlikely in practice but cheap to tighten.

- Peers empty-state copy now explains WHY the list is empty on
  offline / failed / provisioning workspaces instead of rendering the
  same "No reachable peers" text used for healthy workspaces with
  zero siblings. Online workspaces unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@molecule-ai
molecule-ai Bot deleted the fix/peers-fetch-online-only branch May 20, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant