Skip to content

Gateway commands mix Linux vs Windows semantics + path confusion #911

Closed

Description

@samanthamsong

Problem: Gateway commands mix Linux vs Windows semantics and there is path confusion between the WSL and Windows sides. (Related to but distinct from #901, which tracks WSL Gateway <-> Tray version lock-step.)

Impact: Platform/infra - confusing, error-prone command surface across WSL/Windows.

Epic: should ladder up to #834 (S1 - Local gateway golden path).

Activity

  1. clawsweeper commented on Jul 1, 2026

    @clawsweeper

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed August 25, 2026, 6:32 PM ET / 22:32 UTC.

    Summary
    Keep open. Current main documents the WSL argv mutation and provides a safe stdin path, but several setup callers still send the shared $PATH prefix through the unsafe default argv path; the broader cross-platform command contract needs maintainer scope.

    Reproducibility: yes. for the narrow defect: the documented WSL argv reproduction and current $PATH-bearing default callers establish the unsafe path from source. The report does not define one reproducible broader semantic contract problem.

    Root-cause cluster
    Relationship: canonical
    Canonical: #911
    Summary: This issue is the canonical tracker for the remaining WSL command-delivery/path-semantics concern; the linked version and exec-policy items are adjacent but explicitly distinct.

    Members:

    Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

    Maintainer decision needed

    Question Recommendation
    Should this issue be limited to auditing and repairing unsafe WSL command delivery, or should it also define a new user-facing cross-platform command/path contract? Land the narrow WSL delivery repair: Audit WslPathPrefix callers, use stdin delivery where needed, and retain the current explicit Windows-node routing model.

    Why: The narrow source defect is established, but the issue's broader request does not define which Linux/Windows semantics should change beyond the existing documented routing boundary.

    Next step
    A maintainer must choose whether this stays a bounded WSL delivery repair or expands into a new cross-platform command contract; the collaborator-authored, actively landing item should not be auto-dispatched.

    Review details

    Best possible solution:

    Preserve the documented WSL-versus-Windows routing boundary, migrate all $PATH-bearing setup scripts to stdin delivery, and add coverage that prevents new unsafe callers.

    Do we have a high-confidence way to reproduce the issue?

    Yes for the narrow defect: the documented WSL argv reproduction and current $PATH-bearing default callers establish the unsafe path from source. The report does not define one reproducible broader semantic contract problem.

    Is this the best way to solve the issue?

    Unclear for a broad cross-platform redesign. The narrow stdin migration is the safest repair, while any change to the public command contract needs maintainer direction.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • A broad rewrite could blur the established boundary: normal gateway exec is Linux/WSL work, while Windows shell work must explicitly target the Windows node.
    • Migrating the shared prefix requires an audit of setup call sites and regression coverage so no $PATH-bearing script remains on the argv route.

    Codex review notes: model internal, reasoning high; reviewed against 8ff0353919cf.

    Label changes

    Label justifications:

    • P2: The source-proven setup command defect has a bounded but meaningful impact on local gateway setup and control.
    • impact:other: The issue concerns cross-platform command and path semantics rather than a more specific owned impact category.
    Evidence reviewed

    What I checked:

    • Unsafe default remains reachable: The shared WSL prefix includes $PATH, while the default runner passes the whole command as bash -c argv. The repository documentation states that this argv path rewrites variable references before Bash receives them. (src/OpenClaw.SetupEngine/SetupSteps.cs:16, 8ff0353919cf)
    • Concrete affected setup caller: Gateway service installation combines WslPathPrefix with openclaw gateway install --force without setting inputViaStdin, so it follows the unsafe default runner branch. (src/OpenClaw.SetupEngine/InstallGatewayServiceStep.cs:23, 8ff0353919cf)
    • Documented expected behavior: The WSL argv guide requires stdin delivery for scripts using Bash variables and identifies the command runner as the affected boundary. (docs/WSL_EXE_ARGV_PITFALL.md:75, 8ff0353919cf)
    • Partial mitigation provenance: Commit b37307c introduced stdin-safe Windows-node context calls and comments that $PATH would otherwise expand to the Windows path, but current setup callers still use the default path. (src/OpenClaw.SetupEngine/WindowsNodeBootstrapContextStep.cs:314, b37307cbd51f)
    • Release and current-main check: The partial mitigation commit is on main and tag containment reports only v2026.7.2 prerelease tags; the provided latest release is v2026.7.1 at 4206611, so this is not a released complete fix. (b37307cbd51f)
    • Related items are distinct: The issue body identifies the version lock-step work as distinct, and the closed exec-policy report explicitly excludes this broader Windows-versus-WSL contract.

    Likely related people:

    • Barbara Kudiess: Commit b37307c added the safe stdin treatment and its explanatory comments in the Windows-node bootstrap path, which shares the WSL command runner with the remaining callers. (role: introduced the current setup command seam; confidence: high; commits: b37307cbd51f; files: src/OpenClaw.SetupEngine/WindowsNodeBootstrapContextStep.cs, src/OpenClaw.SetupEngine/CommandRunner.cs)
    • Joel: Commit ccd64bb added managed local AI setup code that uses the same WSL command infrastructure and stdin-safe pattern. (role: recent adjacent contributor; confidence: medium; commits: ccd64bbb7d68; files: src/OpenClaw.SetupEngine/LocalAiGatewayConfiguration.cs)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P2
    impact:other
    issue-rating: 🐚 platinum hermit
    clawsweeper:needs-live-repro
    clawsweeper:no-new-fix-pr
    clawsweeper:needs-maintainer-review
    clawsweeper:needs-product-decision
    on Jul 1, 2026
  3. moved this from Backlog to Local Gateway in Windows Companion Appon Jul 13, 2026
  4. github-actions commented on Jul 25, 2026

    @github-actions
    Contributor

    This issue has been automatically marked as stale due to inactivity.
    Please add updated OpenClaw Windows details or it will be closed.

  5. 25 remaining items

  6. added
    issue-rating: 🧂 unranked krab
    issue-rating: 🦪 silver shellfish
    P2
    issue-rating: 🦞 diamond lobster
    clawsweeper:source-repro
    and removed
    issue-rating: 🧂 unranked krab
    P3
    issue-rating: 🦪 silver shellfish
    on Aug 8, 2026
  7. added
    status: 🚢 actively landing
    and removed
    status: 🚢 actively landing
    on Aug 18, 2026
  8. removed
    status: 🚢 actively landing
    on Aug 25, 2026
  9. locked as resolved and limited conversation to collaborators on Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2clawsweeper:needs-maintainer-reviewclawsweeper:needs-product-decisionclawsweeper:no-new-fix-prclawsweeper:source-reproimpact:otherissue-rating: 🦞 diamond lobster

    Type

    No type

    Fields

    Priority

    Medium

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions