Skip to content

WIP: fix(terminal): refresh PATH for new Windows sessions - #3969

Draft
YodonTan wants to merge 1 commit into
openBitFun:mainfrom
YodonTan:fix/terminal-live-path
Draft

YodonTan wants to merge 1 commit into
openBitFun:mainfrom
YodonTan:fix/terminal-live-path

Conversation

@YodonTan

Copy link
Copy Markdown
Contributor

Summary (WIP / manual testing pending)

Fix new local Windows terminals retaining the host startup PATH after the system/user PATH changes, across Desktop, CLI and SDK Host.

Root cause: two layers

  • Host wiring froze a fully merged process PATH into terminal configuration at initialization, overriding the fresh Windows base environment used for later sessions.
  • The PTY environment overlay appended PATH instead of replacing the inherited value, so explicit overrides could retain stale entries and an empty PATH could not clear them.

Policy and scope

  • Explicit request PATH > explicit config PATH, as a complete verbatim replacement, including empty/whitespace values; Windows PATH key variants are resolved deterministically.
  • With neither explicit value: managed prefix > inherited custom increment > live OS baseline > platform suffix. The baseline is read for each new local session, preserving additions, removals and ordering. Empty and unavailable baselines remain distinct.
  • Shared owner policy is wired into all three hosts (Desktop/CLI/SDK Host). Windows-only normalization; Unix retains its original overlay/inheritance logic.
  • No local environment injection into remote sessions; static guards cover the existing early remote return and empty remote overlay.
  • Legacy config deserialization defaults and JSON round trips are covered.

Known limits

A directory deleted from OS PATH before host initialization but still in the parent environment is indistinguishable from a custom entry. Managed/platform directory sets are initialization snapshots: installing another managed runtime still requires a host restart.

Verification on rebased final commit

Base: 2ea23bba0526af9bdec4a4533ca5a30f9bdf3520 (canonical main fetched before rebase).

  • PASS: cargo check --locked -p terminal-core --all-targets
  • PASS: cargo test --locked -p terminal-core --lib -- config:: session:: pty:: (35 tests)
  • PASS: node --test scripts/terminal-live-path.test.mjs (6 static contracts; not live remote evidence)
  • PASS: cargo test --locked -p openbitfun-services-core --no-default-features --features process-runtime --lib managed_runtime (4 tests)
  • PASS: cargo test --locked -p openbitfun-core --no-default-features --features process-runtime --lib service::runtime (1 test)
  • PASS: cargo check --locked -p openbitfun-cli
  • PASS: cargo check --locked -p openbitfun-sdk-host-app
  • PASS: corepack pnpm run check:core-boundaries; git show --check
  • Desktop check not rerun: third-party sherpa download previously failed on this machine; Windows fork Actions test builds are requested separately.
  • Formatting NOT verified: rustfmt component is missing; the previous installation attempt failed with HTTP 404 for mirror rustfmt 1.99.1 (2026-10-15) and rolled back. No tool installation retried.
  • Full terminal exec suite not rerun: previously encountered existing Python Store redirector-stub failures; exec.rs is unchanged.

No live registry mutation, desktop UI, Unix, SSH, Peer Device Mode, relay/remote control, or detached-dispatch validation has been performed. Local fixtures and static guards are not evidence of live remote behavior. Windows manual testing is pending. Test artifacts are unsigned; no release/tag/updater publication is intended.

AI-assisted implementation and review. Testing level: focused automated tests/checks completed; manual and live multi-scenario verification pending.

@YodonTan

YodonTan commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Windows x64 builds for commit d2efc1e7d5dbffc72cbe31f862bcd477ce54881f are both SUCCESS (each dispatched exactly once). Manual testing is still pending; no installer has been run locally.

Desktop unsigned installer: SUCCESS, artifact available

  • Run: https://github.com/YodonTan/BitFun/actions/runs/44037780925
  • Artifact download: https://github.com/YodonTan/BitFun/actions/runs/44037780925/artifacts/14313013435
  • Artifact ID 14313013435, openbitfun-desktop-verify-unsigned-d2efc1e7d5dbffc72cbe31f862bcd477ce54881f-windows-x64, 119,333,467 bytes; expires 2026-11-24T08:54:41Z (7 days).
  • Installer: OpenBitFun_1.0.11_x64-setup.exe, 119,315,213 bytes.
  • CI verifier reports SHA256 46332133aa6a631ced9f5ae42458c535e0ba9c1d04c3ef4c5ee2419c37a95b75.
  • Pinned source checkout, unsigned NSIS bundling, checksum/build-metadata verification and artifact upload all succeeded. CI checkout logs confirm the full commit above.
  • Local download could not complete within bounded attempts (gh stalled; direct HTTPS transfer remained partial after >5 minutes). Incomplete local archive was deleted. Therefore local installer checksum and downloaded build-metadata.json have NOT been independently verified; use the Actions artifact link to download.

CLI: SUCCESS, downloaded and checksum verified

Reported non-skipped PR checks passed at the last check. Local formatting remains unverified as disclosed in the PR body. Artifacts remain unsigned/test-only; no release/tag/updater publication, ready-for-review transition, or merge was requested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant