fix(e2e): drive the new device-pairing join flow in respond.spec - #662
Merged
Conversation
The keyed matrix has reported connect 0/6 since the workspace join model
changed. Four of the handles respond.spec drives no longer exist:
- `#agent-type` — the Agent type picker is a Radix Select now, with the
value in React state rather than in the DOM.
- `ws-join-toggle` / `#workspace-url-or-token` / `ws-join` — the whole
per-agent token form is gone.
`ws-join-toggle` was also the spec's "configure succeeded" signal, so
fixing only the type picker would have moved the failure a few lines
without unblocking a single cell.
Joining is device-level: `connectWorkspace` refuses a workspace this
device holds no pairing for, and the agent's Connect dialog offers only
the ones it does. Every test gets a fresh HOME, so nothing is ever
paired and the dialog can only ever show its empty state — the spec was
missing an entire step, not a selector.
So the spec now joins the workspace on the device first, through the
Workspaces page a user would use, and binds the agent by picking that
workspace. The pairing code is minted at run time from the workspace
token the reply assertion already needs (a machine credential is trusted
by POST /v1/workspaces/{slug}/pairing-codes), so no human has to stage a
short-lived single-use code per run, and it is minted after install so
it cannot expire waiting for one.
Product side is five data-testid attributes and nothing else: the Agent
type trigger and its options, the Connect dialog shell (so "never
opened" and "opened with nothing to offer" stay separate failures), each
workspace option, its empty state, and the pairing dialog's submit
button. No behaviour, styling or i18n changes, so no version bump.
The `// 2.` and `// 6.` markers the orchestrator reads to split the
report into install / connect / respond keep their meaning: pairing sits
inside the connect phase, where a failure belongs.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The keyed GUI matrix has reported
connect 0/6since the workspace join model changed. Four of the handlesrespond.spec.tsdrives no longer exist in the product:#agent-type<Select>now — the value lives in React state, not the DOMws-join-toggle#workspace-url-or-tokenws-joinws-join-togglewas also the spec's "configure succeeded" signal, so fixing only the type picker would have moved the failure a few lines without unblocking a single cell.The root cause is bigger than stale selectors. Joining is device-level now:
connectWorkspacerefuses a workspace this device holds no pairing for, and the agent's Connect dialog offers only the ones it does — it has no token form of its own. Every test gets a fresh isolatedHOME, so nothing is ever paired and the dialog can only ever render its empty state. The spec was missing an entire step.What changed
Product — five
data-testidattributes, nothing else. No behaviour, styling or i18n change, so no version bump.agent-typeon the Agent type trigger,agent-type-option-<slug>on each option. Picking by slug matters: leaving the default selected would build every agent as the first installed type.connect-wson the Connect dialog shell, so "never opened" and "opened with nothing to offer" stay separate failures in the report.ws-option-<slug>on each workspace option (it only haddata-active),ws-none-pairedon the empty state.ws-pair-submiton the pairing dialog's confirm button. The code field already had a stable#quick-connect-code.e2e
workspace.tsgainscreatePairingCode()—POST /v1/workspaces/{slug}/pairing-codes, reusing the existing headers. Codes are short-lived and single-use, so a run mints its own rather than carrying one in a secret; a workspace or node token is a trusted machine credential at that endpoint, so the token the reply assertion already needs is enough. It is minted after install, so it cannot expire waiting for one.getNodeStatus()(i.e.node.json) rather than against the card the page draws, so a rendering hiccup cannot read as a failed pairing.ws-join-toggletoconnect-ws.Report dimensions are unaffected. The
// 2.and// 6.markers the orchestrator reads to split install / connect / respond keep their meaning — pairing sits inside the connect phase, where a failure belongs.Testing
npm run typecheck— cleannpx vitest run— 48 files, 476 tests, all passingNotes for the reviewer
pointer-events: noneduring the open animation. If the self-hosted Windows box flakes onagent-type-option-*, wrapping that click in atoPassis the fix; it could not be reproduced locally.workspaceEndpoint, while the assertions useWORKSPACE_API_BASE_URL. They default to the same host, and a mismatch surfaces plainly as "Invalid pairing code", so no extra machinery was added — but it is worth knowing.e2e/agents.ts's model table andrespond.spec.ts'sCREDScarry two sets of values that disagree. The former is only a fallback forspec?.model, but it reads as authoritative.🤖 Generated with Claude Code