Skip to content

feat(cli): add Runtime Host-backed TUI client adapter - #1676

Closed
M4n5ter wants to merge 2 commits into
apache:mainfrom
M4n5ter:feat/runtime-host-tui-client-adapter
Closed

feat(cli): add Runtime Host-backed TUI client adapter#1676
M4n5ter wants to merge 2 commits into
apache:mainfrom
M4n5ter:feat/runtime-host-tui-client-adapter

Conversation

@M4n5ter

@M4n5terM4n5ter commented Jul 31, 2026

Copy link
Copy Markdown
Member
English

Summary

Add a Runtime Host-backed TUI adapter and an isolated executable harness, allowing the CLI to act as an independent client of shared Session authority.

The adapter maps TUI operations onto Runtime Host protocols, projects durable transcripts and live observations into the existing CLI model, and preserves local TUI behavior while another client is driving the same Session.

Shared Session behavior

  • Observe and render turns started by another client.
  • Join an active turn through a bounded semantic replay followed by live frames, with an atomic cut that avoids gaps and duplicates.
  • Converge explicitly across active, idle, and unavailable observation states so a local fallback is not silently lost during handoff or failure.
  • Keep stop, interrupt, and activity state coherent across overlapping local, remote, and control operations.

Runtime Host transcript and replay

  • Add a bounded v0 transcript query with revision-pinned continuation leases.
  • Bound replay by both UTF-8 content and encoded wire size while preserving Unicode code points.
  • Provide an isolated, execution-capable harness for integration and multi-client testing.

Boundaries

  • This does not cut the normal CLI over to Runtime Host yet.
  • Compaction and working-directory changes are not exposed through this adapter yet.
  • Desktop activation remains a separate slice.
  • The wire protocol remains v0 before the first public release.

Validation

  • Runtime Host tests: 566/566 passed.
  • CLI tests: 493/493 passed.
  • Workspace build and typecheck passed.
  • Biome format and lint checks passed.
  • Diff and credential hygiene checks passed.
  • A real three-TUI openrouter/free scenario verified mid-stream joining from the replayed start through the live terminal frame.

Part of #1167 and #853.

中文

概要

新增基于 Runtime Host 的 TUI 适配器和隔离的可执行测试入口,使 CLI 可以作为共享 Session 权威状态的独立客户端运行。

该适配器把 TUI 操作映射到 Runtime Host 协议,将持久 transcript 和实时 observation 投影到现有 CLI 模型;当另一个客户端正在驱动同一 Session 时,也能保持本地 TUI 行为一致。

共享 Session 行为

  • 观察并渲染由其他客户端发起的 turn。
  • 在 turn 执行期间加入时,先接收有界的语义回放,再衔接实时帧;通过原子切点避免缺失或重复。
  • 明确区分 active、idle 和 unavailable 状态,避免客户端交接或 observation 故障时静默丢失本地 fallback。
  • 在本地、远端和控制操作重叠时,保持 stop、interrupt 和 activity 状态一致。

Runtime Host transcript 与回放

  • 新增有界的 v0 transcript 查询和固定 revision 的 continuation lease。
  • 同时按 UTF-8 内容和编码后 wire 大小限制回放,并保持 Unicode code point 完整。
  • 提供隔离、可执行的 harness,用于集成和多客户端测试。

边界

  • 本 PR 尚未把常规 CLI 切换到 Runtime Host。
  • 该适配器暂未暴露 compaction 和工作目录切换。
  • Desktop 激活仍是独立 slice。
  • 首次公开发布前,wire protocol 继续保持 v0。

验证

  • Runtime Host 测试:566/566 通过。
  • CLI 测试:493/493 通过。
  • Workspace build 与 typecheck 通过。
  • Biome format 与 lint 检查通过。
  • Diff 与凭据卫生检查通过。
  • 使用 openrouter/free 的真实三 TUI 场景验证了执行中途加入:从回放起点连续显示到实时终止帧。

属于 #1167#853 的一部分。

@M4n5ter
M4n5terforce-pushed the feat/runtime-host-tui-client-adapter branch from 49fecbe to 7093f0aCompareAugust 2, 2026 17:49
@M4n5ter

Copy link
Copy Markdown
MemberAuthor
English

This early adapter-only draft has been superseded by the subsequent Runtime Host TUI slices and the atomic production cutover in #2420. The current implementation includes the TUI transcript, multi-client convergence, and production ownership behavior through the newer architecture.

Closing this stale draft in favor of the landed implementation.

简体中文

这个早期仅包含 adapter 的 draft 已被后续 Runtime Host TUI slices,以及 #2420 的原子 production cutover 取代。当前实现已经通过更新后的架构包含 TUI transcript、多 client convergence 与 production ownership 行为。

因此关闭这个已过时的 draft,以已经合入的实现为准。

@M4n5terM4n5ter closed this Aug 8, 2026
Sign up for freeto 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

@M4n5ter