← Back to AI Insights
Gemini Executive Synthesis

INK-Q/agy-fast Windows unquoted command-chaining shell fallback vulnerability

Technical Positioning
Robust shell execution safety and cross-platform command interpretation in AI agent accelerator tools.
SaaS Insight & Market Implications
This bug report details a classic cross-platform shell discrepancy where unquoted semicolon command-chaining generated by LLMs targeting PowerShell syntax falls back silently to `cmd.exe`, causing subsequent commands to be swallowed as trailing arguments without throwing execution errors. Such silent failures in verification or check routines (`run_checks`) compromise the reliability of AI-driven code modification loops by falsely reporting positive results (`[PASS]`). For developer-focused AI tooling, rigorous input sanitization and explicit shell enforcement mechanisms are mandatory to prevent platform-specific command interpretation mismatches. Ensuring strict error propagation during automated test execution protects development workflows from insidious, silent regression bugs.
Proprietary Technical Taxonomy
runShellCommandAsync needsPowerShellOnWindows cmd.exe fallback command chaining

Raw Developer Origin & Technical Request

Source Icon GitHub Issue Nov 24, 2026
Repo: INK-Q/agy-fast
bug(windows): unquoted ';' command chaining silently falls back to cmd.exe in run_checks

### 现象

在 Windows 环境下,Antigravity 的系统提示告知模型当前 Shell 为 `pwsh`,因此模型调用 `run_checks`(或 `apply_edits` 的 `verify`)时经常写出 PowerShell 风格的分号串联命令,例如:

```powershell
agent-reach --version 2>&1; agent-reach --help 2>&1
```

实测该命令在 `run_checks` 中返回:

```text
## [PASS] cli-help (250ms)
$ agent-reach --version 2>&1; agent-reach --help 2>&1
Agent Reach v1.6.0
```

后半句 `agent-reach --help 2>&1` **实际根本没有执行**,且整条检查静默返回 `[PASS]`。

---

### 根因

在 `src/utils/exec-utils.ts`(截至 `v0.3.0` / `150d4b7`)中,`runShellCommandAsync()` 依赖 `needsPowerShellOnWindows(command)` 判断是否切到 `pwsh` / `powershell.exe`,否则走 `spawn(..., { shell: true })` 即 `cmd.exe`。

目前 `needsPowerShellOnWindows()` 仅匹配:
- `WINDOWS_PS_DOUBLE_QUOTABLE_VAR_RE`(`$env:*` / `$LASTEXITCODE` 等)
- `WINDOWS_PS_UNQUOTED_SYNTAX_RE`(`$HOME` / `$null` / `$(...)` / `@(...)` / `$x =` 等)
- `WINDOWS_PS_CMDLET_RE`(`Verb-Noun` cmdlet)

当串联命令中**不包含上述变量或 cmdlet、只包含未加引号的 `;` 分隔符**时,`needsPowerShellOnWindows()` 返回 `false`,命令被交给 `cmd.exe` 执行。

而在 `cmd.exe` 中 `;` 不是命令分隔符(`cmd.exe` 使用 `&` / `&&`),会被直接作为参数传递给前一个进程,复现如下:

```powershell
> cmd /c 'python -c "import sys; print(sys.argv)" --version 2>&1; echo SECOND 2>&1'
['-c', '--version', ';', 'echo', 'SECOND']
```

当第一个命令遇到 `--version` 直接打印版本号并退出 `0`(忽略多余参数)时,后续命令会被静默吞掉,且 `run_checks` 误报 `[PASS]`;其他命令则会把 `;` 及后续命令误判为非法参数而莫名报错。

(注:`unwrapTrivialWindowsPowerShellCommand()` 已通过 `WINDOWS_UNWRAP_FORBIDDEN_META_RE` 拦住了显式 `pwsh -c "a; b"` 中的 `;`,但直接传入的 `a; b` 仍会命中此问题。)

---

### 建议修复方向

在 `needsPowerShellOnWindows()`(已通过 `str...

Developer Debate & Comments

No active discussions extracted for this entry yet.

Adjacent Repository Pain Points

Other highly discussed features and pain points extracted from INK-Q/agy-fast.

Extracted Positioning
agy-fast: Non-invasive MCP accelerator plugin for Google Antigravity
High-performance Model Context Protocol accelerator cutting LLM turns, token quotas, and upload traffic.
Extracted Positioning
INK-Q/agy-fast cross-host MCP integration, performance benchmarking, and schema optimization
Non-invasive Model Context Protocol acceleration for programmatic tool calling across diverse LLM hosts.
Extracted Positioning
agy-fast: Non-invasive MCP accelerator plugin for Google Antigravity
High-performance Model Context Protocol accelerator cutting LLM turns, token quotas, and upload traffic.
Extracted Positioning
agy-fast: Non-invasive MCP accelerator plugin for Google Antigravity
High-performance Model Context Protocol accelerator cutting LLM turns, token quotas, and upload traffic.
Extracted Positioning
agy-fast: Non-invasive MCP accelerator plugin for Google Antigravity
High-performance Model Context Protocol accelerator cutting LLM turns, token quotas, and upload traffic.

Frequently Asked Questions

Market intelligence mapped to INK-Q/agy-fast Windows unquoted command-chaining shell fallback vulnerability.

How is INK-Q/agy-fast Windows unquoted command-chaining shell fallback vulnerability positioned in the market?
Based on our AI analysis of the original developer request, its primary technical positioning is: Robust shell execution safety and cross-platform command interpretation in AI agent accelerator tools.
Are engineers actively discussing INK-Q/agy-fast Windows unquoted command-chaining shell fallback vulnerability?
Yes, we have tracked 1 direct responses and active debates regarding this specific topic originating from GitHub Issue.
What architecture is tied to INK-Q/agy-fast Windows unquoted command-chaining shell fallback vulnerability?
Our proprietary extraction maps INK-Q/agy-fast Windows unquoted command-chaining shell fallback vulnerability to adjacent architectural concepts including runShellCommandAsync, needsPowerShellOnWindows, cmd.exe fallback, command chaining.

Engagement Signals

1
Replies
open
Issue Status

Cross-Market Term Frequency

Counts stored text matches for foundational terms like runShellCommandAsync and needsPowerShellOnWindows in analysed public discussions. These counts do not measure adoption.

Stored text matches, not adoption or market-share measurements.

  • runShellCommandAsync: 1 records
  • needsPowerShellOnWindows: 1 records
  • cmd.exe fallback: 1 records
  • command chaining: 1 records