fix: expose tmux_session in JSON API output#459
Open
johnuopini wants to merge 1 commit intoasheshgoplani:mainfrom
Open
fix: expose tmux_session in JSON API output#459johnuopini wants to merge 1 commit intoasheshgoplani:mainfrom
johnuopini wants to merge 1 commit intoasheshgoplani:mainfrom
Conversation
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
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.
Summary
tmux_sessionfield tolist --jsonoutput structinst.Exists()gate fromsession show --jsonso stopped/error sessions still report their tmux nametmux_sessionfield tosession current --jsonoutputFixes #455
Test plan
agent-deck list --jsonreturnstmux_sessionfor all sessions with a persisted tmux nameagent-deck session show <id> --jsonreturnstmux_sessionfor both running and stopped sessionsagent-deck session current --jsonreturnstmux_sessionfor the current sessiontmux list-sessions— mapping is correctcmd/agent-decktests pass