Repository navigation
feat(native): add embedded local server process hosting (CN-LOCAL) - #459
Merged
Merged
Conversation
This was referenced Nov 20, 2026
Open
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 #241
Summary
Completes embedded local server process hosting (
CN-LOCAL) for the native GPUI client, flippingCN-LOCALinapps/native/parity/LEDGER.mdfrompartial | #241todone |.Changes
apps/native/crates/core/src/local_server.rs):LocalServerLaunchSpec,serve_args,server_origin,readiness_url, UTF-8-safeappend_output_tail, capped exponentialrestart_delay_ms,matches_hosted_runtime, andformat_local_server_diagnostics.LocalServerLifecyclestate machine (LocalServerPhase,LocalServerEvent,LocalServerAction,LocalServerFailure,LocalServerFailureKind) mirroringDesktopBackendManager.ts(clean shutdown, managed-policy exit77and state-dir-owned exit78restart suppression, bounded crash backoff) with unit tests.apps/native/crates/client/src/local.rs):LocalServerHost,LocalServerHostConfig,LocalServerHostError, andpair_with_clito spawn the discoveredt3CLI (cli_candidates/T3_NATIVE_T3_BIN) in its own process group (process_group(0)), monitor stdout/stderr and exit codes, wait for readiness via event-drivenNotify+ exit-channeltokio::select!, pair automatically viat3 pair, and cleanly terminate ONLY the exact child PID it spawned (SIGTERM-> grace ->SIGKILLonstop()/shutdown(), immediateSIGKILLonDrop).t3-clientintegration tests (using isolated tempT3CODE_HOMEand mock CLI scripts with socket EOF sync, zero sleeps) covering start -> ready -> pair -> clean stop, exit-77 managed-policy refusal (no restart loop), startup crash diagnostics, and clean child termination onDrop.apps/native/crates/app/src/{app_state.rs, connect.rs}):LocalServerHostinsideAppState, wired reactive phase pump,start_local_server,stop_local_server, persistedset_local_server_auto_start, diagnostics copy helper, and graceful teardown incx.on_app_quit.ConnectView::render_localusingcrate::i18n::t(cx, ...)for matching labels, plus GPUI snapshot test coverage.apps/native/parity/LEDGER.md):CN-LOCALrow only (partial | #241->done |).Verification
CARGO_INCREMENTAL=0 cargo clippy --workspace --all-targets -- -D warnings: pass (0 warnings)CARGO_INCREMENTAL=0 cargo test -p t3-core: 1,860 unit + 8 conformance passed, 0 failedCARGO_INCREMENTAL=0 cargo test -p t3-client: 167 passed, 0 failedCARGO_INCREMENTAL=0 cargo test -p t3-native -- --test-threads=1(isolatedT3_NATIVE_HOME): 208 passed, 0 failed (--features snapshot connect::tests: 5 passed, 0 failed)CARGO_INCREMENTAL=0 cargo build -p t3-native: passvp fmt --check apps/native/parity/LEDGER.md: passnode apps/native/scripts/gen-theme.ts --check: passnode apps/native/conformance/generate.ts --check: passnode --test apps/native/parity/sync.test.ts: 47 passed, 0 failedGenerated with Antigravity.