[Bug] Multiple conflicting default mode settings between agents.config.json, package.json manifest, and ACP backend
Description
There are multiple conflicting sources of truth for default session mode:
SettingsManager.updateSetting('defaultMode', ...)writes toagents.config.jsonundernanocoder.defaultMode.- The extension manifest (
plugins/vscode/package.json) defines"nanocoder.mode"with default"auto-accept". acpClient._createSession()readsvscode.workspace.getConfiguration('nanocoder').get('mode') || 'auto-accept'. Because the manifest defines a default value,config.get('mode')is always populated, completely masking anydefaultModeset inagents.config.json.- The backend ACP agent (
source/acp/acp-agent.ts:821) hardcodesinitialMode: 'auto-accept'.
Editing the default mode in the extension's Settings panel writes to agents.config.json, which has zero effect on new sessions.
Environment
- OS: Linux (reviewed); macOS / Windows potentially affected
- Node version: >= 22.0.0
- Nanocoder version: 1.31.0
Steps to Reproduce
- Open the Nanocoder Settings panel in VS Code.
- Change the default mode to
normalorplan. - Start a new session.
- Check the mode assigned to the newly created session.
Expected Behavior
Settings configured in the UI should control new session defaults with a documented precedence hierarchy respecting Nanocoder's project and global configuration resolution:
Explicit session selection > VS Code explicit setting (nanocoder.mode) > Project/global configuration (defaultMode) > Fallback default (auto-accept).
Actual Behavior
Changes made in the Settings panel update agents.config.json, but acpClient always applies the manifest default of nanocoder.mode.
Additional Context
- [x] No matching open issue found in issue search performed on 2026-10-12
- [x] Relevant code paths inspected at commit
d5ff9c37
Implementation Notes (optional)
- Files:
plugins/vscode/src/settings-manager.ts:167plugins/vscode/src/acp-client.ts:228-250source/acp/acp-agent.ts:815-825
- In
_createSession(), check whethernanocoder.modewas explicitly configured by the user (usinginspect('mode')). If not explicitly configured, resolvedefaultModefrom project/global Nanocoder configuration before falling back toauto-accept.
@addyCooks can i go for it
I'd like to pick this up. Proposed resolution order:
nanocoder.defaultModeinagents.config.jsonis the source of truth.- The VS Code
nanocoder.modesetting only overrides it when the user set it explicitly. Useconfig.inspect('mode')instead ofget('mode'), sincegetalways returns the manifest default. - The ACP agent reads the configured default instead of hardcoding
initialMode: 'auto-accept', and falls back toauto-acceptonly when nothing is set.
Values get validated against the allowed modes, with unit tests for the resolution order. Could you assign it to me?
Hi @Mahdi-Hasan, thanks for your interest! @Dhirenderchoudhary asked to be assigned to this issue first, so I've assigned it to them. Please have a look at our other open issues, and I'd be happy to assign you one of those.
Thanks @addyCooks, no problem. I've closed #1928.
I'd be glad to take #1930 (string_replace on CRLF files) or #1932 (MCP results keep only the first content block). Neither has a claim yet. Could you assign one of them to me?
Thanks @Mahdi-Hasan for closing #1928. Both #1930 and #1932 are good picks. Which one would you like to take? Please comment on that issue saying you're picking it up, and I'll assign it to you.
Thanks @addyCooks. I've commented on #1932 saying I'm picking it up.