Skip to content

refactor(daemon): atomic agent-driver cutover - #504

Draft
gusye1234 wants to merge 104 commits into
mainfrom
refactor/agent-driver-atomic-cutover
Draft

refactor(daemon): atomic agent-driver cutover#504
gusye1234 wants to merge 104 commits into
mainfrom
refactor/agent-driver-atomic-cutover

Conversation

@gusye1234

@gusye1234 gusye1234 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Why we need this PR?

Closes #

The daemon previously owned separate vendor runtime implementations, including dead backends and duplicated lifecycle logic. This made root-turn ownership, message admission, reset/model-switch replacement, stop/cleanup, and adapter extension behavior inconsistent and difficult to verify.

This PR makes one atomic cutover to a typed logical-session boundary, retains only Claude, Codex, Cursor, OpenCode, and Pi, and removes the legacy implementations in the same change.

What changed

  • Added the nested workspace package @alook/agent-driver at src/daemon/agent-driver.
    • It is independently buildable and publishable for external hosts and adapter authors.
    • The daemon consumes its public SDK at build time and publishes a self-contained bundle; daemon users do not install a runtime dependency on @alook/agent-driver.
  • Added public root, host, adapter-author, and testing entry points with generated API reports and an exact-head independent API-owner guard.
  • Migrated Claude, Codex, Cursor, OpenCode, and Pi to the common logical-session contract.
  • Removed Gemini, Kimi, Copilot, Antigravity, and the daemon-owned legacy driver implementations.
  • Preserved stored removed-runtime rows as unavailable until a user explicitly switches them.
  • Added session-epoch/root-turn ownership, exact-once admission and requeue semantics, reset/model-switch replacement safety, bounded stop/cleanup, and shared diagnostic scrubbing.
  • Added package/build/publish checks so @alook/agent-driver can be released independently while the daemon continues to bundle the same source commit.

Current exact head: 438cccd7a1951c03cef6431d7a152f8a49b37c63.

Verification

  • Independent exact-head code review: PASS.
  • Full workspace typecheck, lint, tests, knip, Windows, CI Gate, and UI Playwright E2E 5/5: PASS.
  • Codecov exact-head diff coverage: 100%.
  • Real local-dev browser + daemon QA for Claude, Codex, Cursor, OpenCode, and Pi:
    • initial DM exact reply;
    • browser Reset and immediate post-reset DM exact reply;
    • watchdog/idle-stop and process cleanup;
    • live Cursor/OpenCode production daemon-stop cleanup with no orphan processes.
  • Deterministic regressions cover child/subagent terminal isolation and the reset/model-switch old-stop/new-session race.
  • Additional owner-requested real QA for four-backend subagent stability and per-capability working/burst delivery is in progress. The PR remains Draft until those results and exact-head API-owner approval are complete.

Checklist

  • Tests added/updated as needed
  • All current CI checks pass (the API-owner guard intentionally remains pending until an allowlisted owner approves this exact head)
  • PR targets the correct branch

Impact Areas

  • Shared library (@alook/shared)
  • Web app (@alook/web)
  • CLI (@alook/cli)
  • Email Worker (@alook/email-worker)
  • WebSocket DO (@alook/ws-do)
  • CI/CD
  • Other: @alook/daemon, @alook/agent-driver, runtime lifecycle and packaging

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@gusye1234
gusye1234 marked this pull request as ready for review August 19, 2026 19:45
@gusye1234
gusye1234 requested a review from a team as a code owner August 19, 2026 19:45
@gusye1234
gusye1234 marked this pull request as draft August 20, 2026 03:01
@gusye1234
gusye1234 marked this pull request as ready for review August 20, 2026 03:15
@gusye1234
gusye1234 marked this pull request as draft August 20, 2026 03:32
@gusye1234 gusye1234 added the api-additive Additive published API surface change requiring current-head owner approval label Aug 20, 2026
@gusye1234 gusye1234 changed the title refactor: atomic agent-driver cutover refactor(daemon): atomic agent-driver cutover Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-breaking Breaking published API surface change requiring contract version bump and approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant