Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
architecture.md §5.3 says an agent shouldn't have to go through webrtc — it doesn't want a 30fps h264 track to decode, it wants a frame every second or two and a state blob. and remote-webrtc.md §12 has the websocket surface on the deferred list as "a few dozen lines once §5's routing exists".
§5's routing exists now, so here it is. it's at /agent on the port the console is already served from.
turned out to be smaller than i expected because session::run already takes a pair of String channels and doesn't know what carries them. so the whole transport is pumping text frames into one and out of the other, and everything else is the code that was already there.
the part i think matters: it's the same api, not a second one. a line arriving on the socket goes through session::run against the same route table the datachannel uses, so what an agent can call is what a console peer can call, decided in one place. you can't add a method to one transport and not the other.
one thing that fell out: route::refusal said "not available over WebRTC", which is now wrong for half the callers. it says "over this transport" instead.
test opens a real websocket against the real router, checks hello comes back, checks a permitted call reaches robotd and a refused one is refused.
cargo test --workspace, clippy with -D warnings and fmt are green on linux. mediad is linux-only so a mac skips it.