Skip to content

fix(workspaces): open a quick action's workspace beside the item on any machine - #2039

Open
cpcloud wants to merge 4 commits into
mainfrom
fix-quick-action-navigation
Open

cpcloud wants to merge 4 commits into
mainfrom
fix-quick-action-navigation

Conversation

@cpcloud

@cpcloud cpcloud commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

TL;DR

When the default machine is a fleet member or a devbox, a quick action or Create Workspace on a pull request or issue sent you to the Workspaces tab. Now the workspace opens in the pane beside the item, the same as a local one, and the pane's tab names the machine ("Workspace on compute-a (devbox)").

Why

Before #1924, a quick action left you on the item and opened the agent in the pane beside it. #1924 made workspace starts honor the default machine. The pane's link to its workspace held only an ID, so it could only point at this machine's workspaces, and the create path navigated away for remote ones.

How

The pane's terminal view could already show another machine's workspace. The link from an item to its workspace now also carries the machine key and display name. The pane, its tab label, Open Workspace, and delete handling all read the machine from that link.

Reviewer notes

  • A remote link survives refreshes. This Forge's item detail lists only local workspaces, so a refresh after creation reports none. The pane keeps the remote link until a local workspace appears or the remote one is deleted.
  • A page reload forgets the link. The next create or quick action reuses the existing remote workspace and opens it again.
  • Phone views still navigate. They have no pane beside the item.

User-facing benefit: starting a workspace on another machine keeps you on the pull request or issue you are reading, with the agent beside it.

Co-authored-by: Claude noreply@anthropic.com
Model used: Opus 5.5

… another machine

Running a quick action from a pull request or issue used to leave the
user on the item, with the agent opening in the workspace pane beside
it. Since default machines came to every Forge UI (#1924), a quick
action on a remote default (a fleet member or a devbox) sends the user
to the Workspaces tab instead. Before #1924, a default that named a
fleet member was ignored here, so the workspace was created on this
machine and opened beside the item.

The pane beside an item can show only this machine's workspaces, so it
cannot hold the remote one. A quick action does not need it on screen:
the server launches the agent and delivers the prompt. Now the user
stays on the item, and a message names the machine and offers to open
the workspace.

A plain Create Workspace on a remote default still opens the workspace
in Workspaces, because the user asked to work in it. Phone views and
other views without the pane also keep navigating; they have nothing
to show beside the item.

Quick actions on a local default never navigated. They create, or
reuse, the local workspace and open it beside the item, as before.

Generated with Claude Code (claude-opus-5-5)
Co-authored-by: Claude <noreply@anthropic.com>
@roborev-ci

roborev-ci Bot commented Nov 18, 2026

Copy link
Copy Markdown

roborev: Combined Review (32e4e50)

Verdict: Changes require fixes for 2 findings.

Medium

  • frontend/src/lib/components/detail/IssueDetail.svelte:920-922: After resolving an issue quick action’s branch conflict on another machine, the dialog stays open with enabled submit buttons although the workspace and action started. Success retains dialog state. This affects views with a workspace pane.

    Fix: Close the conflict dialog and clear the pending launch and action before announcing remote success, while preserving the dialog if a retry fails. Where: frontend/src/lib/components/detail/IssueDetail.svelte, createWorkspace

  • frontend/src/lib/stores/workspace-target.svelte.ts:206: When launching a PR or issue quick action, you may see an internal machine identifier instead of its name. The label uses the saved identifier. Only remote defaults with pending or unavailable machine lists are affected.

    Fix: Use “your default machine” when the machine name is unavailable, while preserving resolved names and the button that opens the workspace. Where: frontend/src/lib/stores/workspace-target.svelte.ts, label


Reviewers: 3x codex, codex (security), codex (test-value) | Synthesis: codex, 2m59s | Total: 8m59s

A quick action or Create Workspace on a remote default machine should
feel the same as one on this machine: the workspace opens in the pane
beside the pull request or issue. The previous commit kept the user on
the item but only offered the workspace from a message, so a remote
default still behaved differently from a local one.

The pane's terminal view could already show another machine's
workspace. What it lacked was the machine: the item's link to its
workspace held only an ID. The link now carries the machine key and
name, the pane's tab says "Workspace on <machine>", and Open Workspace
routes to that machine.

This Forge's detail response lists only its own workspaces, so a
refresh after creation reports none. The pane keeps a remote link
through that and drops it when a local workspace appears or the remote
one is deleted. After a full page reload the link is gone until the
next create or quick action, which reuses the existing remote
workspace.

Generated with Claude Code (claude-opus-5-5)
Co-authored-by: Claude <noreply@anthropic.com>
@cpcloud cpcloud changed the title fix(workspaces): keep a pull request open when a quick action runs on another machine fix(workspaces): open a quick action's workspace beside the item on any machine Nov 18, 2026
@roborev-ci

This comment has been minimized.

…cal one

Review of the previous commit found places where a workspace on another
machine still behaved differently from a local one in the pane beside a
pull request or issue:

- Its quick actions were disabled when this machine lacked the agent,
  although the agent runs on the workspace's machine. They now skip
  the local check, as creating on a remote default already did.
- The first quick action that created it ignored the session placement
  setting (tab, left, right) that later actions and local creates
  honor, including when setup had to be retried first.
- After an issue's branch-conflict retry succeeded, the conflict dialog
  stayed open over the new workspace. It now closes on success, which
  also fixes the same leftover dialog on the local path.
- Deleting it from Workspaces after leaving its item left the item's
  link behind, so returning reopened a deleted workspace.
- Deleting a local workspace and then creating a remote one before the
  item's detail refreshed let the stale detail, still naming the deleted
  workspace, erase the remote link.
- Before fleet discovery named the machine, the pane said "another
  machine" for the rest of the visit. It now shows a name taken from
  the machine's key.

The e2e spec now waits for a control that only the loaded remote
workspace shows, so it fails if the pane reads the wrong machine.

Deferred: when a remote workspace is deleted on its own machine, the
pane keeps showing it until something reloads it. That is existing
terminal-view behavior for every remote workspace.

Generated with Claude Code (claude-opus-5-5)
Co-authored-by: Claude <noreply@anthropic.com>
@roborev-ci

roborev-ci Bot commented Nov 18, 2026

Copy link
Copy Markdown

roborev: Combined Review (218b4b8)

Verdict: Changes require fixes for 2 findings.

Medium

  • frontend/src/lib/components/detail/PullDetail.svelte:3150: When you open a remote workspace beside a PR or issue, “Launch an agent” hides remote-only agents, offers unusable local-only agents, or disables without local agents. It uses local settings, affecting differing machine configurations.

    Fix: Use the workspace’s available agents in the launch menu while preserving local menus, remote quick actions, and where new sessions appear. Where: PullDetail.svelte, IssueDetail.svelte

  • frontend/src/lib/workspace-inline.ts:23: If you view a remote workspace without a known machine name, its pane label shows an internal machine ID whenever the fallback receives one. It displays that identifier unchanged.

    Fix: Show “remote machine” instead of an internal identifier when the machine name is unavailable, preserving known machine names and devbox labels. Where: workspace-inline.ts, hostKeyLabel


Reviewers: 3x codex, codex (security), codex (test-value) | Synthesis: codex, 3m14s | Total: 12m40s

@wesm wesm self-assigned this Nov 18, 2026
…its own machine

Linking a remote workspace to its pull request or issue left gaps where
Forge still treated the workspace as local or trusted a stale status:

- A bulk quick action on an item whose workspace this session created on
  another machine sent the handoff to this Forge, which does not have
  that workspace. The action failed with "lost contact with Kenn Forge".
- The link keeps the status from the create response, because this
  Forge never lists another machine's workspaces. A quick action on the
  linked workspace therefore could not see that setup had failed since,
  and did not set it up again as a create on that machine used to.
- The header's agent menu listed this machine's agents, so a remote
  workspace offered agents its machine lacks and hid ones only it has.
- A fleet member with no known name was labeled by its internal node ID.

Quick actions on a remote link, from the header or in bulk, now ask that
machine for the item's workspace again. The machine returns the same
workspace with its current status, so the existing retry and
being-deleted handling applies, and it makes a new one if the old one
is gone. The header's agent menu uses the agents the pane loaded from
the workspace's machine.

A remote workspace deleted elsewhere is already handled: the pane loads
it from its machine, gets a 404, and drops the link.

Generated with Claude Code (claude-opus-5-5)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@roborev-ci

roborev-ci Bot commented Nov 19, 2026

Copy link
Copy Markdown

roborev: Combined Review (7de8d0d)

Verdict: Changes require fixes for 4 findings.

Medium

  • frontend/src/lib/components/detail/PullDetail.svelte:2047-2053: PR/issue header actions on existing remote workspaces fail during development machine maintenance or silently drop selections during resolution despite enabled menus. They request creation, triggering maintenance rejection and pending-request blocking.

    Fix: Resolve existing workspaces on their owning machines through the ordered action queue, preserving every selection, status-based retries, deletion handling, and duplicate-creation protection, and create a workspace only when none exists. Where: runQuickActionInWorkspace, frontend/src/lib/components/detail/PullDetail.svelte

  • frontend/src/lib/components/terminal/WorkspaceTerminalView.svelte:4631: On PR/issue headers, retrying failed remote setup can launch agents but leave the pane showing an error. Direct retries neither refresh nor poll; unchanged machine/ID and absent remote events leave readiness checks blocking display.

    Fix: Refresh the pane after retrying remote setup, resume polling until the workspace is ready, and show the launched session without navigating away. Where: workspace-quick-actions.ts, frontend/src/lib/components/terminal/WorkspaceTerminalView.svelte, RetrySetup

  • frontend/src/lib/components/sidebar/ItemActionsMenu.svelte:117-121: After creating a remote workspace and saving this machine as default, an agent available only remotely becomes disabled in the item's row menu. Eligibility uses the default and server-reported workspace rather than the remembered remote workspace where execution would succeed. This affects users making that default change.

    Fix: Use each item's effective workspace to determine menu eligibility and execution targets, checking locally installed agents only for items that will run on this machine. Where: frontend/src/lib/components/sidebar/ItemActionsMenu.svelte

  • frontend/src/lib/stores/bulk-quick-action.ts:132-138: If a remote workspace is deleted on its machine while you view another item, a bulk quick action recreates it successfully, but returning opens the deleted workspace. Publication skips remote replacements, leaving shared and pane-specific references stale. This affects that deletion-and-recreation sequence.

    Fix: Publish the replacement workspace through the shared creation flow and update the pane's remembered link so both lookups select the replacement on its owning machine. Where: frontend/src/lib/stores/bulk-quick-action.ts, workspace-host.svelte.ts


Reviewers: 3x codex, codex (security), codex (test-value) | Synthesis: codex, 5m24s | Total: 15m27s

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants