feat(leg): add leg exchange command for baton external-agent integration - #10
Merged
Merged
Conversation
Implements a dual-mode baton.message/v1 round-trip: envelope mode (full JSON in/out) for direct baton exchange piping, and plain-text mode for baton serve --agent-cmd <leg> --agent-arg exchange, matching baton's default raw output adapter with no flags needed on either side. Plain-text provider failures leave stdout empty and exit 0, which is what makes baton's ExternalAgentParticipant synthesize its own kind:"error" envelope — execute_exchange stays infallible per the issue's "never Err" contract. Closes #4
…rrently Addresses review-exchange-impl-v1: exercises the actual --in/--out file plumbing end-to-end (AC1 was only covered in-memory before), and moves stdout/stderr draining onto their own threads so it runs while the child is alive instead of after wait(), avoiding a pipe-buffer deadlock risk on a child that blocks writing before exiting.
Windows/ureq aborts the connection with os error 10053 when the mock server closes right after seeing the header terminator, before the client has finished writing its request body. Parse Content-Length from the mocked request headers and drain exactly that many body bytes first, matching how a real HTTP server behaves. Fixes the windows-latest CI lane failure on run 33951153667.
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.
Closes #4