IW-687: An attached session is no longer killed after 5 minutes #760

Merged
mph merged 13 commits from IW-687 into main 2026-10-08 06:22:11 +00:00
Member

Summary

iw start and iw open attach the terminal to a tmux or herdr session. That attach ran under ProcessAdapter.DefaultTimeoutMs (5 minutes), so os-lib sent SIGTERM to the attach client at 300 s. The user dropped back to the shell and iw reported a false error. The session itself survived.

Defects fixed

  • Phase 1 (#758): Terminal attach is bounded by ProcessAdapter.DefaultTimeoutMs.
    • ProcessAdapter.NoTimeout = -1 (os-lib: wait until the child exits).
    • streamOrExplain has no default for timeoutMs, so each call site states its bound.
    • TmuxAdapter.attachSession and HerdrAdapter.attachSession pass NoTimeout. TmuxAdapter.switchSession passes DefaultTimeoutMs explicitly (switch-client returns at once).
    • docs/api/Process.md updated.

Testing

  • 2 unit tests in core/test/ProcessTest.scala. The mutation NoTimeout = 0 makes both fail.
  • Gated (IW_SLOW=1) tests: test/attach-unbounded-adapters.bats (both adapters return Right(()) after a 310 s fake attach) and test/attach-unbounded.bats (real tmux client still attached after 310 s, iw open exits 0 after detach). One local run each passed. Without IW_SLOW they skip.

Follow-ups

Four reporting defects in runStreaming / streamOrExplain are filed as #759.

Release notes

Připojení do terminálové relace přes iw start a iw open se už po pěti minutách samo nepřeruší. Platí pro tmux i herdr; připojení končí až vaším odpojením a bez chybového hlášení. See project-management/issues/IW-687/release-notes.md.

Closes #687

🤖 Generated with Claude Code

## Summary `iw start` and `iw open` attach the terminal to a tmux or herdr session. That attach ran under `ProcessAdapter.DefaultTimeoutMs` (5 minutes), so os-lib sent SIGTERM to the attach client at 300 s. The user dropped back to the shell and `iw` reported a false error. The session itself survived. ## Defects fixed - **Phase 1 (#758): Terminal attach is bounded by `ProcessAdapter.DefaultTimeoutMs`.** - `ProcessAdapter.NoTimeout = -1` (os-lib: wait until the child exits). - `streamOrExplain` has no default for `timeoutMs`, so each call site states its bound. - `TmuxAdapter.attachSession` and `HerdrAdapter.attachSession` pass `NoTimeout`. `TmuxAdapter.switchSession` passes `DefaultTimeoutMs` explicitly (switch-client returns at once). - `docs/api/Process.md` updated. ## Testing - 2 unit tests in `core/test/ProcessTest.scala`. The mutation `NoTimeout = 0` makes both fail. - Gated (`IW_SLOW=1`) tests: `test/attach-unbounded-adapters.bats` (both adapters return `Right(())` after a 310 s fake attach) and `test/attach-unbounded.bats` (real tmux client still attached after 310 s, `iw open` exits 0 after detach). One local run each passed. Without `IW_SLOW` they skip. ## Follow-ups Four reporting defects in `runStreaming` / `streamOrExplain` are filed as #759. ## Release notes Připojení do terminálové relace přes `iw start` a `iw open` se už po pěti minutách samo nepřeruší. Platí pro tmux i herdr; připojení končí až vaším odpojením a bez chybového hlášení. See `project-management/issues/IW-687/release-notes.md`. Closes #687 🤖 Generated with [Claude Code](https://claude.com/claude-code)
An attached session is killed after 5 minutes, because attachSession runs under ProcessAdapter's default timeout

Artifacts:
- analysis.md
- issue.md

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B8ZD5foFWAE2zV1xYojPMa
An attached session is killed after 5 minutes, because attachSession runs under ProcessAdapter's default timeout

Artifacts:
- tasks.md
- review-state.json (tasks_ready)

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B8ZD5foFWAE2zV1xYojPMa
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B8ZD5foFWAE2zV1xYojPMa
Issue: IW-687
Phase: 1 - Terminal attach is bounded by ProcessAdapter.DefaultTimeoutMs

This commit marks the checkpoint for phase 1 context generation.
Use dx-fix IW-687 to return to this point.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Terminal attach is bounded by ProcessAdapter.DefaultTimeoutMs

Artifacts:
- phase-01-tasks.md

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs(IW-687): add release notes
All checks were successful
CI / changes (pull_request) Successful in 5s
CI / contract (pull_request) Has been skipped
CI / format (pull_request) Successful in 11s
CI / lint (pull_request) Successful in 12s
CI / compile (pull_request) Successful in 1m37s
CI / dashboard-build (pull_request) Successful in 1m26s
CI / test (pull_request) Successful in 18m23s
c45142e035
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mph merged commit 40cc6984dc into main 2026-10-08 06:22:11 +00:00
Sign in to join this conversation.
No description provided.