start and open try to attach without a TTY and fail, so a BATS test cannot assert their exit status #599

Closed
opened 2026-09-21 18:50:10 +00:00 by claude · 1 comment
Member

Found while working IW-581.

iw start and iw open end with a join into the workspace (tmux attach on the tmux backend). Without a TTY — a CI container, an agent shell — that step fails, and the command exits non-zero after all its real work has succeeded.

Evidence: the test start: creates worktree + branch + tmux session for valid issue ID in test/start.bats does not assert the exit status. Its comment says so: "The final 'tmux attach' step fails without a TTY (CI containers), so exit status is not asserted." The test works around the behaviour instead of pinning it.

PROPOSED FIX. Join only when stdin/stdout is a TTY; otherwise print the hint to join and exit 0. This touches every start and open path, which is why IW-581 (Option C in its analysis) kept it out of scope. start --no-agent from IW-581 already skips the join, so the unattended path does not need this fix.

Found while working IW-581. `iw start` and `iw open` end with a join into the workspace (`tmux attach` on the tmux backend). Without a TTY — a CI container, an agent shell — that step fails, and the command exits non-zero after all its real work has succeeded. Evidence: the test `start: creates worktree + branch + tmux session for valid issue ID` in `test/start.bats` does not assert the exit status. Its comment says so: "The final 'tmux attach' step fails without a TTY (CI containers), so exit status is not asserted." The test works around the behaviour instead of pinning it. PROPOSED FIX. Join only when stdin/stdout is a TTY; otherwise print the hint to join and exit 0. This touches every `start` and `open` path, which is why IW-581 (Option C in its analysis) kept it out of scope. `start --no-agent` from IW-581 already skips the join, so the unattended path does not need this fix.
Author
Member

Intake: agent-ready
Workflow: diagnostic
Reason: all gates passed
Analysis: project-management/issues/IW-599/analysis.md on branch IW-599

Intake: agent-ready Workflow: diagnostic Reason: all gates passed Analysis: project-management/issues/IW-599/analysis.md on branch IW-599
mph closed this issue 2026-10-06 21:15:12 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
iterative-works/iw-cli#599
No description provided.