Skip to content

[Bug] Multiple conflicting default mode settings between agents.config.json, package.json manifest, and ACP backend #1722

Open

Description

@akramcodez

Description

There are multiple conflicting sources of truth for default session mode:

  1. SettingsManager.updateSetting('defaultMode', ...) writes to agents.config.json under nanocoder.defaultMode.
  2. The extension manifest (plugins/vscode/package.json) defines "nanocoder.mode" with default "auto-accept".
  3. acpClient._createSession() reads vscode.workspace.getConfiguration('nanocoder').get('mode') || 'auto-accept'. Because the manifest defines a default value, config.get('mode') is always populated, completely masking any defaultMode set in agents.config.json.
  4. The backend ACP agent (source/acp/acp-agent.ts:821) hardcodes initialMode: '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

  1. Open the Nanocoder Settings panel in VS Code.
  2. Change the default mode to normal or plan.
  3. Start a new session.
  4. 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

  • No matching open issue found in issue search performed on 2026-10-12
  • Relevant code paths inspected at commit d5ff9c37

Implementation Notes (optional)

  • Files:
    • plugins/vscode/src/settings-manager.ts:167
    • plugins/vscode/src/acp-client.ts:228-250
    • source/acp/acp-agent.ts:815-825
  • In _createSession(), check whether nanocoder.mode was explicitly configured by the user (using inspect('mode')). If not explicitly configured, resolve defaultMode from project/global Nanocoder configuration before falling back to auto-accept.

Activity

  1. added
    bug
    on Oct 12, 2026
  2. added
    needs-triage
    architecture
    area:agent
    area:vscode
    and removed
    needs-triage
    on Oct 12, 2026
  3. Dhirenderchoudhary commented on Oct 12, 2026

    @Dhirenderchoudhary
    Contributor

    @addyCooks can i go for it

  4. Mahdi-Hasan commented on Nov 2, 2026

    @Mahdi-Hasan
    Contributor

    I'd like to pick this up. Proposed resolution order:

    1. nanocoder.defaultMode in agents.config.json is the source of truth.
    2. The VS Code nanocoder.mode setting only overrides it when the user set it explicitly. Use config.inspect('mode') instead of get('mode'), since get always returns the manifest default.
    3. The ACP agent reads the configured default instead of hardcoding initialMode: 'auto-accept', and falls back to auto-accept only when nothing is set.

    Values get validated against the allowed modes, with unit tests for the resolution order. Could you assign it to me?

  5. added a commit that references this issue on Nov 2, 2026
    ba834bd
  6. addyCooks commented on Nov 3, 2026

    @addyCooks
    Collaborator

    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.

  7. Mahdi-Hasan commented on Nov 3, 2026

    @Mahdi-Hasan
    Contributor

    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?

  8. addyCooks commented on Nov 4, 2026

    @addyCooks
    Collaborator

    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.

  9. Mahdi-Hasan commented on Nov 4, 2026

    @Mahdi-Hasan
    Contributor

    Thanks @addyCooks. I've commented on #1932 saying I'm picking it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

architecturearea:agentarea:vscodebug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions