Skip to content

Fix plugin issues#197

Merged
Jordonbc merged 5 commits intoDevfrom
Fix-plugin-issues
Mar 23, 2026
Merged

Fix plugin issues#197
Jordonbc merged 5 commits intoDevfrom
Fix-plugin-issues

Conversation

@Jordonbc
Copy link
Copy Markdown
Collaborator

No description provided.

@github-actions
Copy link
Copy Markdown

Code Review Summary

Changes Overview

This PR replaces .tar.xz compression with .tar.gz and refactors plugin path/bundle handling to use the installed plugin store instead of directly scanning built-in directories.

Potential Issues Found

  1. Bundle format migration (plugin_bundles.rs:25-47)

    • Old .tar.xz bundles will fail with "unsupported bundle compression" - this is a breaking change for existing installations
    • No migration path or fallback for legacy bundles
    • Consider if this is intentional or needs versioning support
  2. Built-in plugin synchronization assumption (plugin_vcs_backends.rs:131-135)

    • Removed direct built-in directory scanning, now assumes bundles are synchronized to the plugins dir at startup
    • The ensure_built_in_bundles() function runs during init - verify this always happens before backend listing
    • If synchronization fails silently, built-in backends won't appear
  3. Resource directory timing (lib.rs:159-163)

    • Changed from adding resource path to candidates explicitly to relying on bundled_node_candidate_paths() which reads RESOURCE_DIR
    • The order appears correct (set_resource_dir called before bundled_node_candidate_paths), but add a comment clarifying the dependency to prevent future refactor issues

Code Quality Suggestions

  1. Add fallback for legacy bundles - Consider supporting both formats during transition:

    if magic matches gzip { ... }
    else if magic matches xz { /* use XzDecoder */ }
    else { return Err(...) }
  2. Error handling in push_linux_package_resource_bases (plugin_paths.rs:86-108)

    • The read_dir error is silently ignored with continue - consider logging at trace level for debugging
  3. Missing error context - Several places use ? without context. Example:

    let reader = open_bundle_reader(bundle_path)?;  // loses bundle path in error

    Consider using .context() from anyhow or adding contextual errors.

Positive Changes

  • Good test updates to use tar.gz
  • Clean refactoring of path resolution with bundled_resource_base_dirs()
  • Proper magic byte detection for gzip format
  • Good documentation in new functions

The changes look reasonable but the xz→gz migration is a breaking change that should be documented in changelog/release notes.

New%20session%20-%202026-03-23T18%3A43%3A53.035Z
opencode session  |  github run

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 93a362abee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions
Copy link
Copy Markdown

Code Review Summary

Changes Overview

This PR replaces .tar.xz compression with .tar.gz and refactors plugin path/bundle handling to use the installed plugin store instead of directly scanning built-in directories.

Potential Issues Found

  1. Bundle format migration (plugin_bundles.rs:25-47)

    • Old .tar.xz bundles will fail with "unsupported bundle compression" - this is a breaking change for existing installations
    • No migration path or fallback for legacy bundles
    • Consider if this is intentional or needs versioning support
  2. Built-in plugin synchronization assumption (plugin_vcs_backends.rs:131-135)

    • Removed direct built-in directory scanning, now assumes bundles are synchronized to the plugins dir at startup
    • The ensure_built_in_bundles() function runs during init - verify this always happens before backend listing
    • If synchronization fails silently, built-in backends won't appear
  3. Resource directory timing (lib.rs:159-163)

    • Changed from adding resource path to candidates explicitly to relying on bundled_node_candidate_paths() which reads RESOURCE_DIR
    • The order appears correct (set_resource_dir called before bundled_node_candidate_paths), but add a comment clarifying the dependency to prevent future refactor issues

Code Quality Suggestions

  1. Add fallback for legacy bundles - Consider supporting both formats during transition:

    if magic matches gzip { ... }
    else if magic matches xz { /* use XzDecoder */ }
    else { return Err(...) }
  2. Error handling in push_linux_package_resource_bases (plugin_paths.rs:86-108)

    • The read_dir error is silently ignored with continue - consider logging at trace level for debugging
  3. Missing error context - Several places use ? without context. Example:

    let reader = open_bundle_reader(bundle_path)?;  // loses bundle path in error

    Consider using .context() from anyhow or adding contextual errors.

Positive Changes

  • Good test updates to use tar.gz
  • Clean refactoring of path resolution with bundled_resource_base_dirs()
  • Proper magic byte detection for gzip format
  • Good documentation in new functions

The changes look reasonable but the xz→gz migration is a breaking change that should be documented in changelog/release notes.

New%20session%20-%202026-03-23T18%3A57%3A55.846Z
opencode session  |  github run

@github-actions
Copy link
Copy Markdown

Code Review: Fix plugin issues

Overview

This PR replaces .tar.xz compression with .tar.gz and refactors plugin path/bundle handling to use the installed plugin store instead of directly scanning built-in directories.

Issues Found

1. Breaking Change - No Legacy Bundle Support (plugin_bundles.rs:40-46)

The bundle reader only checks for gzip magic bytes ([0x1F, 0x8B]). Old .tar.xz bundles will fail with "unsupported bundle compression". Consider adding format detection:

if read >= GZIP_MAGIC.len() && magic[..GZIP_MAGIC.len()] == GZIP_MAGIC {
    return Ok(Box::new(GzDecoder::new(file)));
}
// Consider XZ fallback for legacy bundles during transition

2. Missing Error Context (Multiple locations)

Several places use ? without contextual errors, making debugging harder. Example at plugin_bundles.rs:58:

let reader = open_bundle_reader(bundle_path)?;  // loses bundle path in error

3. Silent Error Handling (plugin_paths.rs:113-122)

The read_dir error is silently ignored with continue. While it's traced, consider adding more context about which directory failed.

Positive Changes

  • Good fix for Linux package scanning - is_known_linux_package_app_dir() now restricts to OpenVCS-owned directories, addressing the P2 Codex finding
  • Clean refactoring with bundled_resource_base_dirs() centralizing path logic
  • Documentation correctly updated to reflect .tar.gz format
  • Proper sync ordering: sync_built_in_plugins() runs before backend listing
  • Good comments added at lib.rs:166-169 clarifying resource dir timing dependency

Recommendation

The main concern is the xz→gz migration being a breaking change. Add a transitional fallback for legacy bundles or document this as a breaking change in release notes. Otherwise the refactoring is well-structured.

New%20session%20-%202026-03-23T18%3A58%3A45.488Z
opencode session  |  github run

@Jordonbc Jordonbc merged commit 58cf6ea into Dev Mar 23, 2026
7 checks passed
@Jordonbc Jordonbc deleted the Fix-plugin-issues branch March 23, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant