[Bug]: ACP session/new rejects model from spawned process — "model not configured" when called by Open Design
Version line
v2 — Go rewrite (1.x), main-v2 (active development)
Exact version
npm-v1.11.1-rc.1
What happened?
When Open Design spawns reasonix acp as a child process and calls session/new, Reasonix returns:
json-rpc id 2: session/new: model "deepseek-flash" is not configured
The error mentions "deepseek-flash" (a provider name from config.toml), not a model ID. The caller sends the correct full model ID (deepseek-flash/deepseek-v4-flash).
Key evidence:
- Correct model ID is being sent - confirmed by caller run events
- Running reasonix acp directly from terminal always succeeds - only fails when spawned by another process
- Same error regardless of mcpServers, cwd, or REASONIX_ACP_SYSTEM_APPEND
I expected session/new to succeed regardless of how Reasonix is spawned.
Steps to reproduce
- Configure ~/.reasonix/config.toml with DeepSeek API providers and default_model = "deepseek/deepseek-v4-flash"
- Verify reasonix acp from terminal: pipe initialize + session/new → succeeds
- Spawn reasonix acp from another process with same messages → fails with "model deepseek-flash is not configured"
- Full repro: Open Design → Settings → Execution → DeepSeek Reasonix → Test
OS / platform
Windows 10
Relevant logs or output
Root cause identified (with fix) When Reasonix is spawned as a child process (e.g. by Open Design), config.LoadForRoot() → userConfigLoadPath() → reasonixHomeDir() may fail to locate the user's config.toml, falling back to built-in defaults where DefaultModel = "deepseek-flash". The built-in provider has no API key → Configured() returns false → model "deepseek-flash" is not configured.
Reproduction Spawn reasonix acp from Node.js child_process.spawn with minimal env Send session/new — fails with model "deepseek-flash" is not configured Same session/new from terminal works fine Workaround Set REASONIX_HOME env var to the config directory before spawning. For Open Design, the fix was adding REASONIX_HOME to the agent def's env block (nexu-io/open-design#4741).
Suggested fix Reasonix could improve child-process config discovery: if userConfigLoadPath() returns empty or the file isn't found through the normal resolution path, try os.UserConfigDir() / os.UserHomeDir() as additional fallbacks before falling back to built-in defaults.
Thanks for the detailed repro and root-cause notes.
This was fixed by #5304, merged in 5e7cdac33e03402c423130ecfb2aafb409411db1. Reasonix now keeps the existing precedence (REASONIX_HOME first, then the normal Windows config dir) and adds a Windows fallback to %USERPROFILE%\AppData\Roaming\reasonix when the OS config directory lookup is unavailable. That prevents ACP child-process launches from silently falling back to built-in defaults and then reporting model "deepseek-flash" is not configured even though the user's config exists.
Verification passed on the PR, including the Windows CI job, race/lint/coverage checks, and the focused config/ACP/boot test suites.
Release note: this merge is not included in the currently published v1.12.0 / desktop-v1.12.0 releases, so users on those builds still need the REASONIX_HOME workaround until the next release or a build from main-v2 includes the fix.