Skip to content

Preserve Linux runtime commands after shell profiles reset PATH - #16650

Open
vkodithala wants to merge 2 commits into
masterfrom
varoon/runtime-bin-handoff
Open

vkodithala wants to merge 2 commits into
masterfrom
varoon/runtime-bin-handoff

Conversation

@vkodithala

@vkodithala vkodithala commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

Keep bundled cloud-agent commands available after Linux shell profiles replace PATH.

Direct non-root containers can lack permission to install commands system-wide. The companion container change allocates a private fallback directory and exports WARP_CLOUD_AGENT_FALLBACK_BIN. The cloud agent and its terminal shells inherit that variable through the process environment—there is no server/API handoff. This PR restores the directory at the front of PATH after profiles run, preserving sidecar ffmpeg precedence.

Control flow: container → agent → terminal

flowchart TD
    A["Container: try preferred system installation"] --> B{"Installation succeeds?"}
    B -->|Yes| C["System destination; no fallback allocation"]
    B -->|No, direct non-root only| D["Allocate private fallback bin<br/>Export PATH + WARP_CLOUD_AGENT_FALLBACK_BIN"]
    D --> E["Cloud agent inherits environment"]
    E --> F["Terminal shell inherits environment"]
    F --> G["System and user profiles run<br/>PATH may be replaced"]
    G --> H{"Linux + valid fallback directory?"}
    H -->|Yes| I["This PR: prepend fallback bin<br/>Remove duplicate entries"]
    H -->|No| J["Leave PATH unchanged"]
    I --> K["Terminal commands resolve bundled fallback tools"]
    style D fill:#fff3cd,stroke:#b58105,color:#222
    style I fill:#d4edda,stroke:#287d3c,color:#222
Loading

The Bash, Zsh, and Fish hooks require an absolute, colon-free, existing directory, preserve other PATH entries, and do nothing when the variable is absent. They neither edit profiles nor grant additional privileges. Native agent subprocesses use the entrypoint's inherited PATH; terminal commands additionally need this post-profile restoration.

Linked Issue

Companion producer: https://github.com/warpdotdev/warp-agent-docker/pull/295

Release sequence

  1. Merge this consumer change and publish/select a cloud agent binary containing these bootstrap assets.
  2. Ship the container producer with that binary.

Merging the client PR alone is insufficient if the container still selects an older binary. New consumer + old producer is a no-op; new producer + old consumer does not crash, but profiles can still hide fallback commands.

Testing

  • Added one regression to the existing shell-integration suite, enabled for Linux Bash/Zsh/Fish: a real startup profile replaces PATH with a competing fixture-command directory; executing the command after bootstrap must select the fallback fixture. No ffmpeg, browser, or container dependency.
  • Removed the standalone Python harness, its miscellaneous-checks step, and extra Zsh/Fish installs. No CI workflow changes remain relative to master. The existing shell matrix runs the regression.
  • Passed targeted cargo check --locked -p integration --bin integration and cargo clippy --locked -p integration --bin integration -- -D warnings; applied repository Rust formatting settings.
  • Passed Bash/Zsh/Fish syntax checks, ./script/lint_shellcheck --ci, and whitespace checks.
  • Passed all 18 former shell smoke cases against the renamed shipped hooks using a temporary in-memory harness (profile reset, repeated initialization/deduplication, unset/missing/relative directories, non-Linux no-op). Platform detection is stubbed for these local smoke checks.
  • Linux startup regression awaits CI. Local nextest compilation was stopped before completion; the test's runtime assertion is Linux-only and was not executed on this Mac. Full Linux container recording/browser verification remains pending.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-OZ: Preserve bundled runtime command availability when Linux shell profiles reset PATH.

Agent artifacts

Co-Authored-By: Warp agent@warp.dev

@cla-bot cla-bot Bot added the cla-signed label Oct 26, 2026

@vkodithala vkodithala left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question on the added CI script, otherwise mostly looks fine

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
@vkodithala

Copy link
Copy Markdown
Contributor Author

Responding as @vkodithala’s Warp agent, after deliberating with them.

Following up on your review summary: both inline CI questions have been answered and their threads resolved. We removed the standalone CI harness and extra package installs in favor of one regression in the existing shell-integration suite. The handoff naming/comments and visual PR description are also updated. Changes are pushed in 41b1131; this is a response to your feedback, not an approval or dismissal of your review.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant