Skip to content

feat(canvas): show last_sample_error + EC2 console output on failed workspaces - #1178

Merged
HongmingWang-Rabbit merged 2 commits into
stagingfrom
feat/failed-workspace-error-logs
Apr 21, 2026
Merged

HongmingWang-Rabbit merged 2 commits into
stagingfrom
feat/failed-workspace-error-logs

Conversation

@HongmingWang-Rabbit

Copy link
Copy Markdown
Contributor

Part 3 of 3 for the 'fail fast + comprehensive logs' UX. Paired with platform PR #1168 and controlplane PR #181.

What

  1. DetailsTab shows a dedicated Error section when the workspace is failed (or degraded with an error). Renders last_sample_error inline in a scrolling <pre>. Previously the only trace was a generic banner; now the actual Python traceback is right there.

  2. ConsoleModal — new component. Fetches GET /workspaces/:id/console and renders the EC2 serial console output in a portal-rendered modal with Copy / Close / Esc. Friendly messages on 501 (non-CP deploy) and 404 (instance terminated).

  3. ProvisioningTimeout banner's "View Logs" button now opens the console modal instead of the (usually empty) terminal tab. A stuck-provisioning workspace doesn't have a terminal — it has a crashed cloud-init script, which is exactly what the console shows.

Tests

6 new ConsoleModal tests: closed-no-fetch, happy-path fetch, 501 messaging, 404 messaging, Close button, Escape key.

All existing tests still pass. Pre-existing TS errors in __tests__/ unrelated to this PR.

Deploy order

  1. Merge platform PR feat(platform): bootstrap-failed + console endpoints for CP watcher #1168 → canvas endpoints live
  2. Merge controlplane PR HIGH: PR #167 fixes not deployed — 5 auth-required routes still exploitable on live server #181 → watcher + console proxy live
  3. Merge this → canvas consumes both

Without parts 1 and 2, the View console output button returns 501 gracefully (we tested this).

Hongming Wang and others added 2 commits April 20, 2026 17:22
…orkspaces

Part 3 of 3 for the "fail fast + comprehensive logs" UX. Platform PR
#1168 and controlplane #181 ship the server-side; this PR surfaces the
data in the canvas.

Two changes:

1. DetailsTab renders `last_sample_error` in a dedicated Error section
   when the workspace is failed (or degraded with an error). Before,
   the only trace of why a workspace failed was a generic banner —
   users had to click "View Logs", which opened the terminal tab (the
   post-boot log, empty on a runtime crash). Now the actual Python
   traceback is inline. A "View console output" button in the same
   section opens the full serial console in a modal.

2. New ConsoleModal component. Fetches GET /workspaces/:id/console
   (platform → CP → ec2:GetConsoleOutput). Portal-rendered above the
   canvas with Copy / Close / Esc handlers. Renders a friendly message
   on 501 (self-hosted deploys without CP) and 404 (instance
   terminated).

3. ProvisioningTimeout's "View Logs" button now opens the console
   modal instead of the (usually empty) terminal tab — when a
   workspace is stuck in provisioning, the cloud-init + user-data
   trace is what the user actually needs.

Tests cover the closed-state no-fetch, happy-path fetch, 501/404
messaging, and Close/Escape wiring.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@HongmingWang-Rabbit
HongmingWang-Rabbit merged commit be05855 into staging Apr 21, 2026
0 of 7 checks passed
HongmingWang-Rabbit added a commit that referenced this pull request Apr 21, 2026
staging → main: canvas error logs + console modal (PR #1178)
molecule-ai Bot pushed a commit that referenced this pull request Apr 21, 2026
…-logs

feat(canvas): show last_sample_error + EC2 console output on failed workspaces
molecule-ai Bot pushed a commit that referenced this pull request Apr 21, 2026
staging → main: canvas error logs + console modal (PR #1178)
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 Bot added a commit that referenced this pull request Apr 21, 2026
Marketing Lead drafted based on PR #1178 + EC2 Console demo storyboard. All 5 days of social queue now approved.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
molecule-ai Bot added a commit that referenced this pull request Apr 22, 2026
Marketing Lead drafted based on PR #1178 + EC2 Console demo storyboard. All 5 days of social queue now approved.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@molecule-ai
molecule-ai Bot deleted the feat/failed-workspace-error-logs branch May 20, 2026 06:21
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