Fix cross-platform CI failures and async request races - #1
Merged
Merged
Conversation
beiwei30
marked this pull request as ready for review
July 28, 2026 01:35
There was a problem hiding this comment.
Pull request overview
This PR hardens cross-platform behavior across the Orb Code workspace by removing implicit host assumptions (shell, ripgrep, git config, Unix sockets), improving Unix process-group termination correctness, and fixing/strengthening several concurrency- and ordering-sensitive streaming paths so CI and real clients behave deterministically across Linux/macOS/Windows.
Changes:
- Make Unix execution and tests more portable (POSIX
/bin/shfallback, POSIX-safeprintf, deterministic git identity in tests, platform-normalized TUI glyph assertions). - Remove external executable assumptions in tests (source audit no longer depends on host
rg; tools tests can deterministically simulate ripgrep success). - Improve reliability/order guarantees (permission request registration-before-notification; in-process stream ordering changes; Unix socket APIs gated by platform with clear unsupported errors elsewhere).
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tui/src/tests/support/mod.rs | Re-exports black_circle_glyph so test helpers can normalize platform glyphs. |
| tui/src/tests/support/assertions.rs | Adds platform-aware tool-line helper and normalizes fixtures for macOS vs non-mac glyph differences. |
| tui/src/tests/slash_command/session_commands.rs | Makes git commit in tests independent of global user.name/user.email config. |
| tui/src/tests/render/tool_cards.rs | Updates tool-card rendering expectations to be platform-glyph independent. |
| tui/src/tests/render/activity_groups.rs | Updates activity-group rendering assertions to be platform-glyph independent. |
| tui/src/tests/permission/overview_picker.rs | Normalizes whitespace in transcript assertion to avoid layout-wrapping sensitivity. |
| tools/src/tests/support.rs | Adds deterministic “ripgrep success” simulation helper for tests. |
| tools/src/tests/search.rs | Uses simulated ripgrep success to test metadata path without requiring host rg. |
| tools/src/process.rs | Fixes Linux kill parsing by adding -- before negative PGID argument. |
| tools/src/grep_tool.rs | Extends test-only ripgrep simulator with a Success variant and corresponding outcome wiring. |
| tools/src/bash.rs | Falls back to /bin/sh on Unix when SHELL is absent. |
| core/src/session_manager/tests/context_refresh.rs | Makes dynamic-skill refresh test POSIX sh/dash-safe by avoiding printf option parsing. |
| core/src/session_manager/session_tool_runtime.rs | Registers permission request before publishing the PermissionRequested event to avoid response races. |
| core/src/permission_state.rs | Adds registration-before-notification hook and cleans up pending state on failed notification; adds regression test. |
| config/src/env_compat.rs | Replaces rg-based source audit with a walkdir + in-process Rust-source scan. |
| config/Cargo.toml | Adds walkdir as a dev-dependency for the source audit test. |
| cli/tests/tui_remote_pty_e2e.rs | Updates PTY smoke test header expectation from “Claude Code” to “Orb Code”. |
| cli/src/main.rs | Gates Unix-socket server/client paths on Unix and returns clear unsupported/invalid-input errors elsewhere. |
| Cargo.lock | Locks the new walkdir dev dependency. |
| app-server-transport/src/lib.rs | Compiles Unix socket module/exports only on Unix targets. |
| app-server-client/src/lib.rs | Compiles socket transport implementation only on Unix; returns explicit unsupported error otherwise. |
| app-server-client/src/in_process.rs | Adjusts in-process routing to address event ordering under load; adds regression test. |
| .github/workflows/release.yml | Updates Linux bubblewrap installation step and disables Ubuntu 24.04 AppArmor unprivileged-userns restriction for CI runner compatibility. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+223
to
+244
| let mut lossless_open = true; | ||
| let mut best_effort_open = true; | ||
| while lossless_open || best_effort_open { | ||
| tokio::select! { | ||
| biased; | ||
| msg = best_effort_rx.recv(), if best_effort_open => { | ||
| if let Some(msg) = msg { | ||
| route_message(msg, &pending, ¬if_tx, &srv_req_tx, false).await; | ||
| } else { | ||
| best_effort_open = false; | ||
| } | ||
| } | ||
| msg = lossless_rx.recv(), if lossless_open => { | ||
| if let Some(msg) = msg { | ||
| route_message(msg, &pending, ¬if_tx, &srv_req_tx, true).await; | ||
| } else { | ||
| lossless_open = false; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
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.
Summary
Changes
Cross-platform runtime behavior
/bin/shwhenSHELLis absent on UnixRequest and stream reliability
Self-contained CI and tests
rgwith direct Rust source traversalOrb CodeheaderWhy
The original ACP failure came from a cleared environment with no
SHELL, where the previouszshfallback was unavailable on Ubuntu. Follow-up jobs exposed additional assumptions inherited from a macOS developer environment: procpskillparsing, missingrg, unconditional Unix-socket imports, dash behavior, platform-specific glyphs, and global Git configuration.Two independent async races were also exposed. A fast headless client could respond before a permission request was registered, leaving the turn blocked. Separately, the in-process transport could deliver
TurnFinishedbefore an already queuedAssistantDelta, closing the ACP route before the final answer text was forwarded.Verification
Focused and stress validation:
scripts/check.sh --quickorbcode-app-server-clientsuite: 39 passedacp_server_request_e2e: 48 passedorbcode-tools --lib: 328 passed without hostrgorbcode-tui --lib: 938 passed on both macOS and Linux DockerFinal GitHub Actions results for
75305f4:CI failure history used during diagnosis
printffixture failure