Repository navigation
Generate and verify seven cmux-tui SDKs - #8991
Conversation
|
Too many files changed for review (591 files, 100 file limit). |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe change adds pre-receive-wait hooks, separates Java read and write selectors, replaces timing-based waits with deadline-aware selection, and updates lifecycle tests across C++, Java, Python, and TypeScript to use deterministic synchronization. ChangesReceive synchronization
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant CmuxStream
participant JsonLineConnection
participant readSelector
participant Socket
CmuxStream->>JsonLineConnection: receive(deadline, beforeWait)
JsonLineConnection->>JsonLineConnection: invoke beforeWait
JsonLineConnection->>readSelector: select(deadline)
readSelector->>Socket: wait for readable data
Socket-->>readSelector: readable data
readSelector-->>JsonLineConnection: readiness
JsonLineConnection-->>CmuxStream: decoded event
🚥 Pre-merge checks | ✅ 24 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (24 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This PR has 56,219 reviewable changed lines after ignored/generated files are excluded, above cubic's default 50,000-changed-line automatic review limit. The raw diff is 118,899 lines before ignored/generated files are excluded. Most of the diff comes from:
Comment |
This comment has been minimized.
This comment has been minimized.
# Conflicts: # .github/workflows/cmux-tui-sdks.yml # .github/workflows/cmux-tui-spec.yml # .github/workflows/sdk-publish-crates.yml # .github/workflows/sdk-publish-go.yml # .github/workflows/sdk-publish-java.yml # .github/workflows/sdk-publish-npm.yml # .github/workflows/sdk-publish-python.yml # cmux-tui/Cargo.lock # cmux-tui/bindings/ERGONOMICS.md # cmux-tui/bindings/RELEASING.md # cmux-tui/bindings/check-versions.py # cmux-tui/bindings/codegen/emit_cpp.py # cmux-tui/bindings/codegen/emit_go.py # cmux-tui/bindings/codegen/emit_java.py # cmux-tui/bindings/codegen/emit_python.py # cmux-tui/bindings/codegen/emit_typescript.py # cmux-tui/bindings/codegen/emit_zig.py # cmux-tui/bindings/codegen/tests/test_emit_cpp.py # cmux-tui/bindings/codegen/tests/test_emit_go.py # cmux-tui/bindings/codegen/tests/test_generate.py # cmux-tui/bindings/codegen/tests/test_ir.py # cmux-tui/bindings/conformance/README.md # cmux-tui/bindings/conformance/adapter-protocol.md # cmux-tui/bindings/conformance/adapters/cpp/CMakeLists.txt # cmux-tui/bindings/conformance/adapters/cpp/main.cpp # cmux-tui/bindings/conformance/adapters/go/main.go # cmux-tui/bindings/conformance/adapters/java/build.sh # cmux-tui/bindings/conformance/adapters/python/adapter.py # cmux-tui/bindings/conformance/adapters/rust/Cargo.lock # cmux-tui/bindings/conformance/adapters/rust/Cargo.toml # cmux-tui/bindings/conformance/adapters/rust/src/main.rs # cmux-tui/bindings/conformance/adapters/typescript/adapter.mjs # cmux-tui/bindings/conformance/adapters/zig/build.zig # cmux-tui/bindings/conformance/adapters/zig/main.zig # cmux-tui/bindings/conformance/fixtures.json # cmux-tui/bindings/conformance/runner.py # cmux-tui/bindings/conformance/test_runner.py # cmux-tui/bindings/cpp/.cmux-sdk-manifest.json # cmux-tui/bindings/cpp/CMakeLists.txt # cmux-tui/bindings/cpp/README.md # cmux-tui/bindings/cpp/include/cmux/client.hpp # cmux-tui/bindings/cpp/include/cmux/result.hpp # cmux-tui/bindings/cpp/include/cmux/transport.hpp # cmux-tui/bindings/cpp/include/cmux/version.hpp # cmux-tui/bindings/cpp/src/json.cpp # cmux-tui/bindings/cpp/src/unix_transport.cpp # cmux-tui/bindings/cpp/tests/consumer/CMakeLists.txt # cmux-tui/bindings/cpp/tests/consumer/main.cpp # cmux-tui/bindings/cpp/tests/test_attachment.cpp # cmux-tui/bindings/cpp/tests/test_client.cpp # cmux-tui/bindings/cpp/tests/test_generated.cpp # cmux-tui/bindings/cpp/tests/test_macro_collision.cpp # cmux-tui/bindings/cpp/tests/test_unix_transport.cpp # cmux-tui/bindings/examples/cpp-terminal-frontend/CMakeLists.txt # cmux-tui/bindings/examples/cpp-terminal-frontend/FRICTION.md # cmux-tui/bindings/examples/cpp-terminal-frontend/README.md # cmux-tui/bindings/examples/cpp-terminal-frontend/include/cmux_example/frontend.hpp # cmux-tui/bindings/examples/cpp-terminal-frontend/src/frontend.cpp # cmux-tui/bindings/examples/cpp-terminal-frontend/src/main.cpp # cmux-tui/bindings/examples/cpp-terminal-frontend/tests/frontend_test.cpp # cmux-tui/bindings/examples/go-terminal-bot/FRICTION.md # cmux-tui/bindings/examples/go-terminal-bot/README.md # cmux-tui/bindings/examples/go-terminal-bot/bot.go # cmux-tui/bindings/examples/go-terminal-bot/bot_integration_test.go # cmux-tui/bindings/examples/go-terminal-bot/cmd/go-terminal-bot/main.go # cmux-tui/bindings/examples/go-terminal-bot/config.go # cmux-tui/bindings/examples/go-terminal-bot/fake_server_test.go # cmux-tui/bindings/examples/go-terminal-bot/result.go # cmux-tui/bindings/examples/java-ci-orchestrator/FRICTION.md # cmux-tui/bindings/examples/java-ci-orchestrator/README.md # cmux-tui/bindings/examples/java-ci-orchestrator/src/com/cmux/examples/ci/CiOrchestrator.java # cmux-tui/bindings/examples/java-ci-orchestrator/tests/com/cmux/examples/ci/CiOrchestratorIntegrationTest.java # cmux-tui/bindings/examples/java-ci-orchestrator/tests/com/cmux/examples/ci/FakeCmuxServer.java # cmux-tui/bindings/examples/python-agent-watchdog/FRICTION.md # cmux-tui/bindings/examples/python-agent-watchdog/README.md # cmux-tui/bindings/examples/python-agent-watchdog/tests/test_watchdog.py # cmux-tui/bindings/examples/python-agent-watchdog/watchdog.py # cmux-tui/bindings/examples/rust-agent-dashboard/Cargo.lock # cmux-tui/bindings/examples/rust-agent-dashboard/Cargo.toml # cmux-tui/bindings/examples/rust-agent-dashboard/FRICTION.md # cmux-tui/bindings/examples/rust-agent-dashboard/README.md # cmux-tui/bindings/examples/rust-agent-dashboard/src/lib.rs # cmux-tui/bindings/examples/rust-agent-dashboard/src/main.rs # cmux-tui/bindings/examples/rust-agent-dashboard/src/model.rs # cmux-tui/bindings/examples/rust-agent-dashboard/tests/fake_server.rs # cmux-tui/bindings/examples/typescript-browser-controller/FRICTION.md # cmux-tui/bindings/examples/typescript-browser-controller/README.md # cmux-tui/bindings/examples/typescript-browser-controller/package-lock.json # cmux-tui/bindings/examples/typescript-browser-controller/package.json # cmux-tui/bindings/examples/typescript-browser-controller/scripts/verify-clean-linked-sdk.mjs # cmux-tui/bindings/examples/typescript-browser-controller/scripts/verify-packaged-consumer.mjs # cmux-tui/bindings/examples/typescript-browser-controller/src/controller.ts # cmux-tui/bindings/examples/typescript-browser-controller/src/node-demo.ts # cmux-tui/bindings/examples/typescript-browser-controller/src/websocket.ts # cmux-tui/bindings/examples/typescript-browser-controller/test/controller.test.ts # cmux-tui/bindings/examples/typescript-browser-controller/test/websocket.test.ts # cmux-tui/bindings/go/README.md # cmux-tui/bindings/go/client.go # cmux-tui/bindings/go/client_test.go # cmux-tui/bindings/java/README.md # cmux-tui/bindings/java/consumer-tests/com/cmux/consumer/ExternalJarConsumerTest.java # cmux-tui/bindings/java/pom.xml # cmux-tui/bindings/java/scripts/test.sh # cmux-tui/bindings/java/src/com/cmux/CmuxClient.java # cmux-tui/bindings/java/src/com/cmux/CmuxCommandException.java # cmux-tui/bindings/java/src/com/cmux/CmuxDecodeException.java # cmux-tui/bindings/java/src/com/cmux/JsonException.java # cmux-tui/bindings/java/src/com/cmux/Pane.java # cmux-tui/bindings/java/src/com/cmux/Screen.java # cmux-tui/bindings/java/src/com/cmux/Tab.java # cmux-tui/bindings/java/src/com/cmux/Workspace.java # cmux-tui/bindings/python/README.md # cmux-tui/bindings/python/cmux/__init__.py # cmux-tui/bindings/python/cmux/client.py # cmux-tui/bindings/python/cmux/errors.py # cmux-tui/bindings/python/cmux/transport.py # cmux-tui/bindings/python/pyproject.toml # cmux-tui/bindings/python/tests/support.py # cmux-tui/bindings/python/tests/test_consumer.py # cmux-tui/bindings/python/tests/test_convenience.py # cmux-tui/bindings/python/tests/test_events.py # cmux-tui/bindings/python/tests/test_lifecycle.py # cmux-tui/bindings/python/tests/test_protocol.py # cmux-tui/bindings/python/tests/test_schema_roundtrip.py # cmux-tui/bindings/rust/Cargo.toml # cmux-tui/bindings/rust/README.md # cmux-tui/bindings/rust/examples/e2e.rs # cmux-tui/bindings/rust/src/client.rs # cmux-tui/bindings/rust/src/codec.rs # cmux-tui/bindings/rust/src/convenience.rs # cmux-tui/bindings/rust/src/generated/.cmux-sdk-manifest.json # cmux-tui/bindings/rust/src/generated/commands.rs # cmux-tui/bindings/rust/src/generated/events.rs # cmux-tui/bindings/rust/src/generated/metadata.rs # cmux-tui/bindings/rust/src/generated/mod.rs # cmux-tui/bindings/rust/src/generated/types.rs # cmux-tui/bindings/rust/src/lib.rs # cmux-tui/bindings/rust/src/presence.rs # cmux-tui/bindings/rust/src/topology.rs # cmux-tui/bindings/rust/tests/mock_server.rs # cmux-tui/bindings/rust/tests/public_api.rs # cmux-tui/bindings/typescript/README.md # cmux-tui/bindings/typescript/e2e/e2e.ts # cmux-tui/bindings/typescript/package-lock.json # cmux-tui/bindings/typescript/package.json # cmux-tui/bindings/typescript/scripts/verify-packaged-consumer.mjs # cmux-tui/bindings/typescript/src/browser.ts # cmux-tui/bindings/typescript/src/client.ts # cmux-tui/bindings/typescript/src/errors.ts # cmux-tui/bindings/typescript/src/index.ts # cmux-tui/bindings/typescript/src/node-client.ts # cmux-tui/bindings/typescript/src/node-transport.ts # cmux-tui/bindings/typescript/src/protocol/index.ts # cmux-tui/bindings/typescript/src/transport-limits.ts # cmux-tui/bindings/typescript/src/websocket-transport.ts # cmux-tui/bindings/typescript/test/authority.test.ts # cmux-tui/bindings/typescript/test/client.test.ts # cmux-tui/bindings/typescript/test/field-compatibility.test.ts # cmux-tui/bindings/typescript/test/generated.test.ts # cmux-tui/bindings/typescript/test/package-consumer.test.ts # cmux-tui/bindings/typescript/test/presence.test.ts # cmux-tui/bindings/typescript/test/protocol-types.ts # cmux-tui/bindings/typescript/test/websocket-transport.test.ts # cmux-tui/bindings/zig/README.md # cmux-tui/bindings/zig/build.zig # cmux-tui/bindings/zig/build.zig.zon # cmux-tui/bindings/zig/examples/watch.zig # cmux-tui/bindings/zig/src/cmux.zig # cmux-tui/scripts/check-sdk-schema.py # cmux-tui/scripts/test_check_sdk_schema.py # cmux-tui/spec/README.md # cmux-tui/spec/bindings.md # cmux-tui/spec/sdk-schema.json
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8220a78. Configure here.

Summary
This is stacked on PR 8856 by Lawrence Chen, which remains open and unmerged.
Verification
cmux-tuibuild with Rust 1.95actionlintand diff checksDependencies
Python, TypeScript, Go, Java, C++, and Zig use only standard-library or platform runtime facilities. Rust uses
serde,serde_json, andlibc. Generation is a repository build tool and is not a consumer dependency.Protocol follow-ups
Agent state events, typed terminal completion, mutation idempotency and revision guards, resumable stream checkpoints, stable machine-readable error codes, and browser frame encoding require protocol additions rather than SDK-only helpers.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Generates exact protocol-10 wire layers and manifests for seven
cmux-tuiSDKs and verifies them with a deterministic cross-language suite; CI builds, tests, and publishes 0.4.0. Replaces sleep-based timing with readiness hooks and selector-driven I/O so timeouts, partial-frame assembly, and close-unblock behavior are consistent; Java now uses separate read/write selectors, one per-command deadline across send/receive and stream reads, interrupt-aware writes, and closes on write failure.New Features
cmux-clientbumped to 0.4.0.Bug Fixes
JsonLineConnection.receive(…, Runnable),CmuxStream.next(timeout, Runnable)with a preservedDeadlineacross messages, andCmuxClient.rawRequest(…, Runnable); Python transport_recv(before_wait=…)and stream_next(before_wait=…); C++UnixTransport::set_before_receive_wait_for_testingwith a waiting-receivers counter and idempotent signal.Written for commit 1a0aeac. Summary will update on new commits.
Note
Medium Risk
Changes core socket read/write and deadline behavior in Java and shared transport layers across bindings; scope is bounded by expanded lifecycle tests but incorrect deadline or selector handling could affect timeouts and close semantics in production clients.
Overview
Replaces sleep-based timing in C++, Java, Python, and TypeScript SDK tests with readiness hooks so lifecycle tests can assert close-unblock, partial frames, and timeouts without flakes.
Java
JsonLineConnectionnow uses separate read and write selectors, a sharedDeadlineacross send and receive for one command, selector-driven writes (noThread.sleepspin), wakeups on close, and closes the connection on write failure.CmuxClient.rawRequestandCmuxStream.nextgain package-privatebeforeWaitrunnables invoked immediately before blocking on the socket.C++
UnixTransportadds aCMUX_CPP_TESTINGhook beforepollon receive; fake transports count waiting receivers. Python mirrors this with_recv/_next(before_wait=…)on the transport and stream paths.TypeScript client tests use mock timers and deferred promises instead of racing real timeouts on stream idle behavior.
Reviewed by Cursor Bugbot for commit 1a0aeac. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
Bug Fixes
Tests