nanocoder icon indicating copy to clipboard operation
nanocoder copied to clipboard

[Bug] nanocoder config list/show/diff doesn't know about autoCommit, formatters, hooks, sandbox and notifications

Open addyCooks opened this issue 1 month ago • 1 comments

Description

nanocoder config list, show and diff use a hand-written list of keys (blockSpecs() in source/config/effective-config.ts). It was never updated for autoCommit, formatters, hooks, sandbox and notifications, so those settings can't be shown or compared, even though the loader reads them. config diff is a natural way to check what a cloned repo's config will run, and it hides the keys that run shell commands or create commits.

Environment

  • OS: Windows 11 (10.0.26300)
  • Node version: 22.22.3
  • Nanocoder version: 1.31.0 (main at 6eaff7af)
  • Provider / Model: not relevant

Steps to Reproduce

  1. In a project, create agents.config.json with {"nanocoder": {"autoCommit": true, "formatters": [{"match": ["**/*.js"], "command": "echo formatted", "name": "fmt"}], "hooks": {"post-tool-use": [{"command": "echo hook"}]}, "sandbox": true, "notifications": {"enabled": true}, "alwaysAllow": ["read_file"]}}.
  2. Run nanocoder config list.
  3. Run nanocoder config show nanocoder.alwaysAllow, then nanocoder config show nanocoder.autoCommit (and the same for formatters, hooks, sandbox, notifications).
  4. Run nanocoder config diff.

Expected Behavior

Every key the loader reads appears in config list and config diff, and config show <key> finds it.

Actual Behavior

Only alwaysAllow (the control) is found:

33:nanocoder.alwaysAllow                   ["read_file"]    project  agents.config.json

$ nanocoder config show nanocoder.autoCommit
No configuration key matching "nanocoder.autoCommit".
Run "nanocoder config list" to see every resolved key.
(exit 1; the same for formatters, hooks, sandbox and notifications)

A unit-level check also fails: resolveEffectiveConfig() returns no entry for autoCommit, formatters, hooks, sandbox or notifications.

Suggested Fix

  • source/config/effective-config.ts (blockSpecs(), lines 351-433): it lists 12 keys. AppConfig in source/types/config.ts (lines 393-483) also has hooks (425), formatters (429), notifications (445), sandbox (477), autoCommit (480) and lspServers (402). Add a spec entry for each, redacting anything secret-like the same way the other entries do.
  • Add a test that fails when they drift apart again: for every key under nanocoder in schemas/agents.config.schema.json (plus notifications), check that resolveEffectiveConfig() can show it.

Additional Context

  • Related: #1123 (added the command) and #1006 (the original request). Open PRs #1525 (verification) and #1564 (channels) each add their own row, but not the missing ones above.
  • I did not test lspServers.
  • [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 avatar Oct 09 '26 19:10 addyCooks

Interested in taking this up can you assign this to me @addyCooks

Vishesh-Verma-07 avatar Oct 16 '26 03:10 Vishesh-Verma-07