Skip to content

feat: support control command#3

Merged
fengys1996 merged 7 commits into
mainfrom
feat/support-control
Jul 5, 2026
Merged

feat: support control command#3
fengys1996 merged 7 commits into
mainfrom
feat/support-control

Conversation

@fengys1996

@fengys1996 fengys1996 commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

Add a control message channel to the rad TCP protocol. LSP frames use RadMessage::Lsp as before; out-of-band control messages use RadMessage::Control. The entire pipeline is also lifted from raw Vec<u8> to typed LspFrame/RadMessage structs.

Key changes

  • Rad wire format — New RadFrameCocdec (encode + decode). 5-byte header (1 byte kind + 4 bytes body len), JSON body. Supports Lsp and Control message kinds.
  • rad status command — Client sends StatusRequest, server responds with each instance's workspace, pid, clients, idle time, and health, printed in a human-readable format.
  • Instance status snapshotInstanceManager::status() iterates all managed instances to collect runtime state.
  • Typed pipeline — Channels upgraded from Vec<u8> to LspFrame (LSP layer) and RadMessage (protocol layer). RoutedPacket, ClientHandle, and related types use structured types, eliminating scattered serialization calls.
  • LspSender wrapper — Replaces the to_client channel and forward_lsp_to_writer intermediate task. The instance layer only depends on send(LspFrame), completely unaware of RadMessage.
  • Client framed I/O — Client-side stdin/server reads and writes migrated from raw read/write_all to FramedRead/FramedWrite.

@fengys1996 fengys1996 marked this pull request as ready for review July 5, 2026 07:03
@fengys1996 fengys1996 merged commit 4a7398e into main Jul 5, 2026
3 checks passed
@fengys1996 fengys1996 deleted the feat/support-control branch July 5, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant