Skip to content

fix: expose tmux_session in JSON API output#459

Open
johnuopini wants to merge 1 commit intoasheshgoplani:mainfrom
johnuopini:feat/455-tmux-session-json
Open

fix: expose tmux_session in JSON API output#459
johnuopini wants to merge 1 commit intoasheshgoplani:mainfrom
johnuopini:feat/455-tmux-session-json

Conversation

@johnuopini
Copy link
Copy Markdown
Contributor

Summary

  • Add tmux_session field to list --json output struct
  • Remove inst.Exists() gate from session show --json so stopped/error sessions still report their tmux name
  • Add tmux_session field to session current --json output

Fixes #455

Test plan

  • agent-deck list --json returns tmux_session for all sessions with a persisted tmux name
  • agent-deck session show <id> --json returns tmux_session for both running and stopped sessions
  • agent-deck session current --json returns tmux_session for the current session
  • Cross-referenced JSON output against live tmux list-sessions — mapping is correct
  • Existing cmd/agent-deck tests pass

The JSON API (`list --json`, `session show --json`, `session current
--json`) returned null for the tmux_session field even when the value
was correctly stored in the SQLite database. This made it impossible
for external tools to map agent-deck sessions to tmux processes.

Root causes:
- `list --json` had no tmux_session field in its output struct
- `session show --json` gated tmux_session on inst.Exists(), omitting
  it for stopped/error sessions whose tmux process had exited
- `session current --json` had no tmux_session field at all

Now all three commands include the persisted tmux session name whenever
it is available, regardless of whether the tmux process is still alive.

Fixes asheshgoplani#455
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.

No JSON API for tmux_session

1 participant