Skip to content

feat(leg): add leg exchange command for baton external-agent integration - #10

Merged
shukebeta merged 3 commits into
mainfrom
feat/issue-4-leg-exchange
Sep 5, 2026
Merged

shukebeta merged 3 commits into
mainfrom
feat/issue-4-leg-exchange

Conversation

@shukebeta

Copy link
Copy Markdown
Contributor

Closes #4

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.
@shukebeta
shukebeta merged commit 2f114bb into main Sep 5, 2026
6 checks passed
@shukebeta
shukebeta deleted the feat/issue-4-leg-exchange branch September 5, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(leg): leg exchange — one baton.message/v1 round-trip with nested baton.exchange/v1

1 participant