diff --git a/server/src/config.rs b/server/src/config.rs index d66cb33..5cd8d22 100644 --- a/server/src/config.rs +++ b/server/src/config.rs @@ -245,66 +245,29 @@ pub struct SessionConfig { /// The shape `config.ron` had before setups (up to 2026-08-28). /// /// Here only so an existing install upgrades rather than refusing to -/// start. Nothing else may use these types, and when no install can -/// plausibly still be on that shape they go, along with the branch in -/// [`Config::load`] that reaches them. +/// start, and **due for deletion as soon as it has run**. There is one +/// backend and one phone, so once they are past this shape nothing +/// anywhere is still on it, and a second parsing path that nothing +/// exercises only constrains later changes to the schema. +/// +/// The reader for the kebab-case driver kind has already gone for that +/// reason. Delete the rest -- this module and the branch in +/// [`Config::load`] that reaches it -- once the host has started on a +/// build containing it. mod legacy { use serde::Deserialize; - use super::{DriverKind, ProviderConfig, TokenEntry}; + use super::{ProviderConfig, TokenEntry}; #[derive(Deserialize, Default)] #[serde(rename_all = "camelCase", default)] pub struct Config { pub tokens: Vec, - pub providers: Vec, + pub providers: Vec, pub hosts: Vec, pub sessions: Vec, } - /// A provider, when the driver kind was spelled in kebab case. - /// - /// Both spellings are accepted because the rename happened on the same - /// day as the RON move, so a config written that morning says - /// `r#claude-cli` and one written that afternoon says `claude_cli`. - /// Reading only one of them would turn this migration into a different - /// crash. - #[derive(Deserialize)] - #[serde(rename_all = "camelCase")] - pub struct Provider { - pub name: String, - pub kind: LegacyKind, - #[serde(default)] - pub command: Option, - #[serde(default)] - pub models: Vec, - } - - #[derive(Deserialize, Clone, Copy)] - #[serde(rename_all = "snake_case")] - pub enum LegacyKind { - Echo, - #[serde(alias = "claude-cli")] - ClaudeCli, - #[serde(alias = "llama-cpp")] - LlamaCpp, - } - - impl From for ProviderConfig { - fn from(old: Provider) -> Self { - Self { - name: old.name, - kind: match old.kind { - LegacyKind::Echo => DriverKind::Echo, - LegacyKind::ClaudeCli => DriverKind::ClaudeCli, - LegacyKind::LlamaCpp => DriverKind::LlamaCpp, - }, - command: old.command, - models: old.models, - } - } - } - /// A machine, when the name lived on the connection rather than on a /// setup. #[derive(Deserialize)] @@ -454,7 +417,7 @@ impl Config { id: LOCAL_SETUP_ID.to_string(), name: LOCAL_SETUP.to_string(), ssh: None, - providers: old.providers.into_iter().map(Into::into).collect(), + providers: old.providers, }); // Name and id both taken from the old host's name: it is what // sessions referenced, so reusing it is what lets them keep @@ -675,10 +638,8 @@ mod tests { let path = dir.path().join("config.ron"); std::fs::write( &path, - // `r#claude-cli` deliberately: the kebab spelling and the RON - // move landed the same day, so a real file may have either. "tokens: [(name: \"phone\", sha256: \"ab\")],\n\ - providers: [(name: \"claude-cli\", kind: r#claude-cli, models: [\"opus\"])],\n\ + providers: [(name: \"claude-cli\", kind: claude_cli, models: [\"opus\"])],\n\ hosts: [(name: \"dev vm\", address: \"bob@10.0.0.2\", port: 2222)],\n\ sessions: [\n\ (id: \"a\", provider: \"claude-cli\", host: \"dev vm\", title: \"remote\", created: 1.0),\n\