Rebased onto latest origin/main. Resolved conflicts in: - use-session-actions.test.tsx: kept both HEAD's image-attachment test and PR's turn-clock restoration test (orthogonal features) - use-session-actions/index.ts, gateway-event.ts, server.py, test_tui_gateway_server.py, test_protocol.py: adapted to HEAD's refactored structure while preserving PR's turn-origin tracking