Skip to content

refactor(acp): route session mode updates through runtime#1620

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/acp-session-runtime-cutover
Jul 18, 2026
Merged

refactor(acp): route session mode updates through runtime#1620
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/acp-session-runtime-cutover

Conversation

@limityan

Copy link
Copy Markdown
Collaborator

变更概述

  • 为 Agent Runtime 增加只携带 sessionIdmodeId 的窄会话模式更新端口。
  • 由现有 ConversationCoordinator 实现该端口,并在 Core 的各条既有 Runtime 组装路径中注入同一个 owner。
  • 将 ACP 活动会话的模式更新从 Core compatibility 调用切换到 Runtime SDK;模式校验、Core 持久化、ACP 内存状态更新及通知顺序保持不变。
  • 同步架构与计划文档,明确模式写入和模式目录/配置读取是不同边界。

范围与边界

范围 变更后 本 PR 是否改变行为
ACP 活动会话模式写入 Runtime SDK → 同一 Core owner 仅替换调用边界
ACP session/load 与完整历史回放 继续单次走 Core compatibility
模型/模式目录与提供方配置读取 继续由现有 Core/ACP owner 负责
TUI、GUI、Remote、Server 未新增模式调用、通知或队列行为
MCP、ACP client、stdio/协议生命周期 保持现有归属

不包含扩展能力、HarmonyOS、历史 DTO 泛化、公共附件读取能力、依赖升级或 compatibility 门面的整体删除。

对抗性复审后的收敛

  • 架构复审识别到:为 ACP 历史回放新增公共 History DTO 会形成第二套 transcript 事实源,并可能绕过附件内容的独立授权边界。该方案已完整撤回,本 PR 不包含任何历史读取或恢复接口扩张。
  • 产品复审识别并修正了四处文档中的旧表述。当前文档统一为:活动会话模型/模式写入走 SDK;完整历史、模型/模式目录与提供方配置读取、MCP 与 ACP client 继续留在原 owner。
  • 二次独立复审确认无剩余阻塞项,且 TUI、GUI、Remote 与历史回放没有行为变化。

风险控制

  • Runtime 端口保持可选;未注册时返回结构化 NotAvailable,不隐式降级到其他写路径。
  • Core provider 复用现有 update_session_agent_type,保留规范化、持久化和 NotFound 错误语义。
  • ACP 仍先校验模式,再写 Core;Core 成功后才更新协议状态并发送 CurrentModeUpdate
  • 没有新增存储、并行状态、依赖或跨产品事件。

验证

  • cargo +1.95.0 fmt --all -- --check
  • git diff gcwing/main...HEAD --check
  • node scripts/check-core-boundaries.mjs
  • pnpm run check:repo-hygiene
  • cargo +1.95.0 check --workspace
  • cargo +1.95.0 test -p bitfun-runtime-ports -p bitfun-agent-runtime -p bitfun-acp -p bitfun-cli
  • cargo +1.95.0 test -p bitfun-core session_mode_ -- --nocapture

Add a narrow typed session mode port, wire it to the existing Core owner, and migrate ACP mode changes without changing history replay or other product surfaces.
@limityan
limityan marked this pull request as ready for review July 18, 2026 16:46
@limityan
limityan merged commit 0e16ff5 into GCWing:main Jul 18, 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