Skip to content

feat(cli): add Runtime Host-backed TUI sessions - #2308

Merged
M4n5ter merged 4 commits into
mainfrom
feat/cli-runtime-host-tui
Aug 6, 2026
Merged

feat(cli): add Runtime Host-backed TUI sessions#2308
M4n5ter merged 4 commits into
mainfrom
feat/cli-runtime-host-tui

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Aug 6, 2026

Copy link
Copy Markdown
Member
English

Summary

Add the first Runtime Host-backed CLI adapter slice: a shared asynchronous Session facade and a TUI implementation that uses Host-owned Session state, execution, continuity, interactions, queues, and Runtime Resources.

This is part of #2010 Stage 4. The existing embedded CLI remains the default owner; the Host-backed candidate is selected explicitly with MAKA_CLI_RUNTIME_OWNER=runtime-host. The two owners are never active for the same CLI process, and the Host path does not fall back to embedded state.

What changed

  • replace the TUI's synchronous Runtime-shaped assumptions with an asynchronous MakaSessionDriver product boundary;
  • keep the existing embedded implementation behind the same boundary while moving its bootstrap into a dedicated command path;
  • add a Runtime Host driver for Session discovery, create/switch/revision operations, configuration, transcript loading, Turn execution, cancellation, Interaction settlement, queue/steering, and Runtime Resource updates;
  • atomically join an active Turn from a canonical transcript snapshot plus live subscription frames;
  • adopt Turns started by another Client, including queued successor Turns, without losing or duplicating transcript content;
  • fence stale reconnect and reattach work by Session generation so an older Client operation cannot replace current state or block a newer Session;
  • expose shared Runtime Host catalog reading and canonical Session projection through an explicit adapter layer, reused by Desktop and CLI;
  • preserve raw submitted Message identity while allowing Host-side Skill preparation for idle, steering, and follow-up admission.

User impact

The candidate TUI can attach to the same Runtime Host Session as another Client and continue observing and controlling it through the existing terminal experience. Existing CLI behavior remains unchanged unless the Runtime Host owner is explicitly selected.

Verification

  • npm --workspace maka-agent test — 494 passed
  • Runtime Host execution message and recovery journeys — 10 passed
  • Runtime Host Session driver concurrency suite — 15 passed
  • npm --workspace @maka/desktop run build:main
  • Biome and git diff --check
简体中文

概要

加入首个由 Runtime Host 支撑的 CLI adapter slice:一个共享的异步 Session facade,以及使用 Host-owned Session state、execution、continuity、Interaction、queue 和 Runtime Resource 的 TUI 实现。

这是 #2010 Stage 4 的一部分。现有 embedded CLI 继续作为默认 owner;只有显式设置 MAKA_CLI_RUNTIME_OWNER=runtime-host 才会选择 Host-backed candidate。同一 CLI 进程不会同时激活两个 owner,Host 路径也不会回退到 embedded state。

变更内容

  • 用异步 MakaSessionDriver 产品边界替换 TUI 对同步 Runtime-shaped API 的假设;
  • 让现有 embedded 实现继续位于同一边界后方,并将其 bootstrap 拆入独立 command path;
  • 新增 Runtime Host driver,覆盖 Session discovery、create/switch/revision、配置、transcript 加载、Turn execution、取消、Interaction settlement、queue/steering 与 Runtime Resource update;
  • 通过 canonical transcript snapshot 与 live subscription frame 的原子边界加入正在执行的 Turn;
  • 接管其他 Client 启动的 Turn,包括 queue 自动启动的 successor Turn,同时避免 transcript 丢失或重复;
  • 通过 Session generation 隔离过期 reconnect/reattach,避免旧 Client operation 覆盖当前状态或阻塞更新的 Session;
  • 通过显式 adapter layer 暴露共享 Runtime Host catalog reader 与 canonical Session projection,由 Desktop 和 CLI 共同复用;
  • 在允许 Host 为 idle、steering 和 follow-up admission 准备 Skill 内容的同时,保留用户原始提交 Message 的身份。

用户影响

候选 TUI 可以连接到其他 Client 使用的同一个 Runtime Host Session,并通过现有终端体验继续观察和控制。除非显式选择 Runtime Host owner,否则现有 CLI 行为不变。

验证

  • npm --workspace maka-agent test — 494 项通过
  • Runtime Host execution message 与 recovery journey — 10 项通过
  • Runtime Host Session driver 并发套件 — 15 项通过
  • npm --workspace @maka/desktop run build:main
  • Biome 与 git diff --check

@M4n5ter
M4n5ter force-pushed the feat/cli-runtime-host-tui branch from 5e65585 to 49bc4f2 Compare August 6, 2026 12:25
@M4n5ter
M4n5ter marked this pull request as ready for review August 6, 2026 12:32
@M4n5ter
M4n5ter merged commit 782533f into main Aug 6, 2026
12 checks passed
@M4n5ter
M4n5ter deleted the feat/cli-runtime-host-tui branch August 6, 2026 12:32
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