fix(session): report daemon reachability in session list JSON - #689
fix(session): report daemon reachability in session list JSON#689YuriNachos wants to merge 1 commit into
Conversation
Co-authored-by: Claude <noreply@anthropic.com>
|
PR author is not in the allowed authors list. |
|
@YuriNachos is attempting to deploy a commit to the Modem Team on Vercel. A member of the Team first needs to authorize it. |
|
The failing Vercel check is |
|
Heads-up on the red check here: the failing I enumerated the 8 most recent open PRs and correlated the
4/4 fork PRs fail, 4/4 in-repo branches pass — no exceptions. The check's target URL is The two checks that do evaluate this code — |
Fixes #527
Summary
hunk session list --jsonnow includes adaemonobject alongsidesessionsso callers can distinguish an unreachable daemon from a healthy daemon with zero sessions — both previously printed the byte-identical{ "sessions": [] }with exit 0.{ "sessions": [], "daemon": { "available": false } }{ "sessions": [...], "daemon": { "available": true } }Text-mode
hunk session listoutput and the exit code are unchanged in both states, and existing JSON consumers that read.sessionskeep working (purely additive, non-breaking).Root cause
In
runSessionCommand, the daemon-downlistbranch returnedrenderOutput(input.output, { sessions: [] }, …)and the daemon-uplistbranch returnedrenderOutput(input.output, { sessions }, …).renderOutputserializes the value object as the JSON body, so both produced{ "sessions": … }— the reachability boolean fromresolveDaemonAvailabilitywas discarded before it reached the output, collapsing "daemon down" and "daemon up, zero sessions" into the same bytes.Changes
src/session/agent/commands.ts— passdaemon: { available }inside thevaluetorenderOutputfor thelistaction in both branches (available: falseon the down path,available: trueon the up path). No other action is affected; the return type staysstring;src/main.tsx, exit codes, and CLI flags are untouched.src/session/agent/commands.daemon.test.ts— update the real-probe stricttoEqualto the new shape{ sessions: [], daemon: { available: false } }.src/session/agent/commands.test.ts— add two hook-based regression tests (daemon-unavailable and daemon-available JSON shapes)..changeset/session-list-daemon-status.md—hunkdiff/patchchangeset.Test plan
bun run typecheckbun run lintbun run format:checkbun run test:theme-contrastbun run test(1940 pass / 0 fail, incl.src/session/agent/commands.test.tsandcommands.daemon.test.ts)bun run test:tty-smokebun run test:integration(91 pass / 6 fail — the 6 failures are pre-existing TUI/extension tests that reproduce identically on the clean basec4739efand are caused by the local worktree environment, not this change; the full unit + session suite is green)HUNK_MCP_PORT=<free-port> hunk session list --jsonnow emitsdaemon.available: falsewith text-mode and exit code unchangedwindows-compatCI job exercises these unit/session tests)Co-authored-by: Claude noreply@anthropic.com