Skip to content

Mirror SWARM panel run read-only over the remote protocol - #382

Merged
neich merged 1 commit into
mainfrom
feat/add-swarm-protocol
Nov 16, 2026
Merged

neich merged 1 commit into
mainfrom
feat/add-swarm-protocol

Conversation

@neich

@neich neich commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Summary

Adds protocol 1.10 with a swarm_activity capability and a request_swarm client frame. A remote client can now read what the desktop SWARM panel (Alt+w) shows: the run header, one row per agent, and one agent's output. The view is read-only; the phone cannot start or stop a run.

Changes

  • Protocol (gaviero-remote)
    • Bump PROTOCOL_VERSION to 1.10.
    • Add the swarm_activity capability.
    • Add ClientFrame::RequestSwarm(RequestSwarm { agent_id?, output_token? }).
    • Update protocol.schema.json, add the request_swarm.json client fixture, and document the frame in PROTOCOL.md (new "Swarm activity" section).
    • Bump the fixture count in tests/protocol.rs from 20 to 21.
  • TUI sidecar (gaviero-tui)
    • app/remote.rs: add swarm_snapshot, which builds the run header, agent list, selected agent and output. It also adds output_tail, which caps output at the newest 64 KiB and cuts the oldest kept line on a char boundary.
    • The phone's agent_id choice never moves the desktop selection. An unknown or absent id falls back to the desktop's selected agent.
    • output.token is <run_id>:<revision>. If the request echoes it, the reply carries unchanged: true and no lines.
    • remote_setup.rs: advertise swarm_activity in hello.capabilities.
    • panels/swarm_dashboard.rs: make AgentEntry::elapsed public and add AgentEntry::revision().
    • CLAUDE.md: replace "Remote does not mirror the panel" with a description of the new read-only mirror.
  • Tests
    • swarm_request_mirrors_the_run_without_moving_the_desktop_selection covers: no run, header and agents, the unchanged token, per-agent selection, fallback for a missing agent, and a failed run.
    • swarm_output_tail_keeps_the_newest_bytes covers the byte budget and the char-boundary cut.

Testing

  • git diff --check origin/main...HEAD
  • cargo test (skipped: not run unless --run-tests is set)

The two new unit tests and the updated fixture round-trip test are in the diff but were not run for this PR.

Risks / Notes

  • Additive, minor-version change. Older servers receive no swarm requests, and clients ignore unknown capabilities.
  • protocol.schema.json is a generated schema file, and the diff to it looks hand-synced with the Rust types. It should be regenerated and checked against the source if there is any doubt.
  • Tests were skipped, so none of the new behavior has been verified by a test run.
  • Output is polled by the client, about once a second while its Swarm section is open. Each reply sends the full header and agent list, and only the output is deduplicated by token.

🤖 Generated with Claude Code

Adds protocol 1.10 with the swarm_activity capability and a
request_swarm command. The desktop answers it with the run header, agent
rows and a tail of one agent's output, using a token so unchanged output
is not resent. The phone's agent choice never moves the desktop
selection, and the phone cannot start or stop a run.
@neich
neich merged commit 71d23d0 into main Nov 16, 2026
@neich
neich deleted the feat/add-swarm-protocol branch November 16, 2026 17:51
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