diff options
| author | akbash <akbash@herdr.dev> | 2026-08-10 14:57:44 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-10 14:57:44 +0300 |
| commit | ccccda54c21f6ef1649a44bb098d7c498724404d (patch) | |
| tree | 86f28b85086ef36fd7ebc0f1d928b7606d76c487 /src/integration/registry.rs | |
| parent | 2e8cc9060d723a5ac32a2325e695fd8750ff60fe (diff) | |
fix: track opencode tui session selection (#2455)
refs #2450
Co-authored-by: Ogulcan Celik <ogulcancelik@gmail.com>
Diffstat (limited to 'src/integration/registry.rs')
| -rw-r--r-- | src/integration/registry.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/integration/registry.rs b/src/integration/registry.rs index 569494a2..b7bb3bf2 100644 --- a/src/integration/registry.rs +++ b/src/integration/registry.rs @@ -405,6 +405,22 @@ fn grok_hook_config_is_valid(hook_path: &Path) -> bool { .is_some_and(|config| config == super::targets::grok_hook_config(hook_path)) } +fn opencode_tui_integration_is_valid(plugin_path: &Path, expected_version: u32) -> bool { + let Some(config_dir) = plugin_path.parent().and_then(Path::parent) else { + return false; + }; + let tui_plugin_path = config_dir.join(super::OPENCODE_TUI_PLUGIN_INSTALL_NAME); + let tui_plugin_current = fs::read_to_string(tui_plugin_path) + .ok() + .and_then(|content| parse_integration_version(&content)) + .is_some_and(|version| version >= expected_version); + tui_plugin_current + && super::opencode_config::tui_plugin_is_configured( + config_dir, + super::OPENCODE_TUI_PLUGIN_SPEC, + ) +} + pub(crate) fn integration_status_at( target: crate::api::schema::IntegrationTarget, path: PathBuf, @@ -439,6 +455,12 @@ pub(crate) fn integration_status_at( { state = super::IntegrationStatusKind::Outdated; } + if target == crate::api::schema::IntegrationTarget::Opencode + && state == super::IntegrationStatusKind::Current + && !opencode_tui_integration_is_valid(&path, expected_version) + { + state = super::IntegrationStatusKind::Outdated; + } super::IntegrationStatus { target, |
