Surface resolution: unknown ids are not_found; explicit workspace beats env surface id (#148) - #163
Merged
Merged
Conversation
Red half of the two-commit structure for #148: surface.send_text with a surface UUID unknown to this instance (alone, or alongside a valid workspace_id) currently mis-resolves to 'invalid_params: Surface is not a terminal'. Verified failing against a tagged build without the fix.
…ts env surface id App side: v2SurfaceSendText/SendKey/ClearHistory/ReadText now check ws.panels membership before the TerminalPanel type-cast, mirroring v2SurfaceFocus/v2SurfaceClose — an unknown UUID gets not_found instead of the misleading 'Surface is not a terminal'. CLI side: the PROGRAMA_SURFACE_ID env fallback in send, send-key, and read-screen is suppressed whenever a workspace target resolved (flag or PROGRAMA_WORKSPACE_ID env), so a stale surface id inherited from another app instance can no longer override an explicit workspace. An explicit --surface flag still always wins. Closes #148
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
programa sendwith a stale surface id from another app instance now fails with a truthfulnot_foundinstead of the misleading "Surface is not a terminal" — and when a workspace is explicitly targeted, a stale envPROGRAMA_SURFACE_IDno longer hijacks the target at all.Closes #148. Follow-up for
notify's differently-shaped copy of the bug: #162.Summary
Sources/TerminalController+Surface.swift(4 handlers split existence-check from type-check, mirroringv2SurfaceFocus/v2SurfaceClose), thenCLI/programa.swift(env surface fallback insend/send-key/read-screensuppressed when any workspace target resolved; explicit--surfacestill wins)invalid_params, green: pass); commit 3 adds the test to the newtests_v2CI subset from CI: run curated tests_v2 socket subset on PRs (#145) #161Test Plan
tests-v2-subsetjob green on this PR