fix: close-workspace error names accepted formats; verify #133 env routing - #147
Merged
Merged
Conversation
close-workspace and select-workspace with no --workspace now fail with an error that names the expected formats (UUID or short ref like workspace:2) and states that implicit current-workspace targeting is refused. The require-an-explicit-target behavior itself already existed at both the CLI pre-flight and server layers; only the message was generic. Also: - regression test: bare close-workspace exits non-zero, names the formats, and closes nothing (tests_v2/test_workspace_relative.py) - the same test file's CLI runner is now hermetic: it strips the instance-scoped PROGRAMA_*_ID vars inherited when running inside a Programa terminal, which otherwise point commands at the wrong app instance (PROGRAMA_SURFACE_ID broke the send test) - TODO.md: tick #133 and #134. #133 was verified already implemented on main (all 13 commands read PROGRAMA_WORKSPACE_ID CLI-side and pass an explicit workspace_id; covered by this same test file)
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.
What this does
Closes out the last two Phase 1 CLI P0s. An agent (or a fat-fingered script) running
programa close-workspacewith no target now gets a clear error telling it exactly what to pass, instead of a terse one-liner. And #133 turned out to be already shipped: every affected command already resolves againstPROGRAMA_WORKSPACE_ID, so background agents don't touch the workspace you're looking at — this PR adds the missing verification and closes the paperwork.Closes #133. Closes #134.
Summary
close-workspace/select-workspacewithout--workspacenow fail (still non-zero, still before the socket opens) with:--workspace <id|ref> is required (UUID or short ref like workspace:2). Refusing to target the current workspace implicitly.The require-explicit-target behavior already existed at both the CLI pre-flight and server layers; only the message was generic.PROGRAMA_WORKSPACE_IDCLI-side and pass explicitworkspace_id; the server only falls back to the focused workspace when no id is supplied) and live against a tagged build (new-splitwith the env var set targeted a background workspace while selection stayed put). Existing coverage:tests_v2/test_workspace_relative.py.close-workspaceexits non-zero, names the accepted formats, closes nothing.test_workspace_relative.py's CLI runner now strips the instance-scopedPROGRAMA_*_IDenv vars that shell integration exports inside a Programa terminal. InheritedPROGRAMA_SURFACE_IDfrom the outer instance was overriding the workspace target and breaking thesendtest when the suite ran from inside Programa.Out of scope, noted for the record: the Go remote CLI (
programad-remote) does not readPROGRAMA_WORKSPACE_ID; and a foreign surface UUID inPROGRAMA_SURFACE_IDresolves to "Surface is not a terminal" rather than not_found (filed separately).Test Plan
tests_v2/test_workspace_relative.pyfully green (8/8, including the new test) against a tagged debug build