Skip to content

fix(rx-go): repair the full dispatch chain — ACP execution, --preset, python3 shim#3

Open
DQT-bit wants to merge 2 commits into
Song-ic:masterfrom
DQT-bit:fix/reasonix-run-preset-flag
Open

fix(rx-go): repair the full dispatch chain — ACP execution, --preset, python3 shim#3
DQT-bit wants to merge 2 commits into
Song-ic:masterfrom
DQT-bit:fix/reasonix-run-preset-flag

Conversation

@DQT-bit

@DQT-bit DQT-bit commented Jun 1, 2026

Copy link
Copy Markdown

修好 rx-go → reasonix dispatch 链路上的 3 个会让整条流程静默失效的问题。按发现顺序,3 个 commit 留在分支历史里。

1. --preset 选项不存在(语法层)

reasonix run 没有 --preset,默认 PRESET=auto 每次都触发 error: unknown option '--preset' exit 1。
→ 先映射成 --model(后被第 2 项覆盖,见下)。

2. reasonix run 只「说」工具不「做」(架构层,核心)

run 模式把工具调用作为文本流式输出(如 <bash .../>),但不执行——多种 config / 措辞实测,文件从不落盘。整条 rx-go 静默产出空结果。

修复:改走 reasonix acp(stdio NDJSON JSON-RPC 的 Agent Client Protocol),新增 bin/rx-acp-dispatch.mjs 作为最小 ACP client:

  • initializesession/newsession/prompt
  • 自动应答 session/request_permission(allow_always)
  • stopReason=end_turn 即完成
  • ACP 真正驱动 write_file / run_command 落地

3. python3 是 Windows Store 占位符(环境层)

很多 Windows 装机上 python3 是 Microsoft Store alias stub:command -v python3 找得到,但一运行就 exit 49。这个码从 rx-go 的 state.json 段泄漏出来,盖住了 dispatch 的真实结果,也让 state.json 没写成。

修复:探测时实跑 --version,取第一个真正可用的解释器(python3 → python),rx-go 和 rx-doctor 各一处。

验证(端到端,非照抄)

全新 spec(spec 内不含实现代码)→ reasonix 经 ACP 自主写出 palindrome.py + test_palindrome.py → 本地 python -m unittest 全过、rx-go exit 0、state.json 正常写入。

环境:Windows 11 · reasonix 0.53.2(npm latest)· Node 24。

🤖 Generated with Claude Code

DQT-bit and others added 2 commits June 1, 2026 11:55
…` mapping

`reasonix run` (reasonix CLI v0.53.x) has no `--preset` flag — its options are
`--model / --system / --effort / --budget / --transcript / --mcp`. The current
dispatch always passes `--preset "$PRESET"` (default `auto`), so commander aborts
with `error: unknown option '--preset'` (exit 1) on every dispatch, breaking the
whole rx-go → reasonix pipeline.

Map the preset to reasonix's real `--model` flag instead, preserving the
flash/pro/auto semantics:
- flash → --model deepseek-v4-flash
- pro   → --model deepseek-v4-pro
- auto  → (omit --model, use config.json default model)

Verified: `bash -n` passes; `reasonix run --preset auto` reproduces the error,
the mapped form runs clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…tore shim

Two deeper failures beyond the `--preset` flag (kept in this branch's history):

1. `reasonix run` never lands files. In run mode the agent streams tool calls
   as *text* (e.g. `<bash .../>`) but does not execute them — verified across
   multiple configs and prompts, files never hit disk. The whole rx-go pipeline
   silently produced nothing.

   Fix: dispatch through `reasonix acp` (the Agent Client Protocol agent on
   stdio NDJSON JSON-RPC) via a new `bin/rx-acp-dispatch.mjs`. ACP actually
   drives write_file / run_command tools. The client does
   initialize → session/new → session/prompt, auto-approves
   session/request_permission, and exits on stopReason=end_turn.

2. `python3` is a Microsoft Store alias stub on many Windows installs:
   `command -v python3` resolves it, but running it exits 49. That exit code
   propagated out of rx-go (state.json block) and masked dispatch success.

   Fix: probe interpreters by actually running `--version`, pick the first that
   works (python3 → python), in both rx-go and rx-doctor.

Verified end-to-end: fresh spec (no reference code in spec) → reasonix writes
palindrome.py + test_palindrome.py via ACP → `python -m unittest` passes,
rx-go exits 0, state.json written.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@DQT-bit DQT-bit changed the title fix(rx-go): reasonix run has no --preset flag → dispatch always fails fix(rx-go): repair the full dispatch chain — ACP execution, --preset, python3 shim Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant