Skip to content

test(link): keep the constrained-mode prefix out of the cmd.exe budget - #8517

Merged
lidge-jun merged 1 commit into
devfrom
goat/fix-windows-pinned-sync-test
Nov 11, 2026
Merged

lidge-jun merged 1 commit into
devfrom
goat/fix-windows-pinned-sync-test

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Summary

The full lane=all run on dev (5197322e25, run 42941869160) fails on windows 11/11:

PowerShellCommandTooLongError: Remote PowerShell command exceeds the cmd.exe-compatible command-line budget (8020)
  at powershellArgv (src/link/remote-windows.ts:21)
  at tests/clients/link-ssh-argv-discovery.test.ts:341
(fail) a Windows pinned sync command that cannot be contained is refused before any candidate is probed

#8505 grew the packed pinned sync script from 7672 to 7740 encoded characters, which is still under the 8000 cap. To simulate a Constrained Language Mode session, the test decoded that command, prepended a LanguageMode='ConstrainedLanguage' line, and re-encoded it through powershellArgv, which also adds its $ProgressPreference preamble a second time. That overhead alone reached 8020, so the test threw before PowerShell started. It is Windows-only, so the Ubuntu PR lanes could not see it.

The prefix is test scaffolding that no command Home sends carries. It is now encoded next to the builder's own argv (constrainedArgv) and no longer spends the production cmd.exe budget the builder already enforced. The test spawns powershell.exe directly, so cmd.exe's limit does not apply. A new cross-platform case pins that each probe runs the builder's command unchanged after the prefix. No source changes.

Verification

  • Reproduced on macOS: the old scaffolding throws ... budget (8020) for windowsPinnedSyncArgv("lnk_0123456789abcdef"). The new one encodes to 7916 characters, and the builder's own command stays at 7740.
  • bun test tests/clients/link-ssh-argv-discovery.test.ts: 44 pass, 13 skip (Windows-only), 0 fail.
  • bun run typecheck: no type errors.
  • NOT RUN: the Windows-only probes themselves. PR CI is Ubuntu-only by policy, so they are covered by the next lane=all dispatch on dev after merge.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed. (test-only)
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. (The production containment and budget checks are unchanged.)

The Windows containment probe for the pinned sync command failed on every
lane=all run since #8505 grew the packed script to 7740 encoded characters. The
test decoded the builder's command, prepended a ConstrainedLanguage line and
re-encoded it through powershellArgv, which also repeats its preamble; that
scaffolding overhead alone pushed it to 8020 and tripped the 8000 cap, so the
test threw before PowerShell ever ran. The production command stays under the
cap and the builder still enforces it.

The prefix is now encoded beside the builder's own argv, and a cross-platform
case pins that each probe runs the builder's command unchanged.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner November 11, 2026 02:07
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T02:09:09.989193Z db12b1b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Nov 11, 2026
@lidge-jun
lidge-jun merged commit 61147ec into dev Nov 11, 2026
23 checks passed
@lidge-jun
lidge-jun deleted the goat/fix-windows-pinned-sync-test branch November 11, 2026 02:07
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant