Skip to content

fix: notify/new-split/close-surface must ignore stale PROGRAMA_SURFACE_ID when a workspace target resolves - #171

Merged
arzafran merged 2 commits into
mainfrom
fix/162-notify-env-precedence
Jul 21, 2026
Merged

fix: notify/new-split/close-surface must ignore stale PROGRAMA_SURFACE_ID when a workspace target resolves#171
arzafran merged 2 commits into
mainfrom
fix/162-notify-env-precedence

Conversation

@arzafran

Copy link
Copy Markdown
Member

What this does

With PROGRAMA_SURFACE_ID inherited from another app instance's shell, programa notify (and new-split / close-surface) targeting an explicit PROGRAMA_WORKSPACE_ID could still resolve against the stale surface id. Now the env surface fallback is suppressed whenever a workspace target resolves (flag or env), matching the #148 fix for send/send-key/read-screen.

Commits

  1. Regression test only (tests_v2/test_close_surface_env_precedence.py) — fails without the fix
  2. The fix — three one-line guard changes in CLI/programa.swift

Test plan

  • Debug build compiles
  • tests_v2 subset on CI (runs on main post-merge per landing plan)

Fixes #162

arzafran added 2 commits July 21, 2026 16:36
…ACE_ID once a workspace target resolves via env

Same precedence bug #148 fixed for send/send-key/read-screen: the
PROGRAMA_SURFACE_ID env fallback needs to check whether a workspace
target already resolved (explicit --workspace flag OR PROGRAMA_WORKSPACE_ID
env), not just the explicit-flag-only variable. notify's structure
(preferTTYFallback/explicitWorkspaceArg branching) didn't check
workspaceArg at all; new-split and close-surface checked wsArg/csWsFlag
(explicit flag only) instead of workspaceArg (flag or env), so an
env-only workspace target still let a stale surface id through.

Closes #162
@arzafran
arzafran merged commit 18c8fb4 into main Jul 21, 2026
3 checks passed
@arzafran
arzafran deleted the fix/162-notify-env-precedence branch July 21, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

notify: env PROGRAMA_SURFACE_ID still overrides explicit PROGRAMA_WORKSPACE_ID

1 participant