[Bug] Xcode hangs when the agent is started with "acp" instead of "--acp": no hint in 1.31.0, and no setup docs
Description
Xcode Intelligence won't connect to nanocoder local agent through ACP, But it does connect to opencode.
Environment
- OS:macOS Apple Max M1
- Node version: 26.4.0
- Nanocoder version: 1.31.0
- Provider: local ollama
- Model: any
Steps to Reproduce
- go to xcode setting inteligence
- configure a new agent
- add the bin path to where nanocoder is in your mac
- add arguments: acp
- open a conversation in xcode
Expected Behavior
conversation should connect with the agent
Actual Behavior
it does not connect and hangs. It is not an xcode problem, opencode can be launched immediately
Logs/Screenshots
Additional Context
- [ x] I have searched existing issues to ensure this is not a duplicate
- [ x] I can reproduce this issue consistently
- [ x] This issue occurs with the latest version of nanocoder
@addyCooks I'd like to work on this. I've reproduced the hang on macOS and tracked down what causes it, happy to put up a fix if you assign it to me.
Thanks for the report! Could you double-check the exact arguments you gave Xcode? Nanocoder's ACP mode is enabled with the flag --acp (e.g. nanocoder --acp), not a bare acp. In 1.31.0 a bare acp just starts the interactive UI, which never talks ACP, so the editor waits forever. That matches what you describe. In the next release it will exit with an "Unknown command" error instead.
If --acp still hangs, please share your Xcode version and the agent log from Xcode. If your folder isn't trusted yet, add --trust-directory to the arguments or run nanocoder there once.
@me-adityaraj8, thanks for offering to help. Could you share what you found on macOS? Let's confirm the cause before we assign it.
Thanks @addyCooks, I came to the same conclusion. Here's what I ran on macOS, piping an ACP initialize request into nanocoder the way an editor does:
- 1.31.0 (from npm),
acp: starts the interactive UI instead of ACP. It prints the directory-trust prompt to stdout and never replies toinitialize; the JSON the client sends just gets read as keypresses. - main,
acp: exits 1 withUnknown command "acp". - main,
--acpin an untrusted folder: exits 1 with the trust message. - main,
--acp --trust-directory: gets past the trust check (it then stopped only because I have no provider configured).
Since opencode acp is a subcommand, people coming from opencode will likely type acp. Would you take a small PR for one of these, plus a short "Setup in Xcode" section in docs/features/acp.md (args --acp --trust-directory)?
- accept
nanocoder acpas an alias for--acp, or - make the error say
Did you mean "--acp"?
Happy to do whichever you prefer.
Thanks @me-adityaraj8, that matches what I saw 👍 For the record, I also reproduced it on Windows with a scripted ACP client piping initialize into the 1.31.0 build:
acp: never answersinitializeand keeps running, so the client waits forever--acp: answersinitializein about 2s andsession/newworks- main with
acp: exits 1 withUnknown command "acp"
I'd keep the fix small: please go ahead with the Did you mean "--acp"? hint (with a test) and a short "Setup in Xcode" section in docs/features/acp.md, and I'll assign it to you. Let's skip the acp alias for now, since it adds a new top-level command. For the docs, please suggest trusting the folder once rather than putting --trust-directory in the args by default, so every folder Xcode opens isn't trusted automatically. A changeset is needed too.