Skip to content

P0: CLI commands resolve via PROGRAMA_WORKSPACE_ID, not focused workspace #133

Description

@arzafran

From TODO.md (Refactoring, P0).

CLI commands currently resolve against the focused workspace. An agent running in a background workspace ends up sending keys or splits into whatever the user is looking at. Commands should resolve against the PROGRAMA_WORKSPACE_ID env var from the calling environment instead.

Affected: send, send-key, send-panel, send-key-panel, new-split, new-pane, new-surface, close-surface, list-panes, list-pane-surfaces, list-panels, focus-pane, focus-panel, surface-health.

Acceptance:

  • with PROGRAMA_WORKSPACE_ID set, all listed commands target that workspace regardless of focus
  • without it, current behavior is preserved
  • socket focus policy holds: none of these steal app focus
  • v2 tests cover both paths

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions