todo-42-session-switch-idle-socket.md 725 B

Todo 42: Session Switch Idle Socket

Goal

Allow New and Load session actions after the current turn has completed, even when the reusable WebSocket session is still open.

Plan

  1. Add a focused static test that distinguishes active turn state from open WebSocket state.
  2. Track active turn state explicitly in the browser app.
  3. Guard session switching only during an active turn, and close any idle socket before changing sessions.

Verification

  • uv run pytest tests/test_websocket_api.py::test_static_session_switch_guard_uses_active_turn_not_open_socket -q
  • uv run pytest tests/test_websocket_api.py -q
  • uv run pytest
  • node --check src/agent_lab/presentation/static/app.js
  • git diff --check