Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
fix(config): ask the harness whether the marketplace is gone (#4048)
Maximilian Roosf5cac67b7700
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 2451da74a..c2a1e47b0 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1,5 +1,11 @@# Changelog+## Unreleased++### Fixed++- **`wt config plugins claude uninstall` / `codex uninstall` no longer report success over a marketplace that is still there**: to tell an already-removed marketplace from a removal that failed, uninstall used to read the harness's own config file. A file or key the harness renamed reads as an absence there, so every failed removal would have printed `Plugin & marketplace removed` and exited 0. It now asks `claude` / `codex plugin marketplace list --json`, and an answer it cannot read leaves the harness's error standing. ([#4048](https://github.com/max-sixty/worktrunk/pull/4048))+## 0.77.0### Improveddiff --git a/src/commands/config/codex.rs b/src/commands/config/codex.rsindex 633173b0a..02302d074 100644--- a/src/commands/config/codex.rs+++ b/src/commands/config/codex.rs@@ -1,7 +1,5 @@//! Codex plugin and marketplace management.-use std::path::PathBuf;-use anyhow::{Result, bail};use color_print::cformat;use worktrunk::styling::{eprintln, hint_message, progress_message, success_message};@@ -102,50 +100,26 @@ fn require_codex_cli() -> Result<()> {bail!("codex CLI not found. Install Codex first: https://developers.openai.com/codex/cli/");}-/// Codex's config root.-///-/// Honors `CODEX_HOME`, which relocates the whole tree away from `~/.codex`,-/// the same way `claude_config_dir` honors `CLAUDE_CONFIG_DIR`. They diverge-/// on one point deliberately: a leading `~/` is taken literally here rather-/// than expanded against the home directory, because a shell expands it before-/// the variable is set and nothing sets `CODEX_HOME` from a non-shell context.-fn codex_config_dir() -> Option<PathBuf> {- match std::env::var("CODEX_HOME") {- Ok(dir) if !dir.is_empty() => Some(PathBuf::from(dir)),- _ => worktrunk::path::home_dir().map(|home| home.join(".codex")),- }-}-/// Whether the worktrunk marketplace is configured in Codex, or `None` where-/// the config cannot answer.+/// Codex's answer cannot be read.///-/// `codex plugin marketplace remove` exits non-zero when the marketplace is-/// not configured, so uninstall needs to tell that from a removal that-/// genuinely failed. Codex records each one as a `[marketplaces.<name>]`-/// table in `config.toml`.+/// The Codex counterpart of the Claude reader in [`super::show`], asked for+/// the same reason: `codex plugin marketplace remove` exits non-zero when the+/// marketplace is not configured. `codex plugin marketplace list --json` nests+/// its entries under `marketplaces`.///-/// `None` is the same "cannot tell" the Claude reader returns: a `config.toml`-/// that will not read or parse, or whose `marketplaces` is not a table, cannot-/// say worktrunk's entry is gone.+/// Asking Codex is what lets this claim as much as the Claude one. Reading+/// `config.toml` could not: `codex plugin marketplace remove` deletes the+/// whole `marketplaces` key along with the last entry under it, so a config+/// whose key had been renamed was indistinguishable from one a successful+/// removal had just emptied — and the only reading that let a second+/// `uninstall` succeed was the one that reported every genuine failure as+/// `Codex plugin & marketplace removed`. Codex's own list separates them.///-/// It claims less than the Claude reader does, because less is available here.-/// A fresh `config.toml` legitimately has no `marketplaces` key at all, so a-/// key that was renamed or relocated is indistinguishable from a user who has-/// configured no marketplaces, and reads as a confident absence.+/// It also drops wt's copy of Codex's `CODEX_HOME` resolution. The child+/// reads the variable itself, so a rule about where Codex keeps its config is+/// no longer duplicated here to drift from the real one.pub(super) fn is_marketplace_configured() -> Option<bool> {- let path = codex_config_dir()?.join("config.toml");- // `try_exists` so a directory we lack permission to stat is unknown rather- // than the `false` that `exists` reports for it.- if !path.try_exists().ok()? {- return Some(false);- }-- let content = std::fs::read_to_string(&path).ok()?;- let config = content.parse::<toml::Table>().ok()?;- match config.get("marketplaces") {- None => Some(false),- Some(marketplaces) => marketplaces- .as_table()- .map(|table| table.contains_key(MARKETPLACE_NAME)),- }+ let listed = super::plugin_marketplace_list("codex")?;+ super::marketplace_listed(listed.get("marketplaces")?.as_array()?, MARKETPLACE_NAME)}diff --git a/src/commands/config/mod.rs b/src/commands/config/mod.rsindex e21345522..67cec2dea 100644--- a/src/commands/config/mod.rs+++ b/src/commands/config/mod.rs@@ -143,6 +143,43 @@ fn run_plugin_cli(program: &str, args: &[&str]) -> anyhow::Result<()> {Ok(())}+/// The JSON `<program> plugin marketplace list --json` prints, or `None` where+/// the harness did not answer.+///+/// Both harnesses expose this, and it is the only thing either of them will+/// say about its own marketplaces that is meant to be read by another program.+/// The alternative — reading the file the harness stores them in — is a guess+/// at private layout, and a guess that cannot fail loudly: a record that moved+/// looks exactly like a record that was never written, so every genuine+/// failure reads as an already-finished removal. Asking the harness has no+/// such gap, and a harness that will not answer at all leaves the question+/// open rather than answering it wrong.+fn plugin_marketplace_list(program: &str) -> Option<serde_json::Value> {+ let output = worktrunk::shell_exec::Cmd::new(program)+ .args(["plugin", "marketplace", "list", "--json"])+ .run()+ .ok()?;+ if !output.status.success() {+ return None;+ }+ serde_json::from_slice(&output.stdout).ok()+}++/// Whether a harness's marketplace list names `name`, or `None` where it is+/// not a list of named marketplaces.+///+/// An empty list is a confident `Some(false)`: the harness has said it holds+/// nothing. An entry that is not an object carrying a string `name` is a shape+/// this does not understand, so it answers nothing rather than reporting an+/// absence it inferred from a field that moved.+fn marketplace_listed(entries: &[serde_json::Value], name: &str) -> Option<bool> {+ let mut listed = false;+ for entry in entries {+ listed |= entry.get("name")?.as_str()? == name;+ }+ Some(listed)+}+/// Run a removal whose goal is that the target is gone.////// Both harnesses' `plugin marketplace remove` exits non-zero when the@@ -152,12 +189,12 @@ fn run_plugin_cli(program: &str, args: &[&str]) -> anyhow::Result<()> {/// removal that genuinely failed, which still surfaces the harness's own/// stderr in the gutter.///-/// Only a confident `Some(false)` drops the error. `None` — no home directory,-/// or a config that will not read, parse, or match the shape the reader knows-/// — keeps it, because a reader that cannot see the marketplace has not-/// established that the removal worked. Reporting success there would fail open-/// on exactly the silent case: a config whose shape changed under us would-/// swallow every genuine failure and print `Plugin & marketplace removed`.+/// Only a confident `Some(false)` drops the error. `None` — the harness would+/// not list its marketplaces, or listed them in a shape this does not+/// recognize — keeps it, because an answer that could not be read has not+/// established that the removal worked. Reporting success there would fail+/// open on exactly the silent case, printing `Plugin & marketplace removed`+/// over a marketplace that is still there.////// The command runs either way, so the `?` preview lists what the uninstall/// actually invokes.diff --git a/src/commands/config/show.rs b/src/commands/config/show.rsindex f3275f15d..f75ed6444 100644--- a/src/commands/config/show.rs+++ b/src/commands/config/show.rs@@ -328,40 +328,24 @@ pub(super) fn is_plugin_installed() -> bool {}/// Whether the worktrunk marketplace is configured in Claude Code, or `None`-/// where the config cannot answer+/// where Claude Code's answer cannot be read///-/// Read from the same config tree as `is_plugin_installed`, and asked for the-/// same reason: `claude plugin marketplace remove` exits non-zero when the+/// Asked because `claude plugin marketplace remove` exits non-zero when the/// marketplace is not there, so uninstall needs to tell that from a removal-/// that genuinely failed. `known_marketplaces.json` is keyed by marketplace-/// name.+/// that genuinely failed. `claude plugin marketplace list --json` answers it+/// as a bare array of marketplace objects.///-/// The three-way answer is what keeps that safe. A file Claude Code has never-/// written records no marketplaces, so its absence is a confident no. A file-/// that exists and cannot be read, parsed, or recognized leaves the question-/// open, and `run_plugin_removal` keeps the harness's error rather than-/// reporting a removal it cannot confirm.-///-/// Recognizing the shape is the part that earns its keep. A key lookup alone-/// answers "absent" for any JSON that simply lacks it, so a file reshaped the-/// way the `installed_plugins.json` beside it wraps its map in a `version` key-/// would parse, miss, and report a confident no — every genuine failure-/// silently reported as success. Requiring every value to be a marketplace-/// object turns that reshape into `None` instead.+/// The question goes to Claude Code rather than to the config tree+/// `is_plugin_installed` reads, because that tree records marketplaces in a+/// file whose absence means two different things. A+/// `plugins/known_marketplaces.json` Claude Code never wrote and one it has+/// since renamed or moved are the same missing path, and reading the second as+/// a confident absence would report every failed removal as+/// `Plugin & marketplace removed`. An empty list carries no such ambiguity:+/// Claude Code has said what it holds.pub(super) fn is_marketplace_configured() -> Option<bool> {- let path = claude_config_dir()?.join("plugins/known_marketplaces.json");- // `try_exists` so a directory we lack permission to stat is unknown rather- // than the `false` that `exists` reports for it.- if !path.try_exists().ok()? {- return Some(false);- }-- let content = std::fs::read_to_string(&path).ok()?;- let json = serde_json::from_str::<serde_json::Value>(&content).ok()?;- let map = json.as_object()?;- map.values()- .all(serde_json::Value::is_object)- .then(|| map.contains_key("worktrunk"))+ let listed = super::plugin_marketplace_list("claude")?;+ super::marketplace_listed(listed.as_array()?, "worktrunk")}/// Whether Claude Code's statusline runs worktrunk's.diff --git a/src/testing/mod.rs b/src/testing/mod.rsindex b474cd59e..d2305e1c8 100644--- a/src/testing/mod.rs+++ b/src/testing/mod.rs@@ -2242,49 +2242,32 @@ impl TestRepo {.unwrap();}- /// Write Claude Code's marketplace record verbatim- ///- /// `known_marketplaces.json` is keyed by marketplace name, which is what- /// `is_marketplace_configured` reads. The body is the caller's, since the- /// three states that reader distinguishes — worktrunk present, a different- /// marketplace present, and a file that will not parse — differ only in- /// what this file holds.- pub fn setup_claude_marketplaces(temp_home: &std::path::Path, body: &str) {- let plugins_dir = temp_home.join(".claude/plugins");- std::fs::create_dir_all(&plugins_dir).unwrap();- std::fs::write(plugins_dir.join("known_marketplaces.json"), body).unwrap();- }-- /// `known_marketplaces.json` holding the worktrunk marketplace+ /// `claude plugin marketplace list --json` holding the worktrunk+ /// marketplace+ ///+ /// Claude Code prints a bare array of marketplace objects. These bodies+ /// are the mock's stdout rather than a config-file fixture, because+ /// `is_marketplace_configured` asks the harness what it holds instead of+ /// reading the file the harness keeps it in.pub const CLAUDE_MARKETPLACES_WITH_WORKTRUNK: &'static str =- r#"{"worktrunk":{"source":{"source":"github","repo":"max-sixty/worktrunk"}}}"#;+ r#"[{"name":"worktrunk","source":"github","repo":"max-sixty/worktrunk"}]"#;- /// `known_marketplaces.json` holding some other marketplace+ /// `claude plugin marketplace list --json` holding some other marketplace///- /// The state a second `uninstall` lands in: the file exists because the- /// user has other marketplaces, and worktrunk's entry is simply gone.+ /// The state a second `uninstall` lands in for a user who has other+ /// marketplaces: the list is non-empty and worktrunk is simply not in it.pub const CLAUDE_MARKETPLACES_WITHOUT_WORKTRUNK: &'static str =- r#"{"other":{"source":{"source":"github","repo":"someone/other"}}}"#;+ r#"[{"name":"other","source":"github","repo":"someone/other"}]"#;- /// Write Codex's `config.toml` verbatim+ /// `codex plugin marketplace list --json` holding the worktrunk+ /// marketplace///- /// Codex keeps each marketplace as a `[marketplaces.<name>]` table there.- /// Takes the config root rather than the home directory, since- /// `CODEX_HOME` can move it off `~/.codex`.- pub fn setup_codex_config(codex_dir: &std::path::Path, body: &str) {- std::fs::create_dir_all(codex_dir).unwrap();- std::fs::write(codex_dir.join("config.toml"), body).unwrap();- }-- /// `config.toml` holding the worktrunk marketplace- pub const CODEX_CONFIG_WITH_WORKTRUNK: &'static str = "[marketplaces.worktrunk]\nsource_type = \"git\"\nsource = \"https://github.com/max-sixty/worktrunk.git\"\n";+ /// Codex nests its entries under `marketplaces` where Claude Code prints+ /// a bare array.+ pub const CODEX_MARKETPLACES_WITH_WORKTRUNK: &'static str = r#"{"marketplaces":[{"name":"worktrunk","root":"/marketplaces/worktrunk","marketplaceSource":{"sourceType":"git","source":"https://github.com/max-sixty/worktrunk.git"}}]}"#;- /// `config.toml` a Codex user has after the marketplace is removed- ///- /// Codex keeps its model and other settings in this file, so it outlives- /// the marketplace table — which is why a second `uninstall` reads a- /// present config with no worktrunk entry rather than no config at all.- pub const CODEX_CONFIG_WITHOUT_WORKTRUNK: &'static str = "model = \"gpt-5.5\"\n\n[marketplaces.other]\nsource_type = \"git\"\nsource = \"https://github.com/someone/other.git\"\n";+ /// `codex plugin marketplace list --json` holding some other marketplace+ pub const CODEX_MARKETPLACES_WITHOUT_WORKTRUNK: &'static str = r#"{"marketplaces":[{"name":"other","root":"/marketplaces/other","marketplaceSource":{"sourceType":"git","source":"https://github.com/someone/other.git"}}]}"#;/// Setup the statusline as configured in Claude Code settings///@@ -2380,6 +2363,10 @@ impl TestRepo {MockConfig::new("claude").command("plugin marketplace", MockResponse::exit(0))+ // Uninstall asks what Claude Code holds before deciding the+ // marketplace is gone, so a mock that answered nothing would leave+ // the question open on every path that reaches it.+ .command("plugin marketplace list", MockResponse::output("[]")).command("plugin install", MockResponse::exit(0)).command("plugin uninstall", MockResponse::exit(0)).write(mock_bin);@@ -2402,6 +2389,10 @@ impl TestRepo {MockConfig::new("codex").command("plugin marketplace add", MockResponse::exit(0)).command("plugin marketplace remove", MockResponse::exit(0))+ .command(+ "plugin marketplace list",+ MockResponse::output(r#"{"marketplaces":[]}"#),+ ).command("plugin add", MockResponse::exit(0)).command("plugin remove", MockResponse::exit(0)).write(mock_bin);@@ -2410,13 +2401,15 @@ impl TestRepo {}/// Setup mock `claude` CLI whose only failing command is the marketplace- /// removal+ /// removal, answering `plugin marketplace list --json` with `list`///- /// Uninstall reads the config to tell "the marketplace was already gone"- /// from a removal that genuinely failed, so the two cases need a mock that- /// fails the removal and leaves every other step alone. Must call+ /// Uninstall asks the harness what it holds to tell "the marketplace was+ /// already gone" from a removal that genuinely failed, so the two cases+ /// need a mock that fails the removal and leaves every other step alone.+ /// `list` is the whole variable between them — a body for an answer the+ /// reader can use, a failing response for one it cannot. Must call/// `setup_mock_ci_tools_unauthenticated()` first.- pub fn setup_mock_claude_with_marketplace_remove_failing(&mut self) {+ pub fn setup_mock_claude_with_marketplace_remove_failing(&mut self, list: MockResponse) {let mock_bin = self.mock_bin_path.as_ref()@@ -2428,6 +2421,7 @@ impl TestRepo {"plugin marketplace remove",MockResponse::exit(1).with_stderr("error: marketplace remove failed\n"),)+ .command("plugin marketplace list", list).command("plugin install", MockResponse::exit(0)).command("plugin uninstall", MockResponse::exit(0)).write(mock_bin);@@ -2436,11 +2430,11 @@ impl TestRepo {}/// Setup mock `codex` CLI whose only failing command is the marketplace- /// removal+ /// removal, answering `plugin marketplace list --json` with `list`////// The Codex counterpart of/// `setup_mock_claude_with_marketplace_remove_failing`.- pub fn setup_mock_codex_with_marketplace_remove_failing(&mut self) {+ pub fn setup_mock_codex_with_marketplace_remove_failing(&mut self, list: MockResponse) {let mock_bin = self.mock_bin_path.as_ref()@@ -2452,6 +2446,7 @@ impl TestRepo {"plugin marketplace remove",MockResponse::exit(1).with_stderr("error: marketplace remove failed\n"),)+ .command("plugin marketplace list", list).command("plugin add", MockResponse::exit(0)).command("plugin remove", MockResponse::exit(0)).write(mock_bin);diff --git a/tests/integration_tests/config_show.rs b/tests/integration_tests/config_show.rsindex 07b32865c..8cd22464f 100644--- a/tests/integration_tests/config_show.rs+++ b/tests/integration_tests/config_show.rs@@ -1,3 +1,4 @@+use crate::common::mock_commands::MockResponse;use crate::common::{BareRepoTest, TestRepo, canonical_temp_home, repo, set_temp_home_env, set_xdg_config_path,setup_home_snapshot_settings, setup_snapshot_settings, setup_snapshot_settings_with_home,@@ -4492,7 +4493,7 @@ fn test_plugins_codex_uninstall_plugin_remove_fails(mut repo: TestRepo, temp_hom}/// The marketplace removal's goal is that the marketplace is gone, so the-/// harness reporting it was never configured is that goal already met. Running+/// harness reporting an empty list is that goal already met. Running/// `uninstall` a second time hits exactly this, and used to fail with nothing/// left to do.#[rstest]@@ -4501,10 +4502,8 @@ fn test_plugins_claude_uninstall_tolerates_absent_marketplace(temp_home: TempDir,) {repo.setup_mock_ci_tools_unauthenticated();- repo.setup_mock_claude_with_marketplace_remove_failing();+ repo.setup_mock_claude_with_marketplace_remove_failing(MockResponse::output("[]"));TestRepo::setup_plugin_installed(temp_home.path());- // No `known_marketplaces.json`, so the marketplace the removal failed on- // is already gone.let settings = setup_snapshot_settings_with_home(&repo, &temp_home);settings.bind(|| {@@ -4526,14 +4525,22 @@ fn test_plugins_claude_uninstall_removes_marketplace_left_without_plugin(mut repo: TestRepo,temp_home: TempDir,) {+ use crate::common::mock_commands::MockConfig;+repo.setup_mock_ci_tools_unauthenticated();- repo.setup_mock_claude_with_plugins();+ repo.setup_mock_claude_installed();// No `installed_plugins.json`: the plugin is already gone, and only the- // marketplace is left to remove.- TestRepo::setup_claude_marketplaces(- temp_home.path(),- TestRepo::CLAUDE_MARKETPLACES_WITH_WORKTRUNK,- );+ // marketplace Claude Code still lists is left to remove.+ let mock_bin = repo+ .mock_bin_path()+ .expect("setup_mock_ci_tools_unauthenticated creates mock-bin");+ MockConfig::new("claude")+ .command("plugin marketplace remove", MockResponse::exit(0))+ .command(+ "plugin marketplace list",+ MockResponse::output(TestRepo::CLAUDE_MARKETPLACES_WITH_WORKTRUNK),+ )+ .write(mock_bin);let settings = setup_snapshot_settings_with_home(&repo, &temp_home);settings.bind(|| {@@ -4546,46 +4553,18 @@ fn test_plugins_claude_uninstall_removes_marketplace_left_without_plugin(});}-/// The Claude counterpart of the key-absent case: `known_marketplaces.json`-/// exists because the user has other marketplaces, and worktrunk's entry is-/// gone.+/// The state a second `uninstall` lands in for a user with other+/// marketplaces: the list is non-empty and worktrunk is simply not in it.#[rstest]-fn test_plugins_claude_uninstall_tolerates_marketplace_removed_from_config(+fn test_plugins_claude_uninstall_tolerates_marketplace_missing_from_list(mut repo: TestRepo,temp_home: TempDir,) {repo.setup_mock_ci_tools_unauthenticated();- repo.setup_mock_claude_with_marketplace_remove_failing();- TestRepo::setup_plugin_installed(temp_home.path());- TestRepo::setup_claude_marketplaces(- temp_home.path(),+ repo.setup_mock_claude_with_marketplace_remove_failing(MockResponse::output(TestRepo::CLAUDE_MARKETPLACES_WITHOUT_WORKTRUNK,- );-- let settings = setup_snapshot_settings_with_home(&repo, &temp_home);- settings.bind(|| {- let mut cmd = repo.wt_command();- cmd.args(["config", "plugins", "claude", "uninstall", "--yes"])- .current_dir(repo.root_path());- set_temp_home_env(&mut cmd, temp_home.path());-- assert_cmd_snapshot!(cmd);- });-}--/// A `known_marketplaces.json` that will not parse cannot say the marketplace-/// is gone, so the removal's failure stands. This is the shape-drift guard: if-/// the file ever grows a wrapper the way `installed_plugins.json` has one,-/// uninstall reports the harness's error rather than a silent success.-#[rstest]-fn test_plugins_claude_uninstall_surfaces_failure_when_config_unreadable(- mut repo: TestRepo,- temp_home: TempDir,-) {- repo.setup_mock_ci_tools_unauthenticated();- repo.setup_mock_claude_with_marketplace_remove_failing();+ ));TestRepo::setup_plugin_installed(temp_home.path());- TestRepo::setup_claude_marketplaces(temp_home.path(), "{\"worktrunk\":");let settings = setup_snapshot_settings_with_home(&repo, &temp_home);settings.bind(|| {@@ -4598,58 +4577,41 @@ fn test_plugins_claude_uninstall_surfaces_failure_when_config_unreadable(});}-/// A reshaped `known_marketplaces.json` parses cleanly and simply lacks the-/// key, so a lookup that only asked for the key would call the marketplace-/// gone and swallow the removal's failure — silently, for as long as the shape-/// held. Requiring every value to be a marketplace object makes it unknown.+/// An answer that cannot be read is not an absence. Each case is one way+/// Claude Code could stop answering the question — the subcommand gone, output+/// that is not JSON, and a list reshaped so it parses and still means+/// something else — and each has to leave the removal's failure standing+/// rather than report a marketplace it never removed.#[rstest]-fn test_plugins_claude_uninstall_surfaces_failure_when_config_reshaped(+#[case::unsupported(MockResponse::exit(1).with_stderr("error: unknown option '--json'\n"))]+#[case::unparsable(MockResponse::output("[{\"name\":"))]+#[case::reshaped(MockResponse::output(r#"{"marketplaces":[{"name":"other"}]}"#))]+fn test_plugins_claude_uninstall_surfaces_failure_when_list_unusable(mut repo: TestRepo,temp_home: TempDir,+ #[case] list: MockResponse,) {repo.setup_mock_ci_tools_unauthenticated();- repo.setup_mock_claude_with_marketplace_remove_failing();+ repo.setup_mock_claude_with_marketplace_remove_failing(list);TestRepo::setup_plugin_installed(temp_home.path());- // The shape `installed_plugins.json` already uses, applied to this file.- TestRepo::setup_claude_marketplaces(- temp_home.path(),- r#"{"version":2,"marketplaces":{"worktrunk":{"source":"github"}}}"#,- );- let settings = setup_snapshot_settings_with_home(&repo, &temp_home);- settings.bind(|| {- let mut cmd = repo.wt_command();- cmd.args(["config", "plugins", "claude", "uninstall", "--yes"])- .current_dir(repo.root_path());- set_temp_home_env(&mut cmd, temp_home.path());-- assert_cmd_snapshot!(cmd);- });-}+ let mut cmd = repo.wt_command();+ cmd.args(["config", "plugins", "claude", "uninstall", "--yes"])+ .current_dir(repo.root_path());+ set_temp_home_env(&mut cmd, temp_home.path());-/// The Codex counterpart, for the one shape it can rule out: `marketplaces`-/// present but not a table cannot say worktrunk's entry is absent.-#[rstest]-fn test_plugins_codex_uninstall_surfaces_failure_when_config_reshaped(- mut repo: TestRepo,- temp_home: TempDir,-) {- repo.setup_mock_ci_tools_unauthenticated();- repo.setup_mock_codex_with_marketplace_remove_failing();- TestRepo::setup_codex_config(- &temp_home.path().join(".codex"),- "model = \"gpt-5.5\"\nmarketplaces = 3\n",+ // The rendering is pinned by the single-case tests either side of this+ // one; what each case here asserts is that an answer it could not read+ // leaves claude's own error standing.+ let output = cmd.output().unwrap();+ let stderr = String::from_utf8_lossy(&output.stderr);+ let stderr = stderr.ansi_strip();+ assert!(!output.status.success(), "stderr:\n{stderr}");+ assert!(+ stderr.contains("claude plugin marketplace remove worktrunk failed"),+ "stderr:\n{stderr}");-- let settings = setup_snapshot_settings_with_home(&repo, &temp_home);- settings.bind(|| {- let mut cmd = repo.wt_command();- cmd.args(["config", "plugins", "codex", "uninstall", "--yes"])- .current_dir(repo.root_path());- set_temp_home_env(&mut cmd, temp_home.path());-- assert_cmd_snapshot!(cmd);- });+ assert!(!stderr.contains("marketplace removed"), "stderr:\n{stderr}");}/// The Codex counterpart: a second `uninstall` succeeds.@@ -4659,8 +4621,9 @@ fn test_plugins_codex_uninstall_tolerates_absent_marketplace(temp_home: TempDir,) {repo.setup_mock_ci_tools_unauthenticated();- repo.setup_mock_codex_with_marketplace_remove_failing();- // No `config.toml`, so codex has no marketplace left to remove.+ repo.setup_mock_codex_with_marketplace_remove_failing(MockResponse::output(+ r#"{"marketplaces":[]}"#,+ ));let settings = setup_snapshot_settings_with_home(&repo, &temp_home);settings.bind(|| {@@ -4673,18 +4636,17 @@ fn test_plugins_codex_uninstall_tolerates_absent_marketplace(});}-/// The Codex counterpart: a marketplace that survives the removal still errors.+/// The Codex counterpart: a marketplace Codex still lists after the removal+/// failed is a genuine failure, and the error surfaces.#[rstest]fn test_plugins_codex_uninstall_surfaces_marketplace_remove_failure(mut repo: TestRepo,temp_home: TempDir,) {repo.setup_mock_ci_tools_unauthenticated();- repo.setup_mock_codex_with_marketplace_remove_failing();- TestRepo::setup_codex_config(- &temp_home.path().join(".codex"),- TestRepo::CODEX_CONFIG_WITH_WORKTRUNK,- );+ repo.setup_mock_codex_with_marketplace_remove_failing(MockResponse::output(+ TestRepo::CODEX_MARKETPLACES_WITH_WORKTRUNK,+ ));let settings = setup_snapshot_settings_with_home(&repo, &temp_home);settings.bind(|| {@@ -4697,21 +4659,19 @@ fn test_plugins_codex_uninstall_surfaces_marketplace_remove_failure(});}-/// The state a second `uninstall` actually lands in: `config.toml` is still-/// there, holding the settings Codex keeps beside its marketplaces, and only-/// worktrunk's table is gone. That is the key-absent answer rather than the-/// missing-file one the test above covers.+/// The Codex counterpart of the missing-from-list case. Codex deletes the+/// whole `marketplaces` key with its last entry, so reading `config.toml`+/// could not tell this state from a config whose key had moved; its own list+/// reports the other marketplace and nothing else.#[rstest]-fn test_plugins_codex_uninstall_tolerates_marketplace_removed_from_config(+fn test_plugins_codex_uninstall_tolerates_marketplace_missing_from_list(mut repo: TestRepo,temp_home: TempDir,) {repo.setup_mock_ci_tools_unauthenticated();- repo.setup_mock_codex_with_marketplace_remove_failing();- TestRepo::setup_codex_config(- &temp_home.path().join(".codex"),- TestRepo::CODEX_CONFIG_WITHOUT_WORKTRUNK,- );+ repo.setup_mock_codex_with_marketplace_remove_failing(MockResponse::output(+ TestRepo::CODEX_MARKETPLACES_WITHOUT_WORKTRUNK,+ ));let settings = setup_snapshot_settings_with_home(&repo, &temp_home);settings.bind(|| {@@ -4724,58 +4684,35 @@ fn test_plugins_codex_uninstall_tolerates_marketplace_removed_from_config(});}-/// A `config.toml` that will not parse cannot say the marketplace is gone, so-/// the removal's failure stands rather than being reported as success.+/// The Codex counterpart of the unusable-answer cases. The reshaped body is+/// the other half of the shape check: entries Codex nests where it always has,+/// naming worktrunk under a key that is no longer `name`.#[rstest]-fn test_plugins_codex_uninstall_surfaces_failure_when_config_unreadable(+#[case::unsupported(MockResponse::exit(1).with_stderr("error: unexpected argument '--json'\n"))]+#[case::unparsable(MockResponse::output("{\"marketplaces\":"))]+#[case::reshaped(MockResponse::output(r#"{"marketplaces":[{"marketplace":"worktrunk"}]}"#))]+fn test_plugins_codex_uninstall_surfaces_failure_when_list_unusable(mut repo: TestRepo,temp_home: TempDir,+ #[case] list: MockResponse,) {repo.setup_mock_ci_tools_unauthenticated();- repo.setup_mock_codex_with_marketplace_remove_failing();- TestRepo::setup_codex_config(- &temp_home.path().join(".codex"),- "[marketplaces.worktrunk\n",- );-- let settings = setup_snapshot_settings_with_home(&repo, &temp_home);- settings.bind(|| {- let mut cmd = repo.wt_command();- cmd.args(["config", "plugins", "codex", "uninstall", "--yes"])- .current_dir(repo.root_path());- set_temp_home_env(&mut cmd, temp_home.path());-- assert_cmd_snapshot!(cmd);- });-}--/// `CODEX_HOME` moves the config Codex reads, so the marketplace lookup has to-/// follow it rather than the home directory. Asserted directly rather than by-/// snapshot, which would put the variable's temp path in the snapshot's env-/// block and trip the host-path guard.-#[rstest]-fn test_plugins_codex_uninstall_reads_codex_home(mut repo: TestRepo, temp_home: TempDir) {- repo.setup_mock_ci_tools_unauthenticated();- repo.setup_mock_codex_with_marketplace_remove_failing();-- // The marketplace is recorded under CODEX_HOME and nowhere else, so a- // lookup that ignored the variable would find no config and read the- // failed removal as "already gone".- let codex_home = TempDir::new().unwrap();- TestRepo::setup_codex_config(codex_home.path(), TestRepo::CODEX_CONFIG_WITH_WORKTRUNK);+ repo.setup_mock_codex_with_marketplace_remove_failing(list);let mut cmd = repo.wt_command();cmd.args(["config", "plugins", "codex", "uninstall", "--yes"]).current_dir(repo.root_path());set_temp_home_env(&mut cmd, temp_home.path());- cmd.env("CODEX_HOME", codex_home.path());let output = cmd.output().unwrap();+ let stderr = String::from_utf8_lossy(&output.stderr);+ let stderr = stderr.ansi_strip();+ assert!(!output.status.success(), "stderr:\n{stderr}");assert!(- !output.status.success(),- "a marketplace still configured under CODEX_HOME must surface the removal failure: {}",- String::from_utf8_lossy(&output.stderr)+ stderr.contains("codex plugin marketplace remove worktrunk failed"),+ "stderr:\n{stderr}");+ assert!(!stderr.contains("marketplace removed"), "stderr:\n{stderr}");}#[test]@@ -6228,7 +6165,7 @@ fn test_plugins_claude_install_command_fails(mut repo: TestRepo, temp_home: Temp#[rstest]fn test_plugins_claude_install_second_step_fails(mut repo: TestRepo, temp_home: TempDir) {- use crate::common::mock_commands::{MockConfig, MockResponse};+ use crate::common::mock_commands::MockConfig;repo.setup_mock_ci_tools_unauthenticated();repo.setup_mock_claude_installed();@@ -6278,21 +6215,17 @@ fn test_plugins_claude_uninstall_command_fails(mut repo: TestRepo, temp_home: Te/// marketplace it never removed.#[rstest]fn test_plugins_claude_uninstall_second_step_fails(mut repo: TestRepo, temp_home: TempDir) {- use crate::common::mock_commands::{MockConfig, MockResponse};+ use crate::common::mock_commands::MockConfig;repo.setup_mock_ci_tools_unauthenticated();repo.setup_mock_claude_installed();TestRepo::setup_plugin_installed(temp_home.path());- // The marketplace is still configured after the removal fails, which is- // what makes this a genuine failure rather than the already-gone state- // `test_plugins_claude_uninstall_tolerates_absent_marketplace` covers.- TestRepo::setup_claude_marketplaces(- temp_home.path(),- TestRepo::CLAUDE_MARKETPLACES_WITH_WORKTRUNK,- );// Plugin uninstall succeeds and only the marketplace removal that follows// it fails, so the error the command surfaces can come from nothing else.+ // Claude Code still lists the marketplace afterwards, which is what makes+ // this a genuine failure rather than the already-gone state+ // `test_plugins_claude_uninstall_tolerates_absent_marketplace` covers.let mock_bin = repo.mock_bin_path().expect("setup_mock_ci_tools_unauthenticated creates mock-bin");@@ -6302,6 +6235,10 @@ fn test_plugins_claude_uninstall_second_step_fails(mut repo: TestRepo, temp_home"plugin marketplace remove",MockResponse::exit(1).with_stderr("error: marketplace remove failed\n"),)+ .command(+ "plugin marketplace list",+ MockResponse::output(TestRepo::CLAUDE_MARKETPLACES_WITH_WORKTRUNK),+ ).write(mock_bin);let settings = setup_snapshot_settings_with_home(&repo, &temp_home);diff --git a/tests/snapshots/integration__integration_tests__config_show__plugins_claude_uninstall_surfaces_failure_when_config_reshaped.snap b/tests/snapshots/integration__integration_tests__config_show__plugins_claude_uninstall_surfaces_failure_when_config_reshaped.snapdeleted file mode 100644index 0b3f4b191..000000000--- a/tests/snapshots/integration__integration_tests__config_show__plugins_claude_uninstall_surfaces_failure_when_config_reshaped.snap+++ /dev/null@@ -1,68 +0,0 @@-----source: tests/integration_tests/config_show.rs-info:- program: wt- args:- - config- - plugins- - claude- - uninstall- - "--yes"- env:- APPDATA: "[TEST_CONFIG_HOME]"- CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"- CLICOLOR_FORCE: "1"- COLUMNS: "500"- GIT_ALLOW_PROTOCOL: file- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"- GIT_AUTHOR_EMAIL: [email protected]- GIT_AUTHOR_NAME: Test User- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"- GIT_COMMITTER_EMAIL: [email protected]- GIT_COMMITTER_NAME: Test User- GIT_CONFIG_COUNT: "2"- GIT_CONFIG_GLOBAL: /nonexistent/wt/gitconfig- GIT_CONFIG_KEY_0: user.useConfigOnly- GIT_CONFIG_KEY_1: rerere.enabled- GIT_CONFIG_SYSTEM: /nonexistent/wt/gitconfig- GIT_CONFIG_VALUE_0: "true"- GIT_CONFIG_VALUE_1: "false"- GIT_TERMINAL_PROMPT: "0"- HOME: "[TEST_HOME]"- LANG: C- LC_ALL: C- LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"- OPENCODE_CONFIG_DIR: "[TEST_OPENCODE_CONFIG]"- PATH: "[PATH]"- TERM: alacritty- USERPROFILE: "[TEST_HOME]"- WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"- WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"- WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"- WORKTRUNK_TEST_BASH_INSTALLED: "0"- WORKTRUNK_TEST_CLAUDE_INSTALLED: "1"- WORKTRUNK_TEST_CODEX_INSTALLED: "0"- WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"- WORKTRUNK_TEST_EPOCH: "1735776000"- WORKTRUNK_TEST_FISH_INSTALLED: "0"- WORKTRUNK_TEST_GEMINI_INSTALLED: "0"- WORKTRUNK_TEST_MOCK_CONFIG_DIR: "[TEST_MOCK_CONFIG]"- WORKTRUNK_TEST_NUSHELL_ENV: "0"- WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"- WORKTRUNK_TEST_PARENT_SHELL: ""- WORKTRUNK_TEST_POWERSHELL_ENV: "0"- WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"- WORKTRUNK_TEST_PROBE_TIMEOUT_MS: "60000"- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"- WORKTRUNK_TEST_ZSH_INSTALLED: "0"- XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"-----success: false-exit_code: 1------ stdout ------------ stderr ------[36m◎[39m [36mUninstalling plugin...[39m-[36m◎[39m [36mRemoving Claude Code plugin marketplace...[39m-[31m✗[39m [31mclaude plugin marketplace remove worktrunk failed (exit 1)[39m-[107m [0m error: marketplace remove faileddiff --git a/tests/snapshots/integration__integration_tests__config_show__plugins_claude_uninstall_surfaces_failure_when_config_unreadable.snap b/tests/snapshots/integration__integration_tests__config_show__plugins_claude_uninstall_surfaces_failure_when_config_unreadable.snapdeleted file mode 100644index 0b3f4b191..000000000--- a/tests/snapshots/integration__integration_tests__config_show__plugins_claude_uninstall_surfaces_failure_when_config_unreadable.snap+++ /dev/null@@ -1,68 +0,0 @@-----source: tests/integration_tests/config_show.rs-info:- program: wt- args:- - config- - plugins- - claude- - uninstall- - "--yes"- env:- APPDATA: "[TEST_CONFIG_HOME]"- CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"- CLICOLOR_FORCE: "1"- COLUMNS: "500"- GIT_ALLOW_PROTOCOL: file- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"- GIT_AUTHOR_EMAIL: [email protected]- GIT_AUTHOR_NAME: Test User- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"- GIT_COMMITTER_EMAIL: [email protected]- GIT_COMMITTER_NAME: Test User- GIT_CONFIG_COUNT: "2"- GIT_CONFIG_GLOBAL: /nonexistent/wt/gitconfig- GIT_CONFIG_KEY_0: user.useConfigOnly- GIT_CONFIG_KEY_1: rerere.enabled- GIT_CONFIG_SYSTEM: /nonexistent/wt/gitconfig- GIT_CONFIG_VALUE_0: "true"- GIT_CONFIG_VALUE_1: "false"- GIT_TERMINAL_PROMPT: "0"- HOME: "[TEST_HOME]"- LANG: C- LC_ALL: C- LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"- OPENCODE_CONFIG_DIR: "[TEST_OPENCODE_CONFIG]"- PATH: "[PATH]"- TERM: alacritty- USERPROFILE: "[TEST_HOME]"- WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"- WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"- WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"- WORKTRUNK_TEST_BASH_INSTALLED: "0"- WORKTRUNK_TEST_CLAUDE_INSTALLED: "1"- WORKTRUNK_TEST_CODEX_INSTALLED: "0"- WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"- WORKTRUNK_TEST_EPOCH: "1735776000"- WORKTRUNK_TEST_FISH_INSTALLED: "0"- WORKTRUNK_TEST_GEMINI_INSTALLED: "0"- WORKTRUNK_TEST_MOCK_CONFIG_DIR: "[TEST_MOCK_CONFIG]"- WORKTRUNK_TEST_NUSHELL_ENV: "0"- WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"- WORKTRUNK_TEST_PARENT_SHELL: ""- WORKTRUNK_TEST_POWERSHELL_ENV: "0"- WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"- WORKTRUNK_TEST_PROBE_TIMEOUT_MS: "60000"- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"- WORKTRUNK_TEST_ZSH_INSTALLED: "0"- XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"-----success: false-exit_code: 1------ stdout ------------ stderr ------[36m◎[39m [36mUninstalling plugin...[39m-[36m◎[39m [36mRemoving Claude Code plugin marketplace...[39m-[31m✗[39m [31mclaude plugin marketplace remove worktrunk failed (exit 1)[39m-[107m [0m error: marketplace remove faileddiff --git a/tests/snapshots/integration__integration_tests__config_show__plugins_claude_uninstall_tolerates_marketplace_removed_from_config.snap b/tests/snapshots/integration__integration_tests__config_show__plugins_claude_uninstall_tolerates_marketplace_missing_from_list.snapsimilarity index 100%rename from tests/snapshots/integration__integration_tests__config_show__plugins_claude_uninstall_tolerates_marketplace_removed_from_config.snaprename to tests/snapshots/integration__integration_tests__config_show__plugins_claude_uninstall_tolerates_marketplace_missing_from_list.snapdiff --git a/tests/snapshots/integration__integration_tests__config_show__plugins_codex_uninstall_surfaces_failure_when_config_reshaped.snap b/tests/snapshots/integration__integration_tests__config_show__plugins_codex_uninstall_surfaces_failure_when_config_reshaped.snapdeleted file mode 100644index e5134b06d..000000000--- a/tests/snapshots/integration__integration_tests__config_show__plugins_codex_uninstall_surfaces_failure_when_config_reshaped.snap+++ /dev/null@@ -1,68 +0,0 @@-----source: tests/integration_tests/config_show.rs-info:- program: wt- args:- - config- - plugins- - codex- - uninstall- - "--yes"- env:- APPDATA: "[TEST_CONFIG_HOME]"- CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"- CLICOLOR_FORCE: "1"- COLUMNS: "500"- GIT_ALLOW_PROTOCOL: file- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"- GIT_AUTHOR_EMAIL: [email protected]- GIT_AUTHOR_NAME: Test User- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"- GIT_COMMITTER_EMAIL: [email protected]- GIT_COMMITTER_NAME: Test User- GIT_CONFIG_COUNT: "2"- GIT_CONFIG_GLOBAL: /nonexistent/wt/gitconfig- GIT_CONFIG_KEY_0: user.useConfigOnly- GIT_CONFIG_KEY_1: rerere.enabled- GIT_CONFIG_SYSTEM: /nonexistent/wt/gitconfig- GIT_CONFIG_VALUE_0: "true"- GIT_CONFIG_VALUE_1: "false"- GIT_TERMINAL_PROMPT: "0"- HOME: "[TEST_HOME]"- LANG: C- LC_ALL: C- LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"- OPENCODE_CONFIG_DIR: "[TEST_OPENCODE_CONFIG]"- PATH: "[PATH]"- TERM: alacritty- USERPROFILE: "[TEST_HOME]"- WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"- WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"- WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"- WORKTRUNK_TEST_BASH_INSTALLED: "0"- WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"- WORKTRUNK_TEST_CODEX_INSTALLED: "1"- WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"- WORKTRUNK_TEST_EPOCH: "1735776000"- WORKTRUNK_TEST_FISH_INSTALLED: "0"- WORKTRUNK_TEST_GEMINI_INSTALLED: "0"- WORKTRUNK_TEST_MOCK_CONFIG_DIR: "[TEST_MOCK_CONFIG]"- WORKTRUNK_TEST_NUSHELL_ENV: "0"- WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"- WORKTRUNK_TEST_PARENT_SHELL: ""- WORKTRUNK_TEST_POWERSHELL_ENV: "0"- WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"- WORKTRUNK_TEST_PROBE_TIMEOUT_MS: "60000"- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"- WORKTRUNK_TEST_ZSH_INSTALLED: "0"- XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"-----success: false-exit_code: 1------ stdout ------------ stderr ------[36m◎[39m [36mUninstalling plugin...[39m-[36m◎[39m [36mRemoving Codex plugin marketplace...[39m-[31m✗[39m [31mcodex plugin marketplace remove worktrunk failed (exit 1)[39m-[107m [0m error: marketplace remove faileddiff --git a/tests/snapshots/integration__integration_tests__config_show__plugins_codex_uninstall_surfaces_failure_when_config_unreadable.snap b/tests/snapshots/integration__integration_tests__config_show__plugins_codex_uninstall_surfaces_failure_when_config_unreadable.snapdeleted file mode 100644index e5134b06d..000000000--- a/tests/snapshots/integration__integration_tests__config_show__plugins_codex_uninstall_surfaces_failure_when_config_unreadable.snap+++ /dev/null@@ -1,68 +0,0 @@-----source: tests/integration_tests/config_show.rs-info:- program: wt- args:- - config- - plugins- - codex- - uninstall- - "--yes"- env:- APPDATA: "[TEST_CONFIG_HOME]"- CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"- CLICOLOR_FORCE: "1"- COLUMNS: "500"- GIT_ALLOW_PROTOCOL: file- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"- GIT_AUTHOR_EMAIL: [email protected]- GIT_AUTHOR_NAME: Test User- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"- GIT_COMMITTER_EMAIL: [email protected]- GIT_COMMITTER_NAME: Test User- GIT_CONFIG_COUNT: "2"- GIT_CONFIG_GLOBAL: /nonexistent/wt/gitconfig- GIT_CONFIG_KEY_0: user.useConfigOnly- GIT_CONFIG_KEY_1: rerere.enabled- GIT_CONFIG_SYSTEM: /nonexistent/wt/gitconfig- GIT_CONFIG_VALUE_0: "true"- GIT_CONFIG_VALUE_1: "false"- GIT_TERMINAL_PROMPT: "0"- HOME: "[TEST_HOME]"- LANG: C- LC_ALL: C- LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"- OPENCODE_CONFIG_DIR: "[TEST_OPENCODE_CONFIG]"- PATH: "[PATH]"- TERM: alacritty- USERPROFILE: "[TEST_HOME]"- WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"- WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"- WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"- WORKTRUNK_TEST_BASH_INSTALLED: "0"- WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"- WORKTRUNK_TEST_CODEX_INSTALLED: "1"- WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"- WORKTRUNK_TEST_EPOCH: "1735776000"- WORKTRUNK_TEST_FISH_INSTALLED: "0"- WORKTRUNK_TEST_GEMINI_INSTALLED: "0"- WORKTRUNK_TEST_MOCK_CONFIG_DIR: "[TEST_MOCK_CONFIG]"- WORKTRUNK_TEST_NUSHELL_ENV: "0"- WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"- WORKTRUNK_TEST_PARENT_SHELL: ""- WORKTRUNK_TEST_POWERSHELL_ENV: "0"- WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"- WORKTRUNK_TEST_PROBE_TIMEOUT_MS: "60000"- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"- WORKTRUNK_TEST_ZSH_INSTALLED: "0"- XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"-----success: false-exit_code: 1------ stdout ------------ stderr ------[36m◎[39m [36mUninstalling plugin...[39m-[36m◎[39m [36mRemoving Codex plugin marketplace...[39m-[31m✗[39m [31mcodex plugin marketplace remove worktrunk failed (exit 1)[39m-[107m [0m error: marketplace remove faileddiff --git a/tests/snapshots/integration__integration_tests__config_show__plugins_codex_uninstall_tolerates_marketplace_removed_from_config.snap b/tests/snapshots/integration__integration_tests__config_show__plugins_codex_uninstall_tolerates_marketplace_missing_from_list.snapsimilarity index 100%rename from tests/snapshots/integration__integration_tests__config_show__plugins_codex_uninstall_tolerates_marketplace_removed_from_config.snaprename to tests/snapshots/integration__integration_tests__config_show__plugins_codex_uninstall_tolerates_marketplace_missing_from_list.snap