Skip to content

Add --no-watch flag to disable config file auto-restart #1543

@waldekmastykarz

Description

@waldekmastykarz

Parent: #1534

Problem

Dev Proxy watches devproxyrc.json for changes and auto-restarts when the config file is modified. This is convenient for human developers but is a hazard for AI agents that modify configuration files programmatically.

An agent that:

  1. Starts Dev Proxy
  2. Modifies devproxyrc.json to change plugin settings
  3. Continues testing

...will trigger an unexpected proxy restart in step 2. The agent doesn't know the restart is happening, the proxy is temporarily unavailable, and in-flight requests may be lost.

There's no flag to disable this behavior.

Rationale

Agents need predictable behavior. An agent-driven workflow might involve modifying config between test runs or dynamically adjusting proxy settings. The auto-restart feature, while helpful for humans iterating in a terminal, creates a race condition for automated callers.

Proposed solution

  1. Add a --no-watch flag (or --watch false) to the root command that disables config file watching:

    --no-watch  Disable automatic restart on configuration file changes
    
  2. When --no-watch is set, config changes require a manual restart (which is what agents expect — explicit control).

  3. Document this behavior in root --help — agents need to know about auto-restart even if they don't use --no-watch, so they can plan around it.

Affected code

  • DevProxy/Commands/DevProxyCommand.cs — add --no-watch option
  • DevProxy/Proxy/ConfigFileWatcher.cs (or equivalent) — respect the flag
  • DevProxy/Program.cs — pass flag through restart loop

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions