Skip to content

refactor(cli): converge interactive runtime access - #1794

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/cli-tui-runtime-client-boundary
Jul 27, 2026
Merged

refactor(cli): converge interactive runtime access#1794
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/cli-tui-runtime-client-boundary

Conversation

@limityan

@limityan limityan commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • route interactive startup session operations, permission handling, and local /usage turn recording through the existing app-private CliAgentRuntimeClient
  • create one client per interactive flow and share it between StartupPage and ChatMode
  • remove ChatMode's dependency on the full CliRuntimeContext; retain the existing Core compatibility value only for account/session cloud sync
  • document the exact Rust Runtime SDK, CLI event source, Embedded, Shared, and public SDK boundaries

Why

The interactive TUI already had a private Runtime client, but startup, permission, and local turn paths could bypass it and call the Runtime context directly. This change closes those bypasses and removes duplicated session request construction without adding another Runtime owner or transport abstraction.

Compatibility and scope

  • interactive behavior remains Embedded and in-process
  • Headless Exec and CI isolation behavior are unchanged
  • product-aware CLI help and MCP import dispatch are unchanged
  • no SDK Host, Shared IPC, public API, Cargo dependency, CLI flag, process, connection, or background task is added
  • Agent events continue to use the existing CLI event source; they are not claimed as Rust Runtime SDK events
  • Shared IPC remains Health-only with no production consumer

Validation

  • cargo test -p bitfun-cli (338 unit tests plus all CLI integration contracts)
  • cargo check --workspace
  • node scripts/check-core-boundaries.mjs
  • pnpm run check:repo-hygiene
  • pnpm run fmt:rs
  • git diff --check gcwing/main...HEAD

Three independent architecture, behavior, and product reviews covered the complete diff at head cf51c2e. Their final P0/P1/P2 count is zero. The reviews explicitly verified that:

  • the CLI keeps one Runtime owner and reuses one app-private client across startup and chat
  • no terminal/Core API is exposed and no SDK Host or Shared IPC dependency is added
  • Runtime lifetime, permission behavior, workspace binding, MCP shutdown, account sync, Headless Exec, and CI isolation remain unchanged
  • the documentation distinguishes the current Runtime SDK preview and CLI event source from the future public Agent SDK and Shared deployment

Size

  • 1 commit
  • 10 files
  • 157 additions / 76 deletions
  • local design and execution-plan files under .tmp are excluded from this PR

@limityan
limityan merged commit b535278 into GCWing:main Jul 27, 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