Skip to content

fix(cli-peer): close controller capability gaps on CLI peer hosts - #3669

Merged
bobleer merged 4 commits into
openBitFun:mainfrom
bobleer:bob/cli-peer-capability-gaps
Nov 2, 2026
Merged

bobleer merged 4 commits into
openBitFun:mainfrom
bobleer:bob/cli-peer-capability-gaps

Conversation

@bobleer

@bobleer bobleer commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Refs #3417. Close controller capability gaps on CLI peer hosts without falling back to the controller machine:

  • Read shell output through bounded terminal_get_history pages and host-stream cursor hints. Report exit/close lifecycle even for listed tabs without a mounted view; reconcile late tab-list subscribers.
  • Serve Skill discovery and read-only global availability settings through the existing Core owners. Disable unsupported mutations and tolerate older hosts refusing settings.
  • Serve CLI runtime log paths and the effective startup level. Explain when a saved level has not been applied.
  • Run /btw through the shared coordinator. Register its exact turn ID with PeerTurnTracker before submission, release failed starts, and cancel when stream continuity is lost.
  • Show localized explanations with the host's original detail for unsupported ACP and diagnostics operations. File-tree mutations remain outside this PR (feat(cli-peer): expose file explorer and Git read surfaces #3492).

Compatibility

  • terminal_cursor_replay_v1 selects cursor delivery. Older CLI hosts retain the host-kind fallback; Desktop keeps terminal_event. Re-evaluate when capabilities arrive after a view subscribes.
  • Older controllers are unchanged; they need the controller update to display CLI terminal output. Older CLI hosts still lack live exit notifications.
  • New optional BTW payload fields tolerate legacy requests. No persisted data migration.
  • Skill imports and direct management report version 0; no unsupported operation is presented as successful.

Validation

Re-run on the reviewed branch, now at 82b6f3be3:

  • cargo test --locked -p openbitfun-cli --bin openbitfun peer_host:: — 118 passed.
  • cargo test --locked -p openbitfun-cli --bin openbitfun logging::tests::logging_info_matches_the_controller_wire_shape — 1 passed.
  • cargo test --locked -p openbitfun-product-domains --no-default-features remote_surface — 20 passed.
  • corepack pnpm --dir src/web-ui run test:run src/app/scenes/settings/pages/data/loggingLevelMessage.test.ts src/app/scenes/skills/hooks/useInstalledSkills.test.tsx src/infrastructure/api/generated/remoteSurface.test.ts src/infrastructure/peer-device/peerCapabilityResolution.test.ts src/infrastructure/peer-device/peerHostRefusal.test.ts src/tools/terminal/services/PeerTerminalReplay.test.ts src/tools/terminal/services/TerminalService.test.ts — 7 files / 82 tests passed. The late-subscriber regression failed before the one-line reconciliation fix and passes afterward.
  • corepack pnpm run check:web — passed.
  • corepack pnpm run check:core-boundaries — passed in an external detached worktree at the exact head. The original nested worktree failed because Cargo discovered the parent checkout's workspace for the standalone installer; no manifest workaround was added.

CI must finish for this new head before merging; old-head green checks do not validate these review fixes.

Remote coverage and limitations

Peer Device Mode is covered by unit fixtures with mocked transport and host streams, not a live remote session. SSH Skill/terminal paths compile but have not been tested against a live SSH host. Remote control and Detached Dispatch were not exercised. An exit emitted while no stream is active is recovered through the existing terminal status read on later attachment, not retained as an event. CLI log-level changes still require restart to apply.

Generated with OpenBitFun

bobleer and others added 4 commits November 2, 2026 10:24
Terminal output never reached a Desktop controller on a CLI host: the host
publishes cursor hints on terminal-<id> while the controller only listened
for terminal_event, so a shell looked hung. The controller now follows those
hints with bounded replay pages, selected by host_type so older hosts of both
kinds keep working. CLI hosts also publish terminal-exit and terminal-closed.

Add CLI handlers for get_skill_configs, get_mode_skill_configs,
get_runtime_logging_info, btw_ask_stream and btw_cancel, and advertise the BTW
model selection capabilities. ACP and diagnostics bundles stay unsupported with
explicit reasons that the settings pages and /btw now surface.
- Serve get_global_skill_settings read-only on CLI hosts
  (directSkillManagementVersion 0) and let the Skills page tolerate a
  refusal from older hosts.
- Register BTW turns with the peer turn tracker before submission using
  the core btw_turn_id helper, gated on event-stream continuity and
  released when the start fails.
- Lead peer host refusals with localized copy and keep the host reason
  as secondary detail.
- Poll terminal exit through a lightweight session_status accessor
  instead of cloning the whole session with its history.
- Select terminal cursor replay through the typed
  terminal_cursor_replay_v1 capability, falling back to host kind for
  older CLI hosts, and re-decide once capabilities resolve.
- Report a logging level the host did not apply instead of claiming it
  was updated.
- Track lifecycle for tabs without a mounted view, drop stale replay
  offsets, publish terminal-exit and terminal-closed on remote SSH
  terminals, and detect removed sessions from the session list instead
  of error text.
Co-authored-by: OpenBitFun <318544290+bitfun-ai@users.noreply.github.com>
@bobleer
bobleer merged commit bdda67e into openBitFun:main Nov 2, 2026
13 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