Repository navigation
Description
Migrated from alkoleft/v8-runner-rust pr #45.
Original author: Agrajaga; created:2026-07-23T09:48:51Z; last upstream update:2026-07-24T07:00:12Z.
GitHub shows the migration account as the new author; this block preserves actual attribution.
Upstream historical base:masterat2a43c6d02af2e8440376fc50bbc8c697f142175c; head:Agrajaga:codex/fix-windows-c-raw-argat45f38dfd390c900891ed05b274b538aa8e630be8. Active migrated PRs compare that exact head with the currentIngvarConsulting/v8-runner-rust:master.
Upstream merged:2026-07-23T15:28:53Z; merge commit:72d346c0a8fcf8373d9388257d11e6bef0ad70b2.
Summary
- pass the generated
/C"RunUnitTests=..."parameter through a guarded Windows raw command-line argument for1cv8and1cv8c; - retain standard Rust argument escaping for other executables and reject embedded quotes or line breaks in the raw payload;
- mask separated, compact and connection-string password forms in debug-rendered commands;
- avoid logging values from additional Enterprise launch keys;
- keep Unix-only syntax-test helpers gated so the Windows regression suite compiles.
Root cause
std::process::Command::arg escapes the quotes embedded in the complete 1C /C parameter. The resulting Windows command line contains /C\"RunUnitTests=...\", which the 1C parser ignores, so Enterprise starts in normal mode instead of starting YaXUnit.
Impact
YaXUnit launches on Windows now receive the literal command-line form expected by 1C:
/C"RunUnitTests=..."
Password values are also removed from process debug output.
Validation
- 4 command-rendering/password-redaction tests pass.
- 3 Windows tests for raw YaXUnit arguments, normal non-1C escaping and payload validation pass.
cargo check --all-targetspasses.cargo fmt --all -- --checkpasses.git diff --checkpasses.- Independent reviewer and Rust-focused review found no remaining issues.
A live YaXUnit information-base run was not performed because this checkout does not contain a configured test information base.
Fixes upstream #44
Summary by CodeRabbit
-
Исправления
- Уточнена обработка ключей запуска
/C,/executeи/out, включая варианты с разными префиксами, пробелами и разделителями. - Исправлено формирование аргументов для запуска MCP:
/Cи значение payload теперь передаются раздельно. - Некорректные присоединённые алиасы, например
/C"RunUnitTests", корректно отклоняются до запуска клиента.
- Уточнена обработка ключей запуска
-
Документация
- Обновлены инструкции по запуску MCP и описания параметров конфигурации с актуальным форматом payload.
Activity
zeegin commentedon Sep 2, 2026
Walkthrough
Обновлена обработка зарезервированных ключей запуска и формат передачи
/C: ключ и payload теперь являются отдельными аргументамиprocess argv. Добавлены проверки алиасов, обновлены тесты и документация.Changes
Обработка аргументов запуска
src/domain/runner.rs/Csrc/platform/enterprise.rs,src/cli/args.rs,docs/...,SKILL/references/project-workflows.md,src/config/model.rs/Cи payload передаются отдельными аргументами, фильтрация зарезервированных ключей использует matcher, а документация описывает новый формат.src/cli/execute.rs,src/use_cases/launch_app.rs,tests/cli_launch.rs/C,/Executeи/Out; тест подтверждает отказ до запуска процесса.Estimated code review effort: 3 (Moderate) | ~25 minutes
Possibly related PRs
Suggested reviewers:
alkoleftPoem
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
/Cargument handling.#44by preserving raw YaXUnit/Con Windows, keeping normal escaping elsewhere, and masking passwords in debug output.✨ Finishing Touches
🧪 Generate unit tests (beta)
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
Comment
@coderabbitai helpto get the list of available commands.zeegin commentedon Sep 2, 2026
@coderabbitai review
zeegin commentedon Sep 2, 2026
✅ Action performed
Review finished.
zeegin commentedon Sep 2, 2026
@Agrajaga PR был переработан, проверь пожалуйста под windows
zeegin commentedon Sep 2, 2026
@alkoleft Проверил переработанный вариант под Windows на merged master
72d346c0(head PR45f38dfd), платформа 1С 8.3.27.2130.Реальный запуск через
v8-runner launch thin --c RunUnitTests=<config>успешен: YaXUnit распознал/C, запустил модульТестZybio, результат JUnit — 1 тест, 0 failures, 0 errors. Runner-log завершился сообщением о завершении YAxUnit, после чего процессы 1С закрылись.Итого: передача
/Cи payload отдельными argv на проверенной Windows/1С работает; замечание о необходимости обязательногоraw_argэкспериментом не подтвердилось.Дополнительно:
cargo check --bin v8-runnerна Windows проходит. Целевойcargo test platform::enterpriseсейчас не стартует из-за отдельной Windows-совместимости тестового кода: безcfg(unix)импортированstd::os::unix::fs::PermissionsExtвsrc/use_cases/check_syntax.rsи вызываетсяset_mode.zeegin commentedon Sep 2, 2026
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
a448c000-0555-4375-9b29-0752ebf9aa1c📥 Commits
Reviewing files that changed from the base of the PR and between be558db and e6a210e.
📒 Files selected for processing (3)
src/platform/process.rssrc/use_cases/check_syntax.rssrc/use_cases/run_tests/helpers.rszeegin commentedon Sep 2, 2026
zeegin commentedon Sep 2, 2026
zeegin commentedon Sep 2, 2026
Actionable comments posted: 1
🧹 Nitpick comments (1)
🤖 Prompt for all review comments with AI agents
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
2d3bac15-6d9d-4e35-9a7b-b09dba611ced📥 Commits
Reviewing files that changed from the base of the PR and between 62ed707 and 45f38df.
📒 Files selected for processing (10)
SKILL/references/project-workflows.mddocs/CAPABILITIES.mddocs/CONFIGURATION.mdsrc/cli/args.rssrc/cli/execute.rssrc/config/model.rssrc/domain/runner.rssrc/platform/enterprise.rssrc/use_cases/launch_app.rstests/cli_launch.rszeegin commentedon Sep 2, 2026
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Логируйте количество фактически используемых ключей.
Сейчас сообщение о «resolved» ключах считает значения из конфигурации, хотя ниже в
EnterpriseDslпередаётся результатeffective_enterprise_launch_keys(...). Для запуска Vanessa эти списки могут различаться, поэтому отладочный счётчик будет вводить в заблуждение.Предлагаемое исправление
📝 Committable suggestion
🤖 Prompt for AI Agents
✅ Addressed in commit 62ed707
zeegin commentedon Sep 2, 2026
Исправлено в 62ed707:
additional_launch_keysвычисляется до debug-сообщения, а.len()берётся с того же фактического вектора, который передаётся вEnterpriseDsl. Проверки: 8 целевых тестов,cargo check --all-targets,cargo fmt --checkиgit diff --check.zeegin commentedon Sep 2, 2026
@Agrajaga, спасибо за исправление и проверку. Теперь отладочный счётчик отражает фактически передаваемые вEnterpriseDslключи, включая преобразованный набор для Vanessa.If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!
zeegin commentedon Sep 2, 2026
🎯 Functional Correctness | 🔴 Critical | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
Repository: alkoleft/v8-runner-rust
Length of output: 230
🏁 Script executed:
Repository: alkoleft/v8-runner-rust
Length of output: 50380
🏁 Script executed:
Repository: alkoleft/v8-runner-rust
Length of output: 50380
🌐 Web query:
Rust std::process::Command on Windows command line escaping args() quote arguments documentation💡 Result:
On Windows, Rust's std::process::Command handles arguments differently than on Unix because the Windows API (CreateProcessW) accepts a single command-line string rather than an array [1][2]. Rust is responsible for serializing the arguments passed via.arg or.args into this single string, which the child process then parses [1][3]. Key points regarding argument escaping and quoting on Windows include: Standard Behavior: For most applications that follow standard C run-time argument parsing rules, Rust's default escaping logic is safe and sufficient [1][3]. Arguments are passed literally, meaning shell-specific features like glob patterns, variable expansion, or pipe operators are not interpreted [4][2]. Batch File Caveat: A critical exception exists for.bat and.cmd files [1][3]. Because these are executed via cmd.exe, they utilize non-standard, complex argument parsing rules [1][4]. Rust attempts to escape these arguments automatically, but due to the inherent complexity of cmd.exe, it is not always possible to safely escape every input [1][3]. In scenarios where Rust cannot safely escape an argument for a batch file, it will return an InvalidInput error at runtime when attempting to spawn the process [1][3]. Raw Arguments: If you are interacting with tools that use non-standard parsing or if you need to manually control the command line, you can use the CommandExt::raw_arg method [5][3]. This method appends text to the command line without Rust's automatic quoting or escaping [5][6]. This should be used with extreme caution as it bypasses safety mechanisms and can expose your application to command injection vulnerabilities [1][5]. Security Warning: When dealing with untrusted input, particularly when invoking cmd.exe or batch files, exercise significant caution [1][2]. Maliciously crafted arguments can potentially lead to arbitrary shell command execution [1][3]. Where possible, validate input to a safe, known-good subset (such as alphanumeric characters) before passing it to Command [1][5]. For complex command lines involving batch files, consider writing the arguments to a temporary batch file and executing that file instead of building a complex, dynamic command string [5][7].
Citations:
🌐 Web query:
Rust std::process::Command.raw_arg appends with space documentation💡 Result:
The
raw_argmethod in Rust’sstd::os::windows::process::CommandExttrait does not automatically append a space [1][2]. It appends the provided literal text to the command line without performing any quoting or escaping [3][1]. Becauseraw_argtreats the input as raw text to be added directly to the command line string [4], the responsibility for formatting—including adding necessary spaces between arguments—lies entirely with the caller [1][2]. This method is specifically intended for scenarios where you need to manually construct the command line for applications that do not follow standard argument parsing rules (such ascmd.exe) [1][4]. When usingraw_arg, you must handle the assembly of the command line string manually, ensuring that spaces are included where appropriate to separate distinct arguments [1][2]. It is highly recommended to use this method with caution, as it bypasses the standard library's automatic escaping and can introduce security vulnerabilities if used with untrusted inputs [4][5][6].Citations:
Не разделять
/Cи payload на дваVec<String>при запуске на Windows.build_launch_argsкладёт вargs"/C"и затемc.clone()как разные элементы, аprocess.rsпередаёт их через стандартный запуск, где нет Windows-специфичногоraw_arg. На Windows такойCommand::args(...)не склеит их слитно и payload с пробелами/кавычками попадёт под стандартное экранирование/кавычки, поэтому для1cv8/1cv8cнужно собирать слитную форму/C"payload"черезCommandExt::raw_argвsrc/platform/process.rsс отказом при встроенных кавычках и переводах строк.🤖 Prompt for AI Agents