Skip to content

refactor(acp): route server through assembled runtime - #1590

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:refactor/acp-assembled-runtime
Jul 17, 2026
Merged

refactor(acp): route server through assembled runtime#1590
limityan merged 1 commit into
GCWing:mainfrom
limityan:refactor/acp-assembled-runtime

Conversation

@limityan

@limityan limityan commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • assemble the CLI-hosted ACP server with DeliveryProfile::Acp, validated runtime services, harnesses, and the public Agent Runtime SDK
  • route ACP session creation/listing, dialog submission, cancellation, interaction responses, and Agentic event delivery through the assembled runtime
  • add a session-scoped SDK event subscription owned by the existing Agentic Event Queue so unrelated sessions cannot exhaust an ACP prompt's event budget
  • preserve full persisted restore, model/mode, MCP, client lifecycle, stdio, and protocol projection behind the existing Core/ACP compatibility boundaries
  • add a production-process stdio initialization smoke test and include CLI, ACP, and Agent Runtime tests in the existing CLI CI job

Product and architecture boundaries

  • ACP rejects a second prompt atomically before enqueue while a session is busy; CLI/TUI, Desktop, and remote queue behavior is unchanged
  • prompt completion is scoped to the exact turn; a lagged or closed session event subscription cancels that turn and returns an explicit error
  • the Agentic Event Queue remains the only event owner: the existing global bounded broadcast continues to serve CLI/TUI, while an active ACP prompt uses a temporary 1,024-event channel containing only its session's events
  • the scoped channel is removed when its final receiver is dropped; no per-session forwarding task or second event schema is introduced
  • the existing four-argument CoreProductAgentRuntime::build API remains compatible; ACP event injection is additive through build_acp
  • image prompt blocks are converted into portable runtime attachments without introducing ACP types into shared runtime contracts
  • no ACP wire-schema, UI, keybinding, extension execution, or runtime-owner migration scope is added
  • only stable architecture documentation is updated; implementation process specs and plans are excluded

Runtime impact

Concern Before After
ACP event isolation ACP read the global bounded broadcast An active prompt receives only its session's events through a temporary 1,024-event channel
CLI/TUI event path Existing global broadcast and one legacy queue drain Unchanged; with no scoped subscriber, enqueue adds one atomic fast-path check
Host tasks One legacy queue drain One legacy queue drain; no per-session forwarding task
Prompt admission A queued ACP prompt could cross protocol turn boundaries Busy ACP sessions reject before enqueue under the session lock
Runtime ownership Core coordinator/scheduler/persistence and Agentic Event Queue Unchanged; assembly only selects adapters and services

No additional scheduler, persistence manager, runtime owner, background forwarding task, or protocol schema is introduced. Session-scoped channel memory exists only while a consumer is active and is released with the final receiver.

Validation

  • cargo +nightly test -p bitfun-agent-runtime -p bitfun-acp -p bitfun-cli (all unit, contract, doc, and integration tests passed)
  • production bitfun-cli acp stdio initialize smoke with isolated storage roots
  • cargo +nightly test -p bitfun-core (1,101 passed, 1 ignored; the existing timing-sensitive slow_provider_is_not_respawned_while_healthy_sibling_updates failed only under concurrent compile contention and passed 3/3 in isolation)
  • cargo +nightly fmt --all -- --check
  • node --test scripts/check-core-boundaries.test.mjs
  • node scripts/check-core-boundaries.mjs
  • git diff --check

@limityan
limityan force-pushed the refactor/acp-assembled-runtime branch from f2c2bfc to 910156c Compare July 17, 2026 03:30
@limityan
limityan merged commit b22bbdd into GCWing:main Jul 17, 2026
5 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