fix(core): gate fork_session_for_plugin behind the opencode-plugin-host feature - #2576
Open
1688mengdie wants to merge 1 commit into
Open
fix(core): gate fork_session_for_plugin behind the opencode-plugin-host feature#25761688mengdie wants to merge 1 commit into
1688mengdie wants to merge 1 commit into
Conversation
feature CoreProductAgentRuntime::fork_session_for_plugin is consumed only by the plugin host HTTP routes (plugin_host_http_routes_impl.rs), which the crate compiles under the `opencode-plugin-host` feature (lib.rs). Test builds that do not enable the feature — notably the sdk-host test compilation unit in the upstream CI `CLI Tests` jobs on ubuntu/macos — therefore report the function as dead code. Gate the function with #[cfg(feature = "opencode-plugin-host")] so feature-less test builds stop emitting the dead_code warning while the plugin host build keeps it available. Adopted-from: taiji 4c1ac80 (product_runtime.rs cfg gate hunk; the other hunks of that commit are taiji-side test-construction adaptations that upstream already carries and are not part of this fix). Test: cargo check --locked -p bitfun-core exit 0 with no dead_code warning for fork_session_for_plugin; cargo check -p bitfun-core --features opencode-plugin-host exit 0 (gate keeps the symbol available for the plugin host build). AI: implemented with AI assistance, lightly tested (cargo check only).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2570
Gate
CoreProductAgentRuntime::fork_session_for_plugin(src/crates/assembly/core/src/product_runtime.rs:614) behind#[cfg(feature = "opencode-plugin-host")].The function's only consumer is the plugin host HTTP routes implementation, which the crate compiles under the
opencode-plugin-hostfeature gate inlib.rs. Test builds that do not enable the feature — notably the sdk-host test compilation unit in the upstream CICLI Testsjobs on ubuntu/macos — therefore reported the function as dead code (see issue #2570 for the run evidence with file:line and rule names).Type and Areas
Type: bug fix (build warnings cleanup)
Areas: Rust core
Motivation / Impact
No direct user-facing change. The plugin-host build keeps the function available for its single consumer; feature-less test builds stop emitting the dead_code warning. This also makes the declaration's scope match the existing feature gate around its consumer.
Verification
cargo check --locked -p bitfun-coreon Windows: exit 0, no dead_code warning forfork_session_for_plugin.cargo check --locked -p bitfun-core --features opencode-plugin-hoston Windows: exit 0 (the gated symbol is still available to the plugin-host build).Reviewer Notes
#[allow]suppression is introduced.Checklist