Skip to content

Daemon/f 4#120

Merged
chauncygu merged 3 commits into
mainfrom
daemon/f-4
May 12, 2026
Merged

Daemon/f 4#120
chauncygu merged 3 commits into
mainfrom
daemon/f-4

Conversation

@chauncygu
Copy link
Copy Markdown
Contributor

No description provided.

chauncygu and others added 3 commits May 11, 2026 18:14
recipes.md: new sub-section under Section 1 covering self-hosted vLLM
through the custom/ provider — server-side flags, /v1/models discovery,
env-var vs /config base_url, troubleshooting table for the common errors
(missing /v1 suffix, --served-model-name mismatch, tool-call parser).

web-ui.md: short prerequisite block in §Install-and-launch and a
dedicated troubleshooting entry that quotes the exact "ValueError:
custom provider requires a base_url ..." string so users can grep
straight to the fix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Implements the skeleton for RFC 0002 §F-4: each AgentRunner can now run
as a `python -m agent_runner --pipe` subprocess under daemon-side
supervision, so a leak / hang / OOM in one runner can no longer take
down the scheduler or bridges. Off by default — REPL behaviour is
byte-for-byte unchanged unless CHEETAHCLAWS_ENABLE_F4=1 or the
agent_runner_subprocess config key is set.

New modules
  cc_daemon/runner_supervisor.py — lifecycle (start/stop/stop_all/get/
    list_all), 3-phase stop (IPC stop → SIGTERM → SIGKILL, ≤5 s),
    background reader thread that handles iteration_done / log /
    permission_request / notify IPC, crash classification, and best-
    effort persistence to agent_runs / agent_iterations.
  cc_daemon/runner_ipc.py — thin re-export of
    cc_kernel.runner.ipc.JsonLineChannel so daemon and kernel runners
    share one wire-format implementation.
  cc_daemon/agent_methods.py — agent.start / agent.stop / agent.list /
    agent.status JSON-RPC handlers, registered from
    cc_daemon.server.DaemonState alongside system_methods /
    monitor_methods.

Modified
  agent_runner.py — adds the `--pipe` subprocess entry point
    (_pipe_main + _PipeAgentRunner), the _should_use_subprocess()
    dispatcher in start_runner, and routes stop_runner / stop_all
    through both registries.
  cc_config.py — DEFAULTS gains `agent_runner_subprocess: False`.
  cc_daemon/server.py — register agent_methods in __init__.
  docs/RFC/0002-daemon-foundation-roadmap.md — index status bumped
    from TODO to "skeleton in progress" with a full §F-4 status
    addendum listing what's done and what's still follow-up
    (permission routing, bridge notify forwarding, restart policy,
    real-runner e2e, Windows).

Tests (27 new)
  tests/test_cc_daemon_runner_supervisor.py (19)
    — handshake, graceful stop, SIGKILL escalation, kill -9 crash
      detection, IPC shim identity, 9 SQLite persistence cases,
      2 malformed-input safety-net regressions.
  tests/test_cc_daemon_agent_methods.py (10)
    — registration, param validation for all 4 methods, list/status
      when empty, end-to-end list → status → stop with an inline
      runner.

All 104 tests green (supervisor + agent_methods + daemon spike + e2e
daemon + schema + existing agent_runner tests), zero regressions.

POSIX only; Windows path falls back to the legacy threaded runner.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three doc touch-ups so users and reviewers can find the F-4 work
without reading the RFC end-to-end:

  README.md — adds a one-line May 11 entry to the News block summarising
  the new files, the feature flag, and pointing at RFC 0002.

  docs/news.md — full paragraph mirroring the recent-news convention:
  what the threading-mode problem was, the four new components, the
  three self-review bugs caught and fixed, test coverage, what's still
  TODO before the skeleton can promote to MERGED.

  docs/architecture.md — two appends:
    1. "Autonomous agent runner" section gains a paragraph describing
       the opt-in subprocess execution mode (env var / config key /
       POSIX-only) and links to RFC 0002 §F-4.
    2. Daemon module map gains the "Added by the F-4 skeleton" subsection
       listing runner_supervisor.py / runner_ipc.py / agent_methods.py
       and the agent_runner.py `--pipe` entry point alongside the
       existing F-1 / F-2 / F-3 entries — same shape so a reader of
       the Daemon section sees the full file inventory in one place.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@chauncygu chauncygu merged commit ce60334 into main May 12, 2026
6 checks passed
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