refactor(runtime): unify session model updates and TUI chat - #1601
Merged
Conversation
Route session model mutations through the Agent Runtime SDK while keeping Core as the sole owner. Split chat mode by private responsibilities and debounce resize redraws without changing public TUI contracts.
limityan
force-pushed
the
yanzhn/runtime-model-chat-resize
branch
from
July 17, 2026 19:00
49edeb2 to
084ed9c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更概述
AgentSessionModelPort,由 Core 的ConversationCoordinator继续持有唯一会话状态;CLI/TUI、Peer Host、ACP、Desktop 与远程 Bot 的活动会话模型写入统一经过 Agent Runtime SDK。modes/chat.rs按职责拆为同一私有 Rust 模块下的子文件,不新增公共 TUI 框架、协议、DTO 或状态 owner。main测试基线修复,不改变运行时行为。范围边界
RuntimeError::Port(NotAvailable),不新增可穷举错误枚举成员。include!组织;resize 不新增 timer/task,不改变事件协议或绘制内容规格。风险与控制
验证
通过:
rustup run nightly cargo fmt --all -- --checknode scripts/check-core-boundaries.mjsrustup run nightly cargo check --workspacerustup run nightly cargo test -p bitfun-cli -- --nocapture(211 passed;其余 CLI 集成/进程测试也通过)rustup run nightly cargo test -p bitfun-agent-runtime --test session_model_sdk -- --nocapture(2 passed)rustup run nightly cargo test -p bitfun-core session_model -- --nocapture(4 passed)git diff --check此前还通过:
cargo test -p bitfun-runtime-portscargo test -p bitfun-agent-runtime -- --nocapturecargo test -p bitfun-acp -- --nocapture(94 passed)pnpm run prepare:mobile-web && cargo test -p bitfun-desktop --lib(107 passed)cargo test --workspace此前执行到services-integrations,本 PR 相关测试均通过;最终有两个位于本 PR 未修改代码的环境测试失败:本地 HTTP 分页端口竞态,以及 Windows 临时目录\\?\路径表示差异。本轮未在独立基线工作树重复执行这两项,也未为其扩大产品代码范围。审核结论
修复后的最终差异已由相互独立的资深架构与产品视角复核;SDK 兼容、resize 绘制、模型切换反馈、持久化恢复和文档事实问题均已闭环,未发现剩余 P0–P3 阻塞。