From 2356ac5f3d32e685d51b99fa267362ea28daf878 Mon Sep 17 00:00:00 2001 From: user Date: Fri, 28 Aug 2026 02:39:04 +0800 Subject: [PATCH] fix(core): gate fork_session_for_plugin behind the opencode-plugin-host feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 4c1ac8021 (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). --- src/crates/assembly/core/src/product_runtime.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/crates/assembly/core/src/product_runtime.rs b/src/crates/assembly/core/src/product_runtime.rs index 18825c7f13..b8113d6cd2 100644 --- a/src/crates/assembly/core/src/product_runtime.rs +++ b/src/crates/assembly/core/src/product_runtime.rs @@ -611,6 +611,7 @@ impl LocalWorkspaceSnapshotPort for CoreLocalWorkspaceSnapshot { /// harnesses; plugin runtime bindings are deliberately not part of this API. pub struct CoreProductAgentRuntime; +#[cfg(feature = "opencode-plugin-host")] pub(crate) async fn fork_session_for_plugin( workspace_path: PathBuf, source_session_id: String,