Skip to content

test(cli): ambient PWD escapes CLI fixture isolation into session.directory #823

Closed

Description

@agenteinstinct1-max

Defect

CLI fixture children inherit the parent process PWD unless the harness overrides it. The CLI resolves session.directory from env.PWD before cwd, so setting HOME and cwd to the fixture home does not isolate session.directory when the caller has a stale ambient PWD.

A Linux child-log discriminator observed session.directory pointing at the repository instead of the fixture home. Defaulting the child PWD to the fixture home changed that observation to the expected fixture home. Explicit caller env overrides must remain supported.

Proposed scope

Set fixture defaults for spawn, startRun and serve; for ACP use the resolved requested cwd (or fixture home). Add an isolated subprocess regression with ambient PWD containing spaces. Leave production code unchanged.

PR #822 contains the narrow candidate. Its one focused Linux spawn happy-path test passed, but current PR CI is red (typecheck and both unit jobs), so it is not merge-ready. The other harness paths are source-reviewed only; timeout/interruption cleanup and native Windows are not established by the focused run. This issue does not claim a fix for the broader test-suite bottleneck.

Acceptance

The isolated regression preserves exit/stdout/session.directory assertions, exact-head CI passes on Linux and Windows with typecheck, and independent exact-head review is clean. No larger timeouts, skipped tests, weakened assertions, workflow changes or full-suite speedup claim.

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