Skip to content

fix(ssh): preserve Windows native exit codes through PowerShell #133

Closed

Description

@abruption

Verified regression (P1 patch candidate)

The Windows-destination launcher runs native commands through an encoded PowerShell command without explicitly forwarding $LASTEXITCODE. PowerShell 5.1 converts native exits 2 and 255 to SSH exit 1. A definite usage refusal loses exit 2; a complete, validated successful submission followed by native exit 255 is rejected as an inconsistent ordinary exit-1 response and loses its known submission evidence.

Published source: c0ed302 (npm 0.3.3). Physical Windows 10 x64 / PowerShell 5.1 / Node 24.16.0: 23 isolated SSH fixture scenarios passed reproduction assertions. A launcher control adding explicit native exit forwarding kept stdout bytes identical and preserved exits 2 and 255. Fixtures emitted synthetic results; no actual Claude/Codex session, queue, message, or ACK was used.

Acceptance

  • Forward the actual native exit after both --version preflight and --stdio-request; invocation failure without a native exit must fail closed.
  • Preserve strict response validation, exact-version preflight, host-key policy, message-over-stdin, and no resend/fallback.
  • Test success/0, refusal/1 and /2, complete success/255, missing/partial/malformed responses, and failed version preflight with zero requests. Verify queueId/submitted evidence for a complete abnormal result without claiming consumption/ACK.
  • Run regression tests on actual Windows PowerShell and the corrected local CLI over physical SSH using an isolated synthetic executable. Remove only owned remote fixtures.
  • CI and automatic review must be checked on the PR head. No merge/release/publication in this issue's implementation scope.

Refs #20 (remaining Windows exit forwarding), #52 (earlier verified exit propagation), #115 and #116 (strict framing and evidence preservation). This bounded fix does not complete Windows-client jump support or close #20.

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

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions