fix(cli): say what a 404 could not find, and which runner - #1619
Conversation
Exit 4 means the platform could not be reached, which reads as "retry". A 404 fell through to the default code, so a caller could not tell a missing runner or run from a flow failure without parsing the message.
Every 404 read as an environment problem, whatever the request had named. A runner route now says the runner is not running and how to launch one, a run lookup says there is no such run on this team and that ids from qawolf runner run are the runner's own, and only a request that really is scoped to an environment still points at --env. The server's own reason is preferred over anything invented here, so a platform that names the missing runner speaks for itself; the CLI's wording stands alone against the bare "Not found" older servers answer.
Commands pick a runner from --runner, then QAWOLF_RUNNER_ID, then the directory's stored default, and none of that reached the failure. Whoever read a transcript of a session driving a terminated runner could not tell which runner was meant or why that id was chosen. The failure now names the id and which of the three chose it, and exits not-found rather than network, so a caller stops instead of retrying an id no amount of waiting brings back.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Essentials Run ID: 📒 Files selected for processing (14)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. WalkthroughThe CLI now classifies HTTP 404 responses by resource and returns exit code Priority: ⬇️ Low Estimated code review effort: 4 (Complex) | ~45 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The updated CLI and SDK diagnostics provide resource-specific 404 guidance without an identified compatibility or runtime regression. The change is ready to merge. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
A run that is still being created answers 404 and clears by waiting. The CLI printed "QA Wolf has no run X on this team" over the top of the server saying so, and the exit-code doc promised the status never clears. The platform's sentence is now the message whenever it has one, and the CLI's guess is dropped rather than argued with. What to do next is kept either way, so a missing runner still carries its launch command.
SdkResult held only the headline, so the half a caller acts on — why a runner is gone, which of the flag, the variable or the stored default named it, the command that brings one back — was built and then dropped.
Every HTTP 404 from the QA Wolf API came back as "could not find X for that environment. Check the --env value" — even when the request had nothing to do with an environment. The two common causes are a runner that is no longer running and a run id from
qawolf runner runpassed toqawolf run get. A customer team spent time chasing an environment because of the wording.Relates to WIZ-12140. Builds on WIZ-12139, which makes the platform name the missing runner in its response; this change prefers that reason when it arrives and stands on its own wording when it does not.
Overview of Changes
A 404 now answers with what the request named. A runner-targeting command says the runner is not running, names it, and gives the launch command.
qawolf run getsays there is no such run on this team, and that ids printed byqawolf runner runbelong to that runner — read them withqawolf runner events run-status. Only a request genuinely scoped to an environment still points at--env.Runner failures also say which of
--runner,QAWOLF_RUNNER_IDor this directory's stored default chose the id. None of that reached the error before, so a reader of an agent transcript could not tell which runner was meant or why.These failures exit
8instead of4. Exit4reads as "retry", and a terminated runner never comes back, so callers burned their retry budget on an id that could not work. The exit-code doc and the agent skill reference are updated to match.Testing
bun run typecheck bun run lint bun run format:check bun run knip bun run test bun run buildNew unit tests cover each routed 404, including the case where the server still answers a bare "Not found", and the runner-id source on each of the four ways a runner is chosen.
Checklist
A caller branching on exit
4for a missing runner now sees8. That is the point of the change, and the published exit-code contract is updated with it.🤖 Generated with Claude Code