Skip to content

fix(config): warn when common-config disables Claude Monitor tool - #418

Open
SomSamantray wants to merge 4 commits into
SaladDay:mainfrom
SomSamantray:fix/warn-disable-monitor-traffic
Open

fix(config): warn when common-config disables Claude Monitor tool#418
SomSamantray wants to merge 4 commits into
SaladDay:mainfrom
SomSamantray:fix/warn-disable-monitor-traffic

Conversation

@SomSamantray

Copy link
Copy Markdown

Setting CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC in a Claude common-config snippet silently disabled Claude Code's Monitor tool — including for anyone who copied the exact example the README recommends. Neither the CLI nor the TUI said anything about it.

config common set, config common extract --save, and the TUI's common-config editor now print (or toast) a non-blocking warning when the resulting snippet would disable Monitor traffic for Claude; every other app type and every non-truthy value is unaffected. Both READMEs now flag the same side effect next to the documented example.

Added unit tests for the detection helper (truthy/falsy/absent-key/non-Claude cases) and behavioral tests for the CLI and TUI paths, including a regression test for a toast-ordering edge case caught during review (the TUI's single-toast state could otherwise let a later reconciliation-error toast silently overwrite the warning). cargo test passes for the touched modules.

Fixes #184

Setting CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC in a Claude common-config
snippet silently disables Claude Code's Monitor tool. Detect it in the
CLI (config common set / extract --save) and TUI common-config editor
and surface a non-blocking warning instead of applying it silently.

Fixes SaladDay#184
The documented CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC snippet disables
Claude Code's Monitor tool. Add an inline comment and a callout next to
the example in both READMEs so copying it isn't a silent surprise.

Related to SaladDay#184
Both call sites repeated the same "print success, then conditionally
print the warning" block. Extract print_monitor_traffic_warning_if_disabled
to remove the duplication.
…erwrite

Code review findings:
- AGENTS.md/CLAUDE.md require durable logic shared between the CLI and
  TUI to live in src/services/, not src/cli/commands/. Move
  common_config_snippet_disables_monitor_traffic onto ProviderService
  and have both the CLI and TUI call it from there.
- The TUI save handler could still silently drop the Monitor-traffic
  warning: a later Codex-form-reconciliation-error toast could overwrite
  the just-pushed warning toast, since there is no toast queue. Defer
  the final toast decision until after reconciliation runs, and always
  fold the warning into whichever toast ends up being shown.
@SaladDay

Copy link
Copy Markdown
Owner

Thanks — this is a useful fix, but it is not ready to merge yet:

  • Claude treats any non-empty value as enabled; "0" and "false" still disable nonessential traffic. The current detector and tests incorrectly treat them as false.
  • DISABLE_TELEMETRY also disables Monitor but is not detected.
  • cargo fmt --check currently fails.

Please fix these issues and add assertions for the actual CLI warning output (set and extract --save). I also suggest removing the variable from the primary README copy-paste example and keeping the warning in the advanced documentation. Happy to re-review afterward.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Common Config Snippet 中的 CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC 会静默禁用 Monitor 工具

2 participants