Skip to content

🙌 OpenHands: AI-Driven Development

feat: show a conversation's attached plugins in the tools menu (#1483)

Hiep Le357719c48a09
diff --git a/__tests__/api/use-create-conversation-metadata.test.ts b/__tests__/api/use-create-conversation-metadata.test.ts
index 1033df95fd..535af93fcb 100644
--- a/__tests__/api/use-create-conversation-metadata.test.ts
+++ b/__tests__/api/use-create-conversation-metadata.test.ts
@@ -16,6 +16,7 @@ const {
mockGetSettings,
mockGetSettingsForConversation,
mockUseLlmProfiles,
+ mockListInstalledPlugins,
} = vi.hoisted(() => ({
mockHttpPost: vi.fn(),
mockConversationClient: vi.fn(),
@@ -23,6 +24,7 @@ const {
mockGetSettings: vi.fn(),
mockGetSettingsForConversation: vi.fn(),
mockUseLlmProfiles: vi.fn(),
+ mockListInstalledPlugins: vi.fn(),
}));
vi.mock("@openhands/typescript-client/clients", async () => {
@@ -72,6 +74,12 @@ vi.mock("#/hooks/query/use-llm-profiles", () => ({
useLlmProfiles: () => mockUseLlmProfiles(),
}));
+vi.mock("#/api/plugins-management-service", () => ({
+ default: {
+ listInstalledPlugins: mockListInstalledPlugins,
+ },
+}));
+
const wrapper = ({ children }: { children: React.ReactNode }) => {
const client = new QueryClient({
defaultOptions: { queries: { retry: false }, mutations: { retry: false } },
@@ -86,6 +94,10 @@ describe("useCreateConversation persists selected repository metadata", () => {
// Default: no active profile, so metadata is written only for repo/
// workspace attachments (as before). Individual tests override this.
mockUseLlmProfiles.mockReturnValue({ data: { active_profile: null } });
+ mockListInstalledPlugins.mockReset();
+ // Default: no installed plugins, so the existing repo/workspace/profile
+ // assertions are unaffected. Plugin-specific tests override this.
+ mockListInstalledPlugins.mockResolvedValue([]);
mockHttpPost.mockReset();
mockGetSettings.mockReset();
mockGetSettingsForConversation.mockReset();
@@ -195,6 +207,85 @@ describe("useCreateConversation persists selected repository metadata", () => {
selected_workspace: null,
workspace_mode: null,
active_profile: "team-default",
+ plugins: null,
+ });
+ });
+
+ it("records the enabled installed plugins (excluding disabled ones) so the in-conversation plugins view can show them", async () => {
+ // Arrange: one enabled and one disabled plugin are installed locally.
+ mockListInstalledPlugins.mockResolvedValue([
+ {
+ name: "city-weather",
+ version: "1.0.0",
+ description: null,
+ enabled: true,
+ source: "github:acme/city-weather",
+ resolved_ref: "abc123",
+ repo_path: null,
+ installed_at: "2026-05-05T00:00:00Z",
+ install_path: "/plugins/city-weather",
+ },
+ {
+ name: "stocks",
+ version: "1.0.0",
+ description: null,
+ enabled: false,
+ source: "github:acme/stocks",
+ resolved_ref: null,
+ repo_path: null,
+ installed_at: "2026-05-05T00:00:00Z",
+ install_path: "/plugins/stocks",
+ },
+ ]);
+
+ const { result } = renderHook(() => useCreateConversation(), { wrapper });
+
+ result.current.mutate({ query: "what's the weather?" });
+
+ await waitFor(() => expect(result.current.isSuccess).toBe(true));
+
+ // Only the enabled plugin is snapshotted, mapped to coordinates
+ // (resolved_ref -> ref) and keeping its name for display.
+ expect(getStoredConversationMetadata("conv-new")?.plugins).toEqual([
+ {
+ source: "github:acme/city-weather",
+ ref: "abc123",
+ repo_path: null,
+ name: "city-weather",
+ },
+ ]);
+ });
+
+ it("does not duplicate a plugin that is both explicitly attached and enabled-installed", async () => {
+ // Arrange: the same plugin is passed explicitly and is enabled-installed.
+ mockListInstalledPlugins.mockResolvedValue([
+ {
+ name: "city-weather",
+ version: "1.0.0",
+ description: null,
+ enabled: true,
+ source: "github:acme/city-weather",
+ resolved_ref: "main",
+ repo_path: null,
+ installed_at: "2026-05-05T00:00:00Z",
+ install_path: "/plugins/city-weather",
+ },
+ ]);
+
+ const { result } = renderHook(() => useCreateConversation(), { wrapper });
+
+ result.current.mutate({
+ query: "what's the weather?",
+ plugins: [
+ { source: "github:acme/city-weather", ref: "main", repo_path: null },
+ ],
});
+
+ await waitFor(() => expect(result.current.isSuccess).toBe(true));
+
+ // The plugin is recorded exactly once.
+ expect(getStoredConversationMetadata("conv-new")?.plugins).toEqual([
+ { source: "github:acme/city-weather", ref: "main", repo_path: null },
+ ]);
});
});
diff --git a/__tests__/components/context-menu/tools-context-menu.test.tsx b/__tests__/components/context-menu/tools-context-menu.test.tsx
index 7377febdf5..c7e089c2f2 100644
--- a/__tests__/components/context-menu/tools-context-menu.test.tsx
+++ b/__tests__/components/context-menu/tools-context-menu.test.tsx
@@ -1,5 +1,6 @@
import { describe, it, expect, vi } from "vitest";
import { render, screen } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
import React from "react";
import { adaptSystemMessage } from "#/utils/system-message-adapter";
import { EventState } from "#/stores/use-event-store";
@@ -44,6 +45,7 @@ describe("SystemMessage UI Rendering", () => {
<ToolsContextMenu
onClose={() => {}}
onShowSkills={() => {}}
+ onShowPlugins={() => {}}
onShowHooks={() => {}}
onShowAgentTools={() => {}}
/>,
@@ -67,3 +69,37 @@ describe("SystemMessage UI Rendering", () => {
expect(messageElement).toBeVisible();
});
});
+
+describe("ToolsContextMenu - Show Plugins", () => {
+ it("renders the Show Plugins item and calls onShowPlugins when clicked", async () => {
+ const onShowPlugins = vi.fn();
+ render(
+ <ToolsContextMenu
+ onClose={() => {}}
+ onShowSkills={() => {}}
+ onShowPlugins={onShowPlugins}
+ onShowHooks={() => {}}
+ onShowAgentTools={() => {}}
+ shouldShowPlugins
+ />,
+ );
+
+ await userEvent.click(screen.getByTestId("show-plugins-button"));
+
+ expect(onShowPlugins).toHaveBeenCalledTimes(1);
+ });
+
+ it("hides the Show Plugins item when the conversation has no attached plugins", () => {
+ render(
+ <ToolsContextMenu
+ onClose={() => {}}
+ onShowSkills={() => {}}
+ onShowPlugins={() => {}}
+ onShowHooks={() => {}}
+ onShowAgentTools={() => {}}
+ />,
+ );
+
+ expect(screen.queryByTestId("show-plugins-button")).not.toBeInTheDocument();
+ });
+});
diff --git a/__tests__/components/features/conversation-panel/plugins-modal.test.tsx b/__tests__/components/features/conversation-panel/plugins-modal.test.tsx
new file mode 100644
index 0000000000..46e88c6ed0
--- /dev/null
+++ b/__tests__/components/features/conversation-panel/plugins-modal.test.tsx
@@ -0,0 +1,103 @@
+import { screen } from "@testing-library/react";
+import { afterEach, describe, expect, it, vi } from "vitest";
+import { renderWithProviders } from "test-utils";
+import {
+ removeStoredConversationMetadata,
+ setStoredConversationMetadata,
+} from "#/api/conversation-metadata-store";
+import { PluginsModal } from "#/components/features/conversation-panel/plugins-modal";
+
+const CONVERSATION_ID = "conv-plugins-modal";
+
+afterEach(() => removeStoredConversationMetadata(CONVERSATION_ID));
+
+function renderModal() {
+ return renderWithProviders(<PluginsModal onClose={vi.fn()} />, {
+ navigation: { conversationId: CONVERSATION_ID },
+ });
+}
+
+describe("PluginsModal", () => {
+ it("lists the plugins attached to the conversation with their source and ref", () => {
+ setStoredConversationMetadata(CONVERSATION_ID, {
+ selected_repository: null,
+ selected_branch: null,
+ git_provider: null,
+ plugins: [
+ {
+ source: "github:OpenHands/extensions",
+ ref: "main",
+ repo_path: "plugins/city-weather",
+ },
+ ],
+ });
+
+ renderModal();
+
+ expect(
+ screen.getByTestId("active-plugin-city-weather"),
+ ).toBeInTheDocument();
+ expect(screen.getByText("OpenHands/extensions @ main")).toBeInTheDocument();
+ });
+
+ it("shows the plugin's name when the source is not a useful label", () => {
+ // A locally-installed plugin: the source ("local") can't be derived into a
+ // meaningful name, so the explicit name must be displayed.
+ setStoredConversationMetadata(CONVERSATION_ID, {
+ selected_repository: null,
+ selected_branch: null,
+ git_provider: null,
+ plugins: [
+ { source: "local", ref: null, repo_path: null, name: "city-weather" },
+ ],
+ });
+
+ renderModal();
+
+ expect(
+ screen.getByTestId("active-plugin-city-weather"),
+ ).toBeInTheDocument();
+ });
+
+ it("renders a normalized 'Local' label for locally-installed plugins instead of the raw source", () => {
+ // The agent-server records local installs two ways: the "local" sentinel
+ // and an absolute filesystem path. Both should read the same, and the path
+ // (which leaks the home dir) must not be shown verbatim.
+ setStoredConversationMetadata(CONVERSATION_ID, {
+ selected_repository: null,
+ selected_branch: null,
+ git_provider: null,
+ plugins: [
+ { source: "local", ref: null, repo_path: null, name: "city-weather" },
+ {
+ source:
+ "/Users/me/.openhands/cache/skills/public-skills/plugins/magic-test",
+ ref: null,
+ repo_path: null,
+ name: "magic-test",
+ },
+ ],
+ });
+
+ renderModal();
+
+ expect(screen.getAllByText("PLUGINS_MODAL$SOURCE_LOCAL")).toHaveLength(2);
+ expect(
+ screen.queryByText(
+ "/Users/me/.openhands/cache/skills/public-skills/plugins/magic-test",
+ ),
+ ).not.toBeInTheDocument();
+ });
+
+ it("shows the empty state when no plugins are attached", () => {
+ setStoredConversationMetadata(CONVERSATION_ID, {
+ selected_repository: null,
+ selected_branch: null,
+ git_provider: null,
+ });
+
+ renderModal();
+
+ expect(screen.getByText("PLUGINS_MODAL$EMPTY")).toBeInTheDocument();
+ });
+});
diff --git a/__tests__/contexts/conversation-websocket-context.test.tsx b/__tests__/contexts/conversation-websocket-context.test.tsx
index 462212b33a..72210000bc 100644
--- a/__tests__/contexts/conversation-websocket-context.test.tsx
+++ b/__tests__/contexts/conversation-websocket-context.test.tsx
@@ -8,7 +8,10 @@ import { useOptimisticUserMessageStore } from "#/stores/optimistic-user-message-
import { useBrowserStore } from "#/stores/browser-store";
import { useUserConversation } from "#/hooks/query/use-user-conversation";
import EventService from "#/api/event-service/event-service.api";
-import { getStoredConversationMetadata } from "#/api/conversation-metadata-store";
+import {
+ getStoredConversationMetadata,
+ setStoredConversationMetadata,
+} from "#/api/conversation-metadata-store";
import type { MessageEvent } from "#/types/agent-server/core";
// Captures the main socket's `onMessage` (`handleMainMessage`) so tests can
@@ -153,6 +156,41 @@ describe("ConversationWebSocketProvider — conversation-scoped event store", ()
);
});
+ it("preserves the conversation's attached plugins across an agent-triggered model switch", async () => {
+ // Arrange: the conversation's metadata already carries an attached plugin.
+ setStoredConversationMetadata("conv-switch", {
+ selected_repository: null,
+ selected_branch: null,
+ git_provider: null,
+ plugins: [
+ { source: "github:acme/city-weather", ref: null, repo_path: null },
+ ],
+ });
+ render(
+ <QueryClientProvider client={queryClient}>
+ <ConversationWebSocketProvider
+ conversationId="conv-switch"
+ conversationUrl="http://localhost/api"
+ >
+ <div />
+ </ConversationWebSocketProvider>
+ </QueryClientProvider>,
+ );
+ await waitFor(() => expect(wsCapture.mainOnMessage).not.toBeNull());
+
+ // Act: the agent switches model via the SwitchLLM tool.
+ act(() => {
+ wsCapture.mainOnMessage!({
+ data: JSON.stringify(makeAgentSwitchObservation("fast-opus")),
+ });
+ });
+
+ // Assert: the plugins snapshot survives the full-object metadata replace.
+ expect(getStoredConversationMetadata("conv-switch")?.plugins).toEqual([
+ { source: "github:acme/city-weather", ref: null, repo_path: null },
+ ]);
+ });
+
it("clears the previous conversation's events when switching conversations", async () => {
// Arrange + Act: open conversation A.
const { rerender } = renderProvider("conv-a");
diff --git a/__tests__/hooks/mutation/use-create-conversation.test.tsx b/__tests__/hooks/mutation/use-create-conversation.test.tsx
index ddf61b6565..f57d5b175e 100644
--- a/__tests__/hooks/mutation/use-create-conversation.test.tsx
+++ b/__tests__/hooks/mutation/use-create-conversation.test.tsx
@@ -1,9 +1,13 @@
import { renderHook, waitFor } from "@testing-library/react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
-import { describe, expect, it, vi } from "vitest";
+import { afterEach, describe, expect, it, vi } from "vitest";
import AgentServerConversationService from "#/api/conversation-service/agent-server-conversation-service.api";
import { useCreateConversation } from "#/hooks/mutation/use-create-conversation";
import { SuggestedTask } from "#/utils/types";
+import {
+ getStoredConversationMetadata,
+ removeStoredConversationMetadata,
+} from "#/api/conversation-metadata-store";
vi.mock("#/hooks/use-tracking", () => ({
useTracking: () => ({
@@ -23,6 +27,8 @@ vi.mock("#/hooks/query/use-llm-profiles", () => ({
}));
describe("useCreateConversation", () => {
+ afterEach(() => removeStoredConversationMetadata("conv-with-plugins"));
+
it("passes suggested tasks to the V1 create conversation API", async () => {
const createConversationSpy = vi
.spyOn(AgentServerConversationService, "createConversation")
@@ -150,4 +156,59 @@ describe("useCreateConversation", () => {
});
});
});
+
+ it("persists explicitly-attached plugins (coordinates only) to conversation metadata at creation", async () => {
+ vi.spyOn(
+ AgentServerConversationService,
+ "createConversation",
+ ).mockResolvedValue({
+ id: "task-id",
+ created_by_user_id: null,
+ status: "READY",
+ detail: null,
+ app_conversation_id: "conv-with-plugins",
+ agent_server_url: "http://agent-server.local",
+ request: {
+ initial_message: null,
+ processors: [],
+ llm_model: null,
+ selected_repository: null,
+ selected_branch: null,
+ git_provider: "github",
+ suggested_task: null,
+ title: null,
+ trigger: null,
+ pr_number: [],
+ parent_conversation_id: null,
+ agent_type: "default",
+ },
+ created_at: new Date().toISOString(),
+ updated_at: new Date().toISOString(),
+ });
+
+ const { result } = renderHook(() => useCreateConversation(), {
+ wrapper: ({ children }) => (
+ <QueryClientProvider client={new QueryClient()}>
+ {children}
+ </QueryClientProvider>
+ ),
+ });
+
+ await result.current.mutateAsync({
+ plugins: [
+ {
+ source: "github:o/a",
+ ref: null,
+ repo_path: "plugins/a",
+ parameters: { token: "secret" },
+ },
+ ],
+ });
+
+ await waitFor(() =>
+ expect(
+ getStoredConversationMetadata("conv-with-plugins")?.plugins,
+ ).toEqual([{ source: "github:o/a", ref: null, repo_path: "plugins/a" }]),
+ );
+ });
});
diff --git a/__tests__/hooks/mutation/use-switch-llm-profile-and-log.test.tsx b/__tests__/hooks/mutation/use-switch-llm-profile-and-log.test.tsx
index 421fb74f8b..5bb2ef713c 100644
--- a/__tests__/hooks/mutation/use-switch-llm-profile-and-log.test.tsx
+++ b/__tests__/hooks/mutation/use-switch-llm-profile-and-log.test.tsx
@@ -50,9 +50,31 @@ describe("useSwitchLlmProfileAndLog", () => {
git_provider: "github",
selected_workspace: null,
active_profile: "claude-sonnet-4.6",
+ plugins: null,
});
});
+ it("preserves the conversation's attached plugins across a profile switch", () => {
+ switchMutateMock.mockImplementation((_vars, opts) => opts?.onSuccess?.());
+ // A plugin snapshot persisted at creation must survive the full-object
+ // metadata replace the switch performs.
+ setStoredConversationMetadata("conv-1", {
+ selected_repository: null,
+ selected_branch: null,
+ git_provider: null,
+ plugins: [
+ { source: "github:acme/city-weather", ref: null, repo_path: null },
+ ],
+ });
+
+ const { result } = renderHook(() => useSwitchLlmProfileAndLog());
+ result.current.switchAndLog("conv-1", "claude-sonnet-4.6");
+
+ expect(getStoredConversationMetadata("conv-1")?.plugins).toEqual([
+ { source: "github:acme/city-weather", ref: null, repo_path: null },
+ ]);
+ });
+
it("does not stamp metadata for the home-page activate path (conversationId === null)", () => {
switchMutateMock.mockImplementation((_vars, opts) => opts?.onSuccess?.());
diff --git a/src/api/conversation-metadata-store.ts b/src/api/conversation-metadata-store.ts
index be02572e2c..60388b57f7 100644
--- a/src/api/conversation-metadata-store.ts
+++ b/src/api/conversation-metadata-store.ts
@@ -1,4 +1,5 @@
import { Provider } from "#/types/settings";
+import type { PluginSpec } from "#/api/conversation-service/agent-server-conversation-service.types";
const STORAGE_KEY = "openhands-agent-server-conversation-metadata";
@@ -34,6 +35,16 @@ export interface ConversationMetadata {
* is ambiguous (issue #1082).
*/
active_profile?: string | null;
+ /**
+ * Snapshot of the plugins loaded into the conversation, captured at creation
+ * (coordinates only — `parameters` are stripped): plugins explicitly attached
+ * at creation plus the enabled installed plugins the SDK auto-loads into new
+ * local conversations. The agent-server doesn't expose a live conversation's
+ * loaded plugins, so this is the client-side source for the in-conversation
+ * plugins view. Local + forward-only: only set for conversations created
+ * after this shipped, and only when `app_conversation_id` is known.
+ */
+ plugins?: PluginSpec[] | null;
}
type StoredMetadata = Record<string, ConversationMetadata>;
diff --git a/src/api/conversation-service/agent-server-conversation-service.types.ts b/src/api/conversation-service/agent-server-conversation-service.types.ts
index eb3b8c11ee..724507d6c1 100644
--- a/src/api/conversation-service/agent-server-conversation-service.types.ts
+++ b/src/api/conversation-service/agent-server-conversation-service.types.ts
@@ -20,6 +20,9 @@ export interface PluginSpec {
ref?: string | null; // Optional branch, tag, or commit
repo_path?: string | null; // Subdirectory path within the git repository
parameters?: Record<string, unknown> | null; // User-provided configuration values
+ // Client-side display label (e.g. an installed plugin's `name`). Not a
+ // coordinate and not required by the agent-server; used only for rendering.
+ name?: string | null;
}
// V1 Metrics Types
diff --git a/src/components/features/chat/chat-add-file-button.tsx b/src/components/features/chat/chat-add-file-button.tsx
index c43aaa90e5..c32cbd16cb 100644
--- a/src/components/features/chat/chat-add-file-button.tsx
+++ b/src/components/features/chat/chat-add-file-button.tsx
@@ -10,6 +10,7 @@ import { useConversationNameContextMenu } from "#/hooks/use-conversation-name-co
import { ToolsContextMenu } from "#/components/features/controls/tools-context-menu";
import { SystemMessageModal } from "#/components/features/conversation-panel/system-message-modal";
import { SkillsModal } from "#/components/features/conversation-panel/skills-modal";
+import { PluginsModal } from "#/components/features/conversation-panel/plugins-modal";
import { HooksModal } from "#/components/features/conversation-panel/hooks-modal";
export interface ChatAddFileButtonProps {
@@ -29,16 +30,20 @@ export function ChatAddFileButton({
const {
handleShowAgentTools,
handleShowSkills,
+ handleShowPlugins,
handleShowHooks,
systemModalVisible,
setSystemModalVisible,
skillsModalVisible,
setSkillsModalVisible,
+ pluginsModalVisible,
+ setPluginsModalVisible,
hooksModalVisible,
setHooksModalVisible,
systemMessage,
shouldShowAgentTools,
shouldShowHooks,
+ shouldShowPlugins,
} = useConversationNameContextMenu({
conversationId: conversationId ?? undefined,
executionStatus: conversation?.execution_status,
@@ -81,10 +86,12 @@ export function ChatAddFileButton({
<ToolsContextMenu
onClose={() => setMenuOpen(false)}
onShowSkills={handleShowSkills}
+ onShowPlugins={handleShowPlugins}
onShowHooks={handleShowHooks}
onShowAgentTools={handleShowAgentTools}
shouldShowAgentTools={shouldShowAgentTools}
shouldShowHooks={shouldShowHooks}
+ shouldShowPlugins={shouldShowPlugins}
footerAction={{
testId: "add-files-and-images-button",
icon: (
@@ -108,6 +115,9 @@ export function ChatAddFileButton({
{skillsModalVisible && (
<SkillsModal onClose={() => setSkillsModalVisible(false)} />
)}
+ {pluginsModalVisible && (
+ <PluginsModal onClose={() => setPluginsModalVisible(false)} />
+ )}
{hooksModalVisible && (
<HooksModal onClose={() => setHooksModalVisible(false)} />
)}
diff --git a/src/components/features/controls/tools-context-menu.tsx b/src/components/features/controls/tools-context-menu.tsx
index ba24d2d42b..efe4a458b6 100644
--- a/src/components/features/controls/tools-context-menu.tsx
+++ b/src/components/features/controls/tools-context-menu.tsx
@@ -11,6 +11,7 @@ import { I18nKey } from "#/i18n/declaration";
import CodeBranchIcon from "#/icons/u-code-branch.svg?react";
import SkillsIcon from "#/icons/skills.svg?react";
+import PuzzleIcon from "#/icons/u-puzzle-piece.svg?react";
import FishingHookIcon from "#/icons/fishing-hook.svg?react";
import ToolsIcon from "#/icons/u-tools.svg?react";
import SettingsIcon from "#/icons/settings.svg?react";
@@ -24,10 +25,12 @@ import { useIsArchivedConversation } from "#/hooks/use-is-archived-conversation"
interface ToolsContextMenuProps {
onClose: () => void;
onShowSkills: (event: React.MouseEvent<HTMLButtonElement>) => void;
+ onShowPlugins: (event: React.MouseEvent<HTMLButtonElement>) => void;
onShowHooks: (event: React.MouseEvent<HTMLButtonElement>) => void;
onShowAgentTools: (event: React.MouseEvent<HTMLButtonElement>) => void;
shouldShowAgentTools?: boolean;
shouldShowHooks?: boolean;
+ shouldShowPlugins?: boolean;
/** When set, renders a divider and this action as the last menu item. */
footerAction?: {
testId: string;
@@ -40,10 +43,12 @@ interface ToolsContextMenuProps {
export function ToolsContextMenu({
onClose,
onShowSkills,
+ onShowPlugins,
onShowHooks,
onShowAgentTools,
shouldShowAgentTools = true,
shouldShowHooks = false,
+ shouldShowPlugins = false,
footerAction,
}: ToolsContextMenuProps) {
const { t } = useTranslation("openhands");
@@ -165,6 +170,22 @@ export function ToolsContextMenu({
</ContextMenuListItem>
</ArchivedDisabledTooltip>
+ {/* Show Plugins - only when this conversation has attached plugins */}
+ {shouldShowPlugins && (
+ <ArchivedDisabledTooltip isDisabled={isArchivedConversation}>
+ <ContextMenuListItem
+ testId="show-plugins-button"
+ onClick={onShowPlugins}
+ isDisabled={isArchivedConversation}
+ >
+ <ToolsContextMenuIconText
+ icon={<PuzzleIcon width={16} height={16} aria-hidden />}
+ text={t(I18nKey.CONVERSATION$SHOW_PLUGINS)}
+ />
+ </ContextMenuListItem>
+ </ArchivedDisabledTooltip>
+ )}
+
{/* Show Hooks - Only show for V1 conversations */}
{shouldShowHooks && (
<ArchivedDisabledTooltip isDisabled={isArchivedConversation}>
diff --git a/src/components/features/controls/tools.tsx b/src/components/features/controls/tools.tsx
index ca0dc733ad..035aaed704 100644
--- a/src/components/features/controls/tools.tsx
+++ b/src/components/features/controls/tools.tsx
@@ -10,6 +10,7 @@ import { useConversationNameContextMenu } from "#/hooks/use-conversation-name-co
import { useActiveConversation } from "#/hooks/query/use-active-conversation";
import { SystemMessageModal } from "../conversation-panel/system-message-modal";
import { SkillsModal } from "../conversation-panel/skills-modal";
+import { PluginsModal } from "../conversation-panel/plugins-modal";
import { HooksModal } from "../conversation-panel/hooks-modal";
import { cn } from "#/utils/utils";
@@ -24,16 +25,20 @@ export function Tools() {
const {
handleShowAgentTools,
handleShowSkills,
+ handleShowPlugins,
handleShowHooks,
systemModalVisible,
setSystemModalVisible,
skillsModalVisible,
setSkillsModalVisible,
+ pluginsModalVisible,
+ setPluginsModalVisible,
hooksModalVisible,
setHooksModalVisible,
systemMessage,
shouldShowAgentTools,
shouldShowHooks,
+ shouldShowPlugins,
} = useConversationNameContextMenu({
conversationId: conversationId ?? undefined,
executionStatus: conversation?.execution_status,
@@ -68,10 +73,12 @@ export function Tools() {
<ToolsContextMenu
onClose={() => setContextMenuOpen(false)}
onShowSkills={handleShowSkills}
+ onShowPlugins={handleShowPlugins}
onShowHooks={handleShowHooks}
onShowAgentTools={handleShowAgentTools}
shouldShowAgentTools={shouldShowAgentTools}
shouldShowHooks={shouldShowHooks}
+ shouldShowPlugins={shouldShowPlugins}
/>
)}
@@ -87,6 +94,11 @@ export function Tools() {
<SkillsModal onClose={() => setSkillsModalVisible(false)} />
)}
+ {/* Plugins Modal */}
+ {pluginsModalVisible && (
+ <PluginsModal onClose={() => setPluginsModalVisible(false)} />
+ )}
+
{/* Hooks Modal */}
{hooksModalVisible && (
<HooksModal onClose={() => setHooksModalVisible(false)} />
diff --git a/src/components/features/conversation-panel/plugins-modal.tsx b/src/components/features/conversation-panel/plugins-modal.tsx
new file mode 100644
index 0000000000..8c23198591
--- /dev/null
+++ b/src/components/features/conversation-panel/plugins-modal.tsx
@@ -0,0 +1,77 @@
+import { useTranslation } from "react-i18next";
+import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop";
+import { ModalBody } from "#/components/shared/modals/modal-body";
+import { ModalCloseButton } from "#/components/shared/modals/modal-close-button";
+import { BaseModalTitle } from "#/components/shared/modals/confirmation-modals/base-modal";
+import { I18nKey } from "#/i18n/declaration";
+import { Typography } from "#/ui/typography";
+import { useConversationPlugins } from "#/hooks/use-conversation-plugins";
+import {
+ getPluginDisplayName,
+ getPluginSourceLabel,
+ isLocalPluginSource,
+ pluginReferenceKey,
+} from "#/utils/plugin-display";
+
+interface PluginsModalProps {
+ onClose: () => void;
+}
+
+/**
+ * Display-only view of the plugins loaded into the current conversation,
+ * captured in client-side metadata at creation (explicitly attached plugins
+ * plus the enabled installed plugins the SDK auto-loads). Mirrors
+ * {@link SkillsModal}. The agent-server doesn't expose a live conversation's
+ * loaded plugins, so this reads that client-side snapshot.
+ */
+export function PluginsModal({ onClose }: PluginsModalProps) {
+ const { t } = useTranslation("openhands");
+ const plugins = useConversationPlugins();
+
+ return (
+ <ModalBackdrop onClose={onClose}>
+ <ModalBody
+ width="lg"
+ className="relative flex max-h-[80vh] flex-col items-start border border-[var(--oh-border)]"
+ testID="plugins-modal"
+ >
+ <ModalCloseButton onClose={onClose} testId="close-plugins-modal" />
+ <div className="flex w-full flex-col gap-2 pr-10">
+ <BaseModalTitle title={t(I18nKey.PLUGINS_MODAL$TITLE)} />
+ <Typography.Text className="text-sm text-[var(--oh-muted)]">
+ {t(I18nKey.PLUGINS_MODAL$DESCRIPTION)}
+ </Typography.Text>
+ </div>
+
+ <div className="w-full overflow-auto rounded-md border border-[var(--oh-border)] bg-surface-raised custom-scrollbar-always">
+ {plugins.length === 0 ? (
+ <div className="flex items-center justify-center p-6">
+ <Typography.Text className="text-[var(--oh-muted)]">
+ {t(I18nKey.PLUGINS_MODAL$EMPTY)}
+ </Typography.Text>
+ </div>
+ ) : (
+ <ul className="divide-y divide-[var(--oh-border)]">
+ {plugins.map((plugin) => (
+ <li
+ key={pluginReferenceKey(plugin)}
+ data-testid={`active-plugin-${getPluginDisplayName(plugin)}`}
+ className="flex flex-col gap-1 p-4"
+ >
+ <Typography.Text className="font-semibold text-white">
+ {getPluginDisplayName(plugin)}
+ </Typography.Text>
+ <Typography.Text className="text-xs text-tertiary-alt">
+ {isLocalPluginSource(plugin)
+ ? t(I18nKey.PLUGINS_MODAL$SOURCE_LOCAL)
+ : getPluginSourceLabel(plugin)}
+ </Typography.Text>
+ </li>
+ ))}
+ </ul>
+ )}
+ </div>
+ </ModalBody>
+ </ModalBackdrop>
+ );
+}
diff --git a/src/contexts/conversation-websocket-context.tsx b/src/contexts/conversation-websocket-context.tsx
index 3e6b314c77..ed8bc691e1 100644
--- a/src/contexts/conversation-websocket-context.tsx
+++ b/src/contexts/conversation-websocket-context.tsx
@@ -601,6 +601,9 @@ export function ConversationWebSocketProvider({
git_provider: prevMetadata?.git_provider ?? null,
selected_workspace: prevMetadata?.selected_workspace ?? null,
active_profile: switchLLMObservation.observation.profile_name,
+ // Full-object replace: carry the plugins snapshot forward so the
+ // in-conversation plugins view survives a profile switch.
+ plugins: prevMetadata?.plugins ?? null,
});
if (switchLLMObservation.observation.active_model) {
diff --git a/src/hooks/mutation/use-create-conversation.ts b/src/hooks/mutation/use-create-conversation.ts
index 166cc26e82..fa4d260fe5 100644
--- a/src/hooks/mutation/use-create-conversation.ts
+++ b/src/hooks/mutation/use-create-conversation.ts
@@ -5,6 +5,11 @@ import { SuggestedTask } from "#/utils/types";
import { Provider } from "#/types/settings";
import { useTracking } from "#/hooks/use-tracking";
import { useLlmProfiles } from "#/hooks/query/use-llm-profiles";
+import PluginsManagementService, {
+ type InstalledPluginInfo,
+} from "#/api/plugins-management-service";
+import { PLUGINS_QUERY_KEYS } from "#/hooks/query/query-keys";
+import { pluginReferenceKey } from "#/utils/plugin-display";
import {
getStoredConversationMetadata,
setStoredConversationMetadata,
@@ -82,7 +87,47 @@ export const useCreateConversation = () => {
// (app_conversation_id stays null until the sandbox is READY). Merge so
// the repo/workspace metadata the service just persisted is preserved.
const localConversationId = conversation.app_conversation_id;
- if (localConversationId && llmProfiles?.active_profile) {
+ // Snapshot the conversation's plugins into client-side metadata so the
+ // in-conversation plugins view can show what's loaded (coordinates only
+ // — strip parameters, which may carry secrets). The agent-server doesn't
+ // return a live conversation's loaded plugins, so this snapshot is the
+ // source for that view. Two sources, deduped by coordinates:
+ // 1. plugins explicitly attached at creation (e.g. the /launch flow);
+ // 2. enabled installed plugins, which the SDK auto-loads into every new
+ // local conversation (see use-set-plugin-enabled).
+ const explicitPlugins =
+ plugins?.map((plugin) => ({
+ source: plugin.source,
+ ref: plugin.ref ?? null,
+ repo_path: plugin.repo_path ?? null,
+ })) ?? [];
+ let attachedPlugins: PluginSpec[] = explicitPlugins;
+ if (localConversationId) {
+ let installed: InstalledPluginInfo[] = [];
+ try {
+ installed = await queryClient.ensureQueryData({
+ queryKey: PLUGINS_QUERY_KEYS.installed,
+ queryFn: () => PluginsManagementService.listInstalledPlugins(),
+ });
+ } catch {
+ // Best-effort: never let plugin lookup block conversation creation.
+ }
+ const seen = new Set(explicitPlugins.map(pluginReferenceKey));
+ const enabledInstalled = installed
+ .filter((plugin) => plugin.enabled)
+ .map((plugin) => ({
+ source: plugin.source,
+ ref: plugin.resolved_ref ?? null,
+ repo_path: plugin.repo_path ?? null,
+ // Keep the human-friendly name so the plugins view shows e.g.
+ // "city-weather" rather than deriving "local" from the source.
+ name: plugin.name,
+ }))
+ .filter((plugin) => !seen.has(pluginReferenceKey(plugin)));
+ attachedPlugins = [...explicitPlugins, ...enabledInstalled];
+ }
+ const activeProfile = llmProfiles?.active_profile ?? null;
+ if (localConversationId && (activeProfile || attachedPlugins.length)) {
const prev = getStoredConversationMetadata(localConversationId);
setStoredConversationMetadata(localConversationId, {
selected_repository: prev?.selected_repository ?? null,
@@ -90,7 +135,10 @@ export const useCreateConversation = () => {
git_provider: prev?.git_provider ?? null,
selected_workspace: prev?.selected_workspace ?? null,
workspace_mode: prev?.workspace_mode ?? null,
- active_profile: llmProfiles.active_profile,
+ active_profile: activeProfile ?? prev?.active_profile ?? null,
+ plugins: attachedPlugins.length
+ ? attachedPlugins
+ : (prev?.plugins ?? null),
});
}
diff --git a/src/hooks/mutation/use-switch-llm-profile-and-log.ts b/src/hooks/mutation/use-switch-llm-profile-and-log.ts
index 752594f261..c3e44b98b1 100644
--- a/src/hooks/mutation/use-switch-llm-profile-and-log.ts
+++ b/src/hooks/mutation/use-switch-llm-profile-and-log.ts
@@ -46,6 +46,9 @@ export function useSwitchLlmProfileAndLog() {
git_provider: prev?.git_provider ?? null,
selected_workspace: prev?.selected_workspace ?? null,
active_profile: profileName,
+ // Full-object replace: carry the plugins snapshot forward so
+ // the in-conversation plugins view survives a profile switch.
+ plugins: prev?.plugins ?? null,
});
}
},
diff --git a/src/hooks/use-conversation-name-context-menu.ts b/src/hooks/use-conversation-name-context-menu.ts
index 49be384f10..cf44f29f72 100644
--- a/src/hooks/use-conversation-name-context-menu.ts
+++ b/src/hooks/use-conversation-name-context-menu.ts
@@ -10,6 +10,7 @@ import { useActiveConversation } from "./query/use-active-conversation";
import { useEventStore } from "#/stores/use-event-store";
import { displaySuccessToast } from "#/utils/custom-toast-handlers";
import { I18nKey } from "#/i18n/declaration";
+import { getStoredConversationMetadata } from "#/api/conversation-metadata-store";
import { useDownloadConversation } from "./use-download-conversation";
import {
@@ -45,6 +46,7 @@ export function useConversationNameContextMenu({
const [metricsModalVisible, setMetricsModalVisible] = React.useState(false);
const [systemModalVisible, setSystemModalVisible] = React.useState(false);
const [skillsModalVisible, setSkillsModalVisible] = React.useState(false);
+ const [pluginsModalVisible, setPluginsModalVisible] = React.useState(false);
const [hooksModalVisible, setHooksModalVisible] = React.useState(false);
const [confirmDeleteModalVisible, setConfirmDeleteModalVisible] =
React.useState(false);
@@ -128,6 +130,12 @@ export function useConversationNameContextMenu({
onContextMenuToggle?.(false);
};
+ const handleShowPlugins = (event: React.MouseEvent<HTMLButtonElement>) => {
+ event.stopPropagation();
+ setPluginsModalVisible(true);
+ onContextMenuToggle?.(false);
+ };
+
const handleShowHooks = (event: React.MouseEvent<HTMLButtonElement>) => {
event.stopPropagation();
setHooksModalVisible(true);
@@ -178,6 +186,7 @@ export function useConversationNameContextMenu({
handleDisplayCost,
handleShowAgentTools,
handleShowSkills,
+ handleShowPlugins,
handleShowHooks,
handleTogglePublic,
handleCopyShareLink,
@@ -192,6 +201,8 @@ export function useConversationNameContextMenu({
setSystemModalVisible,
skillsModalVisible,
setSkillsModalVisible,
+ pluginsModalVisible,
+ setPluginsModalVisible,
hooksModalVisible,
setHooksModalVisible,
confirmDeleteModalVisible,
@@ -208,6 +219,11 @@ export function useConversationNameContextMenu({
shouldShowDisplayCost: showOptions,
shouldShowAgentTools: Boolean(showOptions && systemMessage),
shouldShowSkills: Boolean(showOptions && conversationId),
+ shouldShowPlugins: Boolean(
+ showOptions &&
+ conversationId &&
+ (getStoredConversationMetadata(conversationId)?.plugins?.length ?? 0) > 0,
+ ),
shouldShowHooks: Boolean(
showOptions && conversationId && isExecutionActive(executionStatus),
),
diff --git a/src/hooks/use-conversation-plugins.ts b/src/hooks/use-conversation-plugins.ts
new file mode 100644
index 0000000000..82dfae0522
--- /dev/null
+++ b/src/hooks/use-conversation-plugins.ts
@@ -0,0 +1,19 @@
+import { useMemo } from "react";
+import { getStoredConversationMetadata } from "#/api/conversation-metadata-store";
+import type { PluginSpec } from "#/api/conversation-service/agent-server-conversation-service.types";
+import { useOptionalConversationId } from "#/hooks/use-conversation-id";
+
+/**
+ * Plugins loaded into the active conversation, read from the client-side
+ * metadata snapshot taken at creation (explicitly attached plugins plus the
+ * enabled installed plugins the SDK auto-loads). Empty when none are loaded or
+ * when used outside a conversation route. The agent-server doesn't return a
+ * live conversation's loaded plugins, so this is the available source today.
+ */
+export function useConversationPlugins(): PluginSpec[] {
+ const { conversationId } = useOptionalConversationId();
+ return useMemo(() => {
+ if (!conversationId) return [];
+ return getStoredConversationMetadata(conversationId)?.plugins ?? [];
+ }, [conversationId]);
+}
diff --git a/src/i18n/translation.json b/src/i18n/translation.json
index f2d97ab069..49d8a93b84 100644
--- a/src/i18n/translation.json
+++ b/src/i18n/translation.json
@@ -32944,5 +32944,90 @@
"ja": "先頭は英字で、英数字とアンダースコアのみを使用し、1〜64文字にしてください",
"uk": "Має починатися з літери, містити лише літери/цифри/підкреслення та мати від 1 до 64 символів",
"ca": "Ha de començar amb una lletra, contenir només lletres/números/guions baixos i tenir entre 1 i 64 caràcters"
+ },
+ "CONVERSATION$SHOW_PLUGINS": {
+ "en": "Show Plugins",
+ "ja": "プラグインを表示",
+ "zh-CN": "显示插件",
+ "zh-TW": "顯示外掛",
+ "ko-KR": "플러그인 표시",
+ "no": "Vis plugins",
+ "it": "Mostra plugin",
+ "pt": "Mostrar plugins",
+ "es": "Mostrar plugins",
+ "ar": "عرض المكونات الإضافية",
+ "fr": "Afficher les plugins",
+ "tr": "Eklentileri göster",
+ "de": "Plugins anzeigen",
+ "uk": "Показати плагіни",
+ "ca": "Mostra els connectors"
+ },
+ "PLUGINS_MODAL$TITLE": {
+ "en": "Plugins",
+ "ja": "プラグイン",
+ "zh-CN": "插件",
+ "zh-TW": "外掛",
+ "ko-KR": "플러그인",
+ "no": "Plugins",
+ "it": "Plugin",
+ "pt": "Plugins",
+ "es": "Plugins",
+ "ar": "المكونات الإضافية",
+ "fr": "Plugins",
+ "tr": "Eklentiler",
+ "de": "Plugins",
+ "uk": "Плагіни",
+ "ca": "Connectors"
+ },
+ "PLUGINS_MODAL$DESCRIPTION": {
+ "en": "Plugins explicitly attached when this conversation started.",
+ "ja": "この会話の開始時に明示的に添付されたプラグインです。",
+ "zh-CN": "此对话启动时明确附加的插件。",
+ "zh-TW": "此對話啟動時明確附加的外掛。",
+ "ko-KR": "이 대화를 시작할 때 명시적으로 첨부된 플러그인입니다.",
+ "no": "Plugins som ble eksplisitt lagt til da denne samtalen startet.",
+ "it": "Plugin esplicitamente allegati all'avvio di questa conversazione.",
+ "pt": "Plugins anexados explicitamente quando esta conversa começou.",
+ "es": "Complementos adjuntados explícitamente cuando comenzó esta conversación.",
+ "ar": "الإضافات التي تم إرفاقها صراحةً عند بدء هذه المحادثة.",
+ "fr": "Plugins explicitement joints au démarrage de cette conversation.",
+ "tr": "Bu konuşma başladığında açıkça eklenen eklentiler.",
+ "de": "Plugins, die beim Start dieser Unterhaltung explizit angehängt wurden.",
+ "uk": "Плагіни, явно додані на початку цієї розмови.",
+ "ca": "Connectors adjuntats explícitament quan ha començat aquesta conversa."
+ },
+ "PLUGINS_MODAL$SOURCE_LOCAL": {
+ "en": "Local",
+ "ja": "ローカル",
+ "zh-CN": "本地",
+ "zh-TW": "本機",
+ "ko-KR": "로컬",
+ "no": "Lokal",
+ "it": "Locale",
+ "pt": "Local",
+ "es": "Local",
+ "ar": "محلي",
+ "fr": "Local",
+ "tr": "Yerel",
+ "de": "Lokal",
+ "uk": "Локальний",
+ "ca": "Local"
+ },
+ "PLUGINS_MODAL$EMPTY": {
+ "en": "No plugins attached to this conversation.",
+ "ja": "この会話に添付されたプラグインはありません。",
+ "zh-CN": "此对话未附加任何插件。",
+ "zh-TW": "此對話未附加任何外掛。",
+ "ko-KR": "이 대화에 첨부된 플러그인이 없습니다.",
+ "no": "Ingen plugins er lagt til i denne samtalen.",
+ "it": "Nessun plugin allegato a questa conversazione.",
+ "pt": "Nenhum plugin anexado a esta conversa.",
+ "es": "No hay complementos adjuntados a esta conversación.",
+ "ar": "لا توجد إضافات مرفقة بهذه المحادثة.",
+ "fr": "Aucun plugin joint à cette conversation.",
+ "tr": "Bu konuşmaya ekli eklenti yok.",
+ "de": "An diese Unterhaltung sind keine Plugins angehängt.",
+ "uk": "До цієї розмови не додано жодного плагіна.",
+ "ca": "No hi ha cap connector adjuntat a aquesta conversa."
}
}
diff --git a/src/utils/plugin-display.ts b/src/utils/plugin-display.ts
new file mode 100644
index 0000000000..70849c1694
--- /dev/null
+++ b/src/utils/plugin-display.ts
@@ -0,0 +1,53 @@
+import type { PluginSpec } from "#/api/conversation-service/agent-server-conversation-service.types";
+
+/**
+ * Friendly display name for a plugin reference: the explicit `name` when set
+ * (e.g. an installed plugin's name), otherwise the last segment of `repo_path`,
+ * otherwise the repo from the `source` coordinate. Mirrors the `/launch` modal's
+ * naming so the same plugin reads consistently across surfaces.
+ */
+export function getPluginDisplayName(plugin: PluginSpec): string {
+ if (plugin.name) return plugin.name;
+ if (plugin.repo_path) {
+ const parts = plugin.repo_path.split("/").filter(Boolean);
+ if (parts.length > 0) return parts[parts.length - 1];
+ }
+ const { source } = plugin;
+ if (source.startsWith("github:")) return source.replace("github:", "");
+ if (source.includes("/")) {
+ return (
+ source
+ .split("/")
+ .pop()
+ ?.replace(/\.git$/, "") || source
+ );
+ }
+ return source;
+}
+
+/**
+ * True when the plugin was installed from the local machine — the `"local"`
+ * sentinel or a filesystem path — rather than a remote git source (`github:…`
+ * or a URL). These read inconsistently (a bare `"local"` vs a long absolute
+ * path that also leaks the home dir), so callers render one normalized label
+ * for them instead of {@link getPluginSourceLabel}.
+ */
+export function isLocalPluginSource(plugin: PluginSpec): boolean {
+ const { source } = plugin;
+ if (source.startsWith("github:")) return false;
+ if (/^[a-z][a-z0-9+.-]*:\/\//i.test(source)) return false; // git URL
+ return true;
+}
+
+/** Source coordinate with an optional `@ref`, e.g. "OpenHands/extensions @ main". */
+export function getPluginSourceLabel(plugin: PluginSpec): string {
+ const base = plugin.source.startsWith("github:")
+ ? plugin.source.replace("github:", "")
+ : plugin.source;
+ return plugin.ref ? `${base} @ ${plugin.ref}` : base;
+}
+
+/** Stable key for a plugin reference (coordinates only). */
+export function pluginReferenceKey(plugin: PluginSpec): string {
+ return [plugin.source, plugin.ref ?? "", plugin.repo_path ?? ""].join(" ");
+}