Skip to content

LocalAgentProviderDetector not hermetic — ignores injected PATH/home (OpenClaw discovery) #9033

Closed

Description

@eulicesl

Summary

PiMonoWiringTests/testLocalAgentProviderDetectorMissingPromptIsUserFacing injects an empty PATH and a missing home directory to force "OpenClaw unavailable", but the detector still reports isAvailable == true on a machine where OpenClaw is discoverable — i.e. LocalAgentProviderDetector doesn't fully honor the injected environment/home. Likely a non-hermetic-detection product bug.

Evidence

  • Test injects PATH → a missing dir and homeDirectory: /tmp/missing-home, expecting the local agent (OpenClaw) to be reported unavailable.
  • On a machine where OpenClaw is installed/discoverable, the assertion fails: isAvailable == true.
  • This means the detector reaches outside the injected environment (e.g. hard-coded paths or the real home) instead of honoring the provided PATH/homeDirectory.

Why this is product, not a test fix

The test is asserting a correct invariant (detection must be hermetic w.r.t. injected environment). If the detector consulted only the injected PATH/home, the test would pass. The fix is to make LocalAgentProviderDetector fully honor injected environment/home — which also makes provider detection deterministic across machines/CI runners.

Ask

Make LocalAgentProviderDetector respect the injected PATH and homeDirectory (no out-of-band discovery), then re-enable the test.

Found during macOS desktop test-suite hardening; test is currently --skip-ped with this rationale in desktop/macos/test.sh.

Activity

  1. Git-on-my-level commented on Jul 14, 2026

    @Git-on-my-level
    Member

    Parent/executor issue: #9688 — binds this issue and its siblings into one PR (Swift shadow-state census, bridge-lifecycle fuzzer, contract fixtures, adapter conformance, anti-regrowth guards) with per-child closure criteria. Sequenced after the PTT stability PR (post-#9660) to reuse its kernel-restore seam and fixture conventions.

  2. added a commit that references this issue on Jul 14, 2026
    fff4eef
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions