feat(runner): take --workspace-id on every runner command - #1647
Open
Luke Parr (lukecparr) wants to merge 1 commit into
Open
Luke Parr (lukecparr) wants to merge 1 commit into
Luke Parr (lukecparr) wants to merge 1 commit into
Conversation
The only way to pick a runner's workspace was `qawolf auth switch`, which saves it for every session on the machine. Two sessions working on different customers moved each other's next runner command to the wrong workspace. `--workspace-id` is declared once on the `runner` group, so every runner subcommand takes it, and it is never saved. A lint rule keeps runner commands on `withRunnerContext` so a new one can't accept the flag and ignore it.
Luke Parr (lukecparr)
marked this pull request as ready for review
October 2, 2026 19:15
Luke Parr (lukecparr)
requested review from
Goran Gajic (gorangajic) and
Atchyut Preetham Pulavarthi (theonly1me)
October 2, 2026 19:16
Atchyut Preetham Pulavarthi (theonly1me)
approved these changes
Oct 2, 2026
Goran Gajic (gorangajic)
approved these changes
Oct 2, 2026
This branch has not been deployed
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.
This came from a request I made in Slack to support QAE tooling. Jon suggested I open a PR.
Overview of Changes
Every
qawolf runnercommand now takes--workspace-id <id>. It applies to that one command and is never saved. Until now the only way to pick a workspace wasqawolf auth switch, which saves it to the one token store every session on the machine reads. QAEs are moving their tooling ontoqawolf runnerand often have several Claude sessions open on different customers, so single-session switching sends the next runner command in every other session to the wrong workspace.The API already supports this, every runner contract takes
workspaceId, and the client only fills in the saved one when a call doesn't send its own. So the change is CLI-only:withAuthContexttakes an optional workspace that wins over the saved one, andrunnercommands pass it through a smallwithRunnerContextwrapper.The flag lives on the
runnergroup rather than only onlaunch,runandterminate. Runner ids are scoped to a team, so a runner launched with--workspace-idis only reachable by commands that pass the same id. Leaving the flag offactorscreenshotwould send them looking in the saved workspace. Because the flag is on the group, a new runner sub-command gets it too, and a lint rule stops runner register files from importingwithAuthContextdirectly, which would accept the flag and quietly ignore it.A blank
--workspace-idis refused. Without that check it would send no workspace at all instead of falling back to the saved one. Without the flag nothing changes. With an org or user API key, which saves no workspace, the flag gives it one.help.test.tsused to replace each command's help config to set the width, which hidshowGlobalOptions. It now merges, so the runner snapshots show what users actually see. That's most of the snapshot diff.Testing
bun run typecheck bun run lint bun run format:check bun run knip bun run test bun run buildNew tests in
runner/context.test.tscover the flag before and after the subcommand, falling back to the saved workspace, a credential with no saved workspace, trimming, refusing a blank id, and the flag showing in every runner subcommand's help. Reverting the one-line precedence change inwithAuthContextfails 5 of them. I also checked the lint guard by adding awithAuthContextimport to a runner register file.Smoke tested against prod with a team API key, read-only:
qawolf runner list --workspace-id not-a-real-workspacecomes backHTTP 400 ... Invalid ID format for kind at "workspaceId", so the flag reaches the request. Passing the key's own team id lists the same runners as no flag. Not yet tested with a browser session across two workspaces.Checklist