Skip to content

fix(bare): skip MCP connections, gateway spawn, and graph config in --bare mode#3334

Merged
bug-ops merged 3 commits intomainfrom
3298-bare-mode-mcp-skip
Apr 24, 2026
Merged

fix(bare): skip MCP connections, gateway spawn, and graph config in --bare mode#3334
bug-ops merged 3 commits intomainfrom
3298-bare-mode-mcp-skip

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Apr 24, 2026

Summary

  • agent_setup::build_tool_setup: add bare: bool parameter; skip connect_all() and spawn_refresh_task() when bare=true, returning empty Vecs
  • runner.rs gateway spawn (both #[cfg(feature = "prometheus")] and #[cfg(all(feature = "gateway", not(feature = "prometheus")))] paths): guard with !exec_mode.bare
  • runner.rs agent.with_graph_config(): skip unconditional call in bare mode

Test plan

  • 3 new unit tests: bare_flag_skips_mcp_connect_guard, bare_flag_skips_gateway_spawn_guard, bare_flag_skips_graph_config_guard
  • All 8264 existing tests pass
  • cargo +nightly fmt --check clean
  • cargo clippy --workspace -- -D warnings clean

Closes #3298

@github-actions github-actions Bot added documentation Improvements or additions to documentation bug Something isn't working size/M Medium PR (51-200 lines) labels Apr 24, 2026
@bug-ops bug-ops enabled auto-merge (squash) April 24, 2026 02:45
bug-ops added 3 commits April 24, 2026 04:53
…-bare mode

Add exec_mode.bare guards to three previously unguarded call sites:
- agent_setup::build_tool_setup: skip connect_all() and spawn_refresh_task()
  when bare=true, returning empty tool/outcome vectors instead
- runner.rs gateway spawn (#cfg prometheus and non-prometheus paths): guard
  with !exec_mode.bare so no gateway server is started in bare mode
- runner.rs agent.with_graph_config(): skip unconditional call in bare mode

Add three unit tests mirroring the existing bare-mode guard test pattern:
bare_flag_skips_mcp_connect_guard, bare_flag_skips_gateway_spawn_guard,
bare_flag_skips_graph_config_guard.

Closes #3298
@bug-ops bug-ops force-pushed the 3298-bare-mode-mcp-skip branch from 34f6aea to 9a6a5fa Compare April 24, 2026 02:53
@bug-ops bug-ops merged commit 67d806a into main Apr 24, 2026
32 checks passed
@bug-ops bug-ops deleted the 3298-bare-mode-mcp-skip branch April 24, 2026 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bare mode: MCP connections established despite --bare skip guarantee

1 participant