{"record":{"id":"d0dfcc324fca8da1","repo":"zeroclaw-labs/zeroclaw","slug":"tool-linker","errorCode":null,"errorMessage":"tool linker","messagePattern":"tool linker","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-plugins/src/runtime.rs","lineNumber":55,"sourceCode":"    crate::component::add_wasi(&mut linker)?;\n    let mut options = crate::component::bindings::tool::LinkOptions::default();\n    options.plugins_wit_v0(true);\n    wt(\n        ToolPlugin::add_to_linker::<_, wasmtime::component::HasSelf<_>>(\n            &mut linker,\n            &options,\n            |s| s,\n        ),\n        \"failed to add tool plugin imports to linker\",\n    )?;\n    Ok(linker)\n}\n\n/// Cached linker for plugins without `HttpClient`: base WASI plus the tool\n/// world, no network.\nfn tool_linker() -> &'static Linker<PluginState> {\n    static LINKER: OnceLock<Linker<PluginState>> = OnceLock::new();\n    LINKER.get_or_init(|| base_linker().expect(\"tool linker\"))\n}\n\n/// Cached linker for `HttpClient` plugins: the base surface plus `wasi:http`.\n/// Built only once, on first use by an HTTP-granted plugin.\nfn tool_linker_http() -> &'static Linker<PluginState> {\n    static LINKER: OnceLock<Linker<PluginState>> = OnceLock::new();\n    LINKER.get_or_init(|| {\n        let mut linker = base_linker().expect(\"tool linker\");\n        crate::component::add_wasi_http(&mut linker).expect(\"tool http linker\");\n        linker\n    })\n}\n\n/// Compile and instantiate a tool plugin under one host-issued scope.\n///\n/// The scope decides whether the store carries an outbound-HTTP context and\n/// whether the linker exposes `wasi:http`; deriving both from the same scope\n/// prevents authority from drifting between instantiation and execution.","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-plugins/src/runtime.rs#L37-L73","documentation":"Error \"tool linker\" thrown in zeroclaw-labs/zeroclaw.","triggerScenarios":"Thrown at crates/zeroclaw-plugins/src/runtime.rs:55 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the plugin runtime's linker is initialized before instantiating plugin modules.","Check plugin build/feature flags so the tool linker is available, and restart the runtime."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}