From 76330da38031ef23ac3799f3d9e53797eb357004 Mon Sep 17 00:00:00 2001 From: Simon Klee Date: Fri, 6 Nov 2026 06:29:35 +0100 Subject: [PATCH] fix(cli-rs): report an unknown drive version instead of an empty one Handshake.Identity.version is a NonEmptyString, and TS's SimulationServer.start defaults it to 'unknown'. opencode_drive's handshake sent an empty version as given; it now reports 'unknown', and the TUI no longer defaults it itself. --- packages/cli-rs/crates/drive/src/protocol.rs | 9 +++++++-- packages/cli-rs/crates/tui/src/features/drive.rs | 3 +-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/cli-rs/crates/drive/src/protocol.rs b/packages/cli-rs/crates/drive/src/protocol.rs index 9486609562b..028dac1a071 100644 --- a/packages/cli-rs/crates/drive/src/protocol.rs +++ b/packages/cli-rs/crates/drive/src/protocol.rs @@ -158,7 +158,8 @@ pub enum Role { Backend, } -/// `Handshake.dispatch` for the `ui` role, after the checks `Handshake.Params` makes while decoding. +/// `Handshake.dispatch` for the `ui` role, after the checks `Handshake.Params` makes while decoding. An empty +/// `version` reports `unknown`, as `SimulationServer.start` defaults it: the schema takes no empty string. pub fn handshake(params: &HandshakeParams, version: &str) -> Result { check(params)?; if params.expected_role != Role::Ui { @@ -179,7 +180,7 @@ pub fn handshake(params: &HandshakeParams, version: &str) -> Result opentui:: // Nothing draws over stderr without a terminal, and the driver reads the endpoint line from it. app: AppOptions { capture_stderr: false, ..options }, })?; - let version = - Some(launch.args.version.clone()).filter(|version| !version.is_empty()).unwrap_or_else(|| "unknown".into()); + let version = launch.args.version.clone(); crate::app::run_on(app, launch, |tui| { let server = start(tui, manifest.ui_addr(), version)?; eprintln!("opencode drive ui websocket: {}", server.url());