{"record":{"id":"f4aa4733ab75b0e7","repo":"xai-org/grok-build","slug":"session-not-found-f4aa47","errorCode":null,"errorMessage":"session not found","messagePattern":"session not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-grok-shell/src/extensions/plugins.rs","lineNumber":168,"sourceCode":"                        .iter()\n                        .map(|p| loaded_plugin_to_info(p))\n                        .collect();\n                    PluginsListResponse { plugins }\n                }\n                None => PluginsListResponse {\n                    plugins: Vec::new(),\n                },\n            };\n            super::to_ext_response(Ok::<_, anyhow::Error>(response))\n        }\n        \"x.ai/plugins/action\" => {\n            let req: xai_hooks_plugins_types::PluginsActionRequest = super::parse_params(args)?;\n            let sid = acp::SessionId::new(req.session_id);\n\n            let result = agent\n                .execute_plugins_action(&sid, req.action)\n                .await\n                .ok_or_else(|| anyhow::anyhow!(\"session not found\"));\n            super::to_ext_response(result)\n        }\n        \"x.ai/plugins/notify-updates\" => {\n            // Broadcast a PluginUpdatesInstalled notification to the session.\n            #[derive(serde::Deserialize)]\n            #[serde(rename_all = \"camelCase\")]\n            struct NotifyUpdatesRequest {\n                session_id: String,\n                updates: Vec<(String, String, String)>, // (name, old_ver, new_ver)\n            }\n            let req: NotifyUpdatesRequest = super::parse_params(args)?;\n            let sid = acp::SessionId::new(req.session_id);\n            if let Some(handle) = agent.get_session_handle(&sid) {\n                handle.notify_plugin_updates(req.updates).await;\n            }\n            super::to_ext_response(Ok::<_, anyhow::Error>(serde_json::json!({ \"ok\": true })))\n        }\n        _ => Err(acp::Error::method_not_found()),","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-shell/src/extensions/plugins.rs#L150-L186","documentation":"The x.ai/plugins/action handler calls agent.execute_plugins_action with a SessionId; an Option::None result (session not registered with this agent) is mapped to the 'session not found' error. It indicates the agent has no live session matching the supplied ID when performing a plugin action.","triggerScenarios":"Calling x.ai/plugins/action with a session_id that doesn't exist, has closed, or belongs to a different agent instance (e.g. after restart or when multiple agent processes are running).","commonSituations":"Load-balanced/multi-process setups where the action hits an agent that doesn't own the session; stale IDs cached by tooling; session expiry.","solutions":["Use a session ID owned by the agent instance receiving the request (sticky routing in multi-instance setups)","Re-establish the session and retry the plugin action","Invalidate cached session IDs on disconnect/restart events in the client"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// ensure the target agent owns the session before dispatch\nif agent_owner_of(&req.session_id) != current_agent_instance {\n    return Err(\"session belongs to a different agent instance\".into());\n}","typeGuard":null,"tryCatchPattern":"// retry once after re-establishing the session\nmatch ext(\"x.ai/plugins/action\", req.clone()).await {\n    Err(e) if e.to_string() == \"session not found\" => {\n        req.session_id = create_session().await?;\n        ext(\"x.ai/plugins/action\", req).await\n    }\n    r => r,\n}","preventionTips":["Use sticky routing so session requests reach the owning agent instance","Refresh session IDs after reconnects or failovers","Log agent instance ID with each session to detect cross-instance calls"],"tags":["session","plugins","acp"],"backgroundTag":"session-not-found","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}