Skip to content

feat(daemon): allow idle exit during MCP sessions - #268

Open
MR-MaoJiu wants to merge 1 commit into
cocoindex-io:mainfrom
MR-MaoJiu:agent/allow-mcp-idle-exit
Open

feat(daemon): allow idle exit during MCP sessions#268
MR-MaoJiu wants to merge 1 commit into
cocoindex-io:mainfrom
MR-MaoJiu:agent/allow-mcp-idle-exit

Conversation

@MR-MaoJiu

Copy link
Copy Markdown

Summary

  • add daemon.keep_alive_with_mcp, defaulting to true for backward compatibility
  • allow users to set it to false so the daemon can reach its normal idle timeout while an MCP client remains connected
  • validate the setting as a strict YAML boolean and document it in the README and CCC skill reference

Why

The MCP server currently sends daemon heartbeats for the lifetime of the MCP session. Long-lived editor and agent sessions therefore keep the daemon鈥攁nd potentially its embedding model memory鈥攔esident even when no code search is happening.

With keep_alive_with_mcp: false, only the synthetic MCP heartbeat is disabled. Active requests, indexing, and the existing idle-timeout protections are unchanged. A later real request transparently starts the daemon again through the existing client path.

Compatibility

The default remains true, so existing installations retain their current low-latency behavior unless users explicitly opt into idle exit.

Validation

  • uv run prek run --all-files --verbose --show-diff-on-failure
  • 301 tests passed; 8 Docker end-to-end tests deselected
  • Ruff, Ruff format, gitleaks, uv-lock, and mypy all passed

@MR-MaoJiu
MR-MaoJiu marked this pull request as ready for review August 5, 2026 05:44
@badmonster0
badmonster0 requested a review from georgeh0 August 5, 2026 06:46
@badmonster0

Copy link
Copy Markdown
Member

thanks for the contribution! @georgeh0 can help take a look!

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.

2 participants