Skip to content

Add foreground local daemon command - #431

Merged
delete-cloud merged 1 commit into
mainfrom
dogfood/local-daemon-command
Jun 2, 2026
Merged

delete-cloud merged 1 commit into
mainfrom
dogfood/local-daemon-command

Conversation

@delete-cloud

@delete-cloud delete-cloud commented Jun 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add coding_agent daemon as a foreground local daemon control-plane command
  • reuse the existing HTTP control-plane app and config resolution while preserving serve behavior
  • document daemon as the local product entrypoint and call out that background lifecycle/IPC/client pairing are future slices
  • add CLI help and startup tests

Tests

  • uv run pytest tests/cli/test_entrypoint_contract.py -v
  • uv run pytest tests/cli/test_remote_client.py -k "serve_config or daemon_command" -v
  • uv run ruff check src/coding_agent/cli/main.py src/coding_agent/cli/serve_command.py tests/cli/test_entrypoint_contract.py tests/cli/test_remote_client.py
  • git diff --check

Review fallback

If CodeRabbit is rate-limited, local subagent P1/P2 review is required before merge.

Summary by CodeRabbit

  • New Features

    • Added a new daemon command that starts a foreground local control plane, reusing the same HTTP infrastructure as the existing server command.
  • Documentation

    • Updated README and project documentation to describe the new daemon command as the local product foreground entrypoint.
  • Tests

    • Added tests for the daemon command startup behavior and CLI help availability.

@coderabbitai

coderabbitai Bot commented Jun 2, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: dd3e4532-ecde-4d90-a89c-064a5e7d38b2

📥 Commits

Reviewing files that changed from the base of the PR and between 764980c and 9f87cb7.

📒 Files selected for processing (7)
  • coding-agent/.opencode/prompts/tasks/local-daemon-pr9-foreground-daemon-command.md
  • coding-agent/README.md
  • coding-agent/docs/dogfood/CURRENT_STATE.md
  • coding-agent/src/coding_agent/cli/main.py
  • coding-agent/src/coding_agent/cli/serve_command.py
  • coding-agent/tests/cli/test_entrypoint_contract.py
  • coding-agent/tests/cli/test_remote_client.py

📝 Walkthrough

Walkthrough

This PR adds a daemon CLI command that starts a foreground local control plane by extracting shared HTTP server startup logic into a parameterized helper, rewriting serve and introducing daemon as thin wrappers, wiring both into the CLI, adding tests, and updating documentation.

Changes

Foreground Daemon Command

Layer / File(s) Summary
Shared HTTP control plane startup helper
coding-agent/src/coding_agent/cli/serve_command.py
_run_http_control_plane helper extracts server startup logic parameterized by host, port, config_path, and a label; prints a startup message, runs Uvicorn, and restores environment state in a finally block.
Daemon and serve CLI commands
coding-agent/src/coding_agent/cli/serve_command.py, coding-agent/src/coding_agent/cli/main.py
serve is rewritten as a thin wrapper delegating to the shared helper with label "HTTP server"; new daemon command uses the same signature and delegates with label "local daemon control plane"; both are imported and registered in the CLI entry point.
Daemon command test and test refactoring
coding-agent/tests/cli/test_remote_client.py, coding-agent/tests/cli/test_entrypoint_contract.py
New test mocks Uvicorn and verifies the daemon command invokes successfully with the expected startup message; existing test assertions are refactored from single-line tuple iteration into multi-line loops.
Task specification and user documentation
coding-agent/.opencode/prompts/tasks/local-daemon-pr9-foreground-daemon-command.md, coding-agent/README.md, coding-agent/docs/dogfood/CURRENT_STATE.md
Task spec defines scope and out-of-scope boundaries; README adds capability bullet and HTTP server section showing both daemon and serve commands with future-work notes; dogfood docs clarify daemon as the local product foreground entrypoint and list missing capabilities.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • delete-cloud/Coding-Agent-Loop#375: Main PR's CLI command wiring and HTTP control-plane startup refactor directly build on the earlier CLI entrypoint infrastructure where serve was initially implemented.
  • delete-cloud/Coding-Agent-Loop#272: Main PR's documentation update to coding-agent/docs/dogfood/CURRENT_STATE.md is directly related to the retrieved PR's dogfood "current state" mapping work in that same doc area.

Poem

🐰 A daemon command hops into the ring,
Reusing the HTTP server's wing!
With helper extracted, both serve and daemon sing—
Foreground control planes, what joy they bring! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a foreground local daemon command to the CLI, which is the primary focus across all modified files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dogfood/local-daemon-command

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@delete-cloud
delete-cloud merged commit 8b53e60 into main Jun 2, 2026
1 check passed
@delete-cloud
delete-cloud deleted the dogfood/local-daemon-command branch June 2, 2026 15:55
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.

1 participant