Add Pi bridge integration#363
Merged
mmprotest merged 7 commits intoMay 29, 2026
Merged
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.
Motivation
Description
villani_code/integrations/pi_bridge_protocol.pyimplementingready,ping,run, andabortsemantics.PiBridge) invillani_code/integrations/pi_bridge.pythat emits flushed JSONL events, spawns the existingRunnervia_build_runner, maps internal runner events to normalized bridge events, detects changed files viagit status, and propagates transcript path/verification results.bridge --stdioinvillani_code/cli.pythat runs the stdio bridge so it can be launched aspython -m villani_code.cli bridge --stdio(or via an executable).integrations/pi-villani/(TypeScript) which registers a/villanicommand, launches the bridge subprocess usingVILLANI_COMMAND, waits forready, sends aruncommand, streams & renders normalized bridge events, supports aborts, and produces a final summary; protocol/types and a small process wrapper live insrc/protocol.tsandsrc/process.ts.tests/integrations/test_pi_bridge.pycoveringping/pong, malformed JSON handling, unknown commands, mocked run success/failure, abort behavior, and event filtering; add documentation and a short design note for future Pi-backed model-proxy work (integrations/pi-villani/README.mdanddocs/pi-model-bridge.md).Testing
ruff check villani_code/integrations tests/integrations/test_pi_bridge.py villani_code/cli.pyand it passed.pytest -q tests/integrations/test_pi_bridge.py tests/test_packaging_surface.py tests/test_cli_headless_optional_tui.pyand all tests passed (19 passed, 1 skipped in the broader run; bridge tests: 7 passed).cd integrations/pi-villani && npm install && npm run buildand the TypeScript build succeeded.printf '{"type":"ping","id":"smoke"}\n' | python -m villani_code.cli bridge --stdioproduced the expectedreadyandpongJSON lines.Codex Task