Repository navigation
fix(cli-peer): close controller capability gaps on CLI peer hosts - #3669
Merged
Merged
Conversation
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>
This was referenced Nov 2, 2026
Closed
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.
Summary
Refs #3417. Close controller capability gaps on CLI peer hosts without falling back to the controller machine:
terminal_get_historypages and host-stream cursor hints. Report exit/close lifecycle even for listed tabs without a mounted view; reconcile late tab-list subscribers./btwthrough the shared coordinator. Register its exact turn ID withPeerTurnTrackerbefore submission, release failed starts, and cancel when stream continuity is lost.Compatibility
terminal_cursor_replay_v1selects cursor delivery. Older CLI hosts retain the host-kind fallback; Desktop keepsterminal_event. Re-evaluate when capabilities arrive after a view subscribes.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