diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-08 22:19:34 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-08 22:20:04 +0300 |
| commit | 793f127e54dd5f2cfb78922470b7efcb74a1fa5e (patch) | |
| tree | df9a925c7d4dc4be64ffd77cf5dfe3e5abb273a0 /tests/cross_area.rs | |
| parent | bb0dad86f81768c8b7d5894acf7cd53bd05d302b (diff) | |
feat(remote): add network-efficient thin client transport
Add SSH stdio remote attach, negotiate terminal-ANSI render encoding, move blit encoding server-side for remote clients, and split control/render writer delivery for safer backpressure.
Fixes #76
Diffstat (limited to 'tests/cross_area.rs')
| -rw-r--r-- | tests/cross_area.rs | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/tests/cross_area.rs b/tests/cross_area.rs index 0740a7dd..db7f5b1f 100644 --- a/tests/cross_area.rs +++ b/tests/cross_area.rs @@ -416,6 +416,7 @@ fn client_handshake(stream: &mut UnixStream, version: u32, cols: u16, rows: u16) payload.extend_from_slice(&encode_varint_u32(version)); payload.extend_from_slice(&encode_varint_u16(cols)); payload.extend_from_slice(&encode_varint_u16(rows)); + payload.extend_from_slice(&encode_varint_u32(0)); // RenderEncoding::SemanticFrame stream .write_all(&frame_message(&payload)) @@ -443,6 +444,10 @@ fn client_handshake(stream: &mut UnixStream, version: u32, cols: u16, rows: u16) decode_varint_u32(&welcome_payload, offset).expect("decode version"); offset += consumed; + let (_encoding, consumed) = + decode_varint_u32(&welcome_payload, offset).expect("decode render encoding"); + offset += consumed; + let option_tag = *welcome_payload .get(offset) .expect("welcome payload should contain Option tag"); @@ -669,7 +674,7 @@ fn cross_area_detach_and_reattach_preserves_state() { // Local attach (client A). let mut client_a = UnixStream::connect(&client_socket).expect("client A should connect"); - client_handshake(&mut client_a, 3, 100, 30); + client_handshake(&mut client_a, 4, 100, 30); assert!(wait_for_frame(&mut client_a, Duration::from_secs(2))); // Use herdr: create a workspace and write output into its pane. @@ -706,7 +711,7 @@ fn cross_area_detach_and_reattach_preserves_state() { // Reattach from another terminal/session (client B). let mut client_b = UnixStream::connect(&client_socket).expect("client B should connect"); - client_handshake(&mut client_b, 3, 80, 24); + client_handshake(&mut client_b, 4, 80, 24); assert!( wait_for_frame(&mut client_b, Duration::from_secs(5)), "reattached client should receive frame" @@ -762,7 +767,7 @@ fn cross_area_agent_process_survives_detach_and_reattach() { wait_for_socket(&client_socket, Duration::from_secs(10)); let mut client_a = UnixStream::connect(&client_socket).expect("client A should connect"); - client_handshake(&mut client_a, 3, 100, 30); + client_handshake(&mut client_a, 4, 100, 30); assert!(wait_for_frame(&mut client_a, Duration::from_secs(2))); let created = workspace_create(&api_socket, "agent-persist"); @@ -815,7 +820,7 @@ fn cross_area_agent_process_survives_detach_and_reattach() { // Reattach and ensure client-side state reflects the persisted working status. let mut client_b = UnixStream::connect(&client_socket).expect("client B should connect"); - client_handshake(&mut client_b, 3, 80, 24); + client_handshake(&mut client_b, 4, 80, 24); let saw_working_on_client = wait_for_frame_matching(&mut client_b, Duration::from_secs(5), |frame| { frame_contains_text(frame, "working") @@ -860,7 +865,7 @@ fn cross_area_client_and_api_workspace_views_are_consistent() { wait_for_socket(&client_socket, Duration::from_secs(10)); let mut client = UnixStream::connect(&client_socket).expect("client should connect"); - client_handshake(&mut client, 3, 100, 30); + client_handshake(&mut client, 4, 100, 30); assert!(wait_for_frame(&mut client, Duration::from_secs(2))); drain_server_messages(&mut client, Duration::from_millis(300)); @@ -923,9 +928,9 @@ fn cross_area_two_clients_shared_view_and_single_detach_stability() { wait_for_socket(&client_socket, Duration::from_secs(10)); let mut client_a = UnixStream::connect(&client_socket).expect("client A should connect"); - client_handshake(&mut client_a, 3, 110, 30); + client_handshake(&mut client_a, 4, 110, 30); let mut client_b = UnixStream::connect(&client_socket).expect("client B should connect"); - client_handshake(&mut client_b, 3, 100, 30); + client_handshake(&mut client_b, 4, 100, 30); assert!(wait_for_frame(&mut client_a, Duration::from_secs(2))); assert!(wait_for_frame(&mut client_b, Duration::from_secs(2))); @@ -1091,7 +1096,7 @@ fn cross_area_server_kill_then_restart_and_reconnect() { let mut reconnect_client = UnixStream::connect(&client_socket).expect("new client should connect after restart"); - client_handshake(&mut reconnect_client, 3, 80, 24); + client_handshake(&mut reconnect_client, 4, 80, 24); assert!( wait_for_frame(&mut reconnect_client, Duration::from_secs(5)), "new client should receive frame after restart" |
