Repository navigation
Preserve inline PowerShell commands in Codex rollouts - #306
Open
Loop (Loop3373) wants to merge 1 commit into
Open
Loop (Loop3373) wants to merge 1 commit into
Loop (Loop3373) wants to merge 1 commit into
Conversation
Author
|
@microsoft-github-policy-service agree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Codex CLI on Windows records shell commands as an argv array, for example
[pwsh.exe, -NoProfile, -Command, "python -m pytest -q"]. Rollout conversioncurrently joins these arguments with POSIX shell quoting. The resulting
PowerShell invocation hides the inner command from the envfacts classifier,
so it misses repeated command repairs in Windows sessions.
Extract the final script argument for
pwsh.exeandpowershell.exewhen itfollows
-Commandand the preceding arguments are limited to the standalonestartup switches
-NoLogo,-NoProfile, and-NonInteractive. Match theexecutable basename and flags case-insensitively and preserve the script
verbatim. Keep the existing conversion for Bash and other input forms,
including a PowerShell
-Fileinvocation whose script accepts a parameternamed
-Command.Validation
existing
/bin/bash -lccommand. Both exercise rollout conversion, exitstatus, and the envfacts candidate created when
pytest -qfails andpython -m pytest -qsucceeds.matching,
-Filewith and without a script parameter named-Command,empty argv, and string input.
mainat1bfeccdcecf48333b22762ad1dd9e36c6dc065dfon November 22, 2026 (JST). The patch passed
git apply --check --whitespace=errorand applied unchanged in a freshcheckout.
git diff --checkpassed after application.tests/test_trace.pyandtests/test_envfacts.pypassed after applying the patch to that checkout.AI assistance and review scope
OpenAI Codex was used to prepare the patch, regression tests, and this PR
description. The final diff was checked for unrelated changes and local
identifiers. Validation covered patch application to the upstream commit
listed above and the two offline test modules on Windows. The Windows
Codex rollout observed during the investigation informed the test fixtures.
The final regression tests replay synthetic records and do not invoke
Codex CLI or a model. Bash compatibility was tested with a synthetic
/bin/bash -lcrecord on Windows.Related pull requests
request counting in
trace/codex.py. This patch changes the separatecommand conversion path.
PowerShell tool calls from Claude Code. This patch handles argv recorded
by Codex CLI.
pixi runin Micro-skills command classification. This patch makes theinline PowerShell script available to that classification stage.