-
Notifications
You must be signed in to change notification settings - Fork 25
✨ pluggable agent backend — Goose, OpenCode, MCP server, orchestrator + chat panel UI #1389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ibolton336
wants to merge
17
commits into
konveyor:main
Choose a base branch
from
ibolton336:feature/pluggable-agent-backend
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
a4d248a
✨ agentic refactoring & LLM improvements [1/3]
ibolton336 b8dd4be
fix: address CodeRabbit review comments
ibolton336 60fe95f
✨ pluggable agent backend — Goose, OpenCode, MCP server, orchestrator
ibolton336 6978874
feat: add chat panel UI components and webview-ui updates
ibolton336 9050f63
fix: remove eslint-disable for missing react-hooks plugin
ibolton336 7d217a7
revert: restore original pre-commit hook
ibolton336 1167724
revert: restore original cache.ts formatting
ibolton336 cae0e59
cleanup: restore original type formatting, keep new fields
ibolton336 68cd517
cleanup: remove unrelated changelog entry
ibolton336 50361a9
cleanup: revert logging changes (extracted to PR #1391)
ibolton336 46ff491
cleanup: remove docs and extract LLM timeout to own PR
ibolton336 a5278ea
cleanup: revert sample-provider-settings (extracted to PR #1395)
ibolton336 50a1583
cleanup: revert scroll management and ToolMessage (extracted to #1393…
ibolton336 72daa3b
cleanup: extract MCP server to PR #1396
ibolton336 3afd8c4
fix: address CodeRabbit review feedback
ibolton336 ffd34be
fix: address CodeRabbit review feedback
b483c81
fix: resolve build errors after rebase
ibolton336 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| kind: feature | ||
|
|
||
| description: > | ||
| Add pluggable agent backend infrastructure supporting Goose, OpenCode, Claude, | ||
| and Codex as interchangeable AI backends. Includes MCP server with analysis | ||
| tools, structured chat panel with streaming and permission review UI, and | ||
| granular tool permission policy. | ||
|
|
||
| extensions: | ||
| - core |
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| // ─── Agent backend types ──────────────────────────────────────────── | ||
|
|
||
| /** Supported agent backends */ | ||
| export type AgentBackend = "goose" | "opencode" | "claude" | "codex"; | ||
|
|
||
| /** Agent lifecycle state */ | ||
| export type AgentState = "stopped" | "starting" | "running" | "error"; | ||
|
|
||
| // ─── Agent capabilities ───────────────────────────────────────────── | ||
|
|
||
| /** Backend-agnostic capability (Goose extension, OpenCode plugin, etc.) */ | ||
| export interface AgentCapability { | ||
| id: string; | ||
| name: string; | ||
| description: string; | ||
| enabled: boolean; | ||
| /** Backend-specific type hint — the UI doesn't interpret this */ | ||
| kind?: string; | ||
| } | ||
|
|
||
| // ─── Agent configuration ───────────────────────────────────────────── | ||
|
|
||
| /** | ||
| * Backend-agnostic configuration for the Configuration panel. | ||
| * | ||
| * The UI renders provider/model/credentials, tool permissions, and | ||
| * backend-specific capabilities regardless of which agent backend is active. | ||
| */ | ||
| export interface AgentConfig { | ||
| /** Which backend is active */ | ||
| backend: AgentBackend; | ||
| /** | ||
| * When true, the agent has full autonomy to explore, iterate, and fix broadly. | ||
| * When false, the agent does a focused fix on specific incidents only. | ||
| */ | ||
| agentMode: boolean; | ||
| provider: string; | ||
| model: string; | ||
| hasStoredCredentials: boolean; | ||
| /** Backend-specific capabilities (Goose extensions, OpenCode plugins, etc.) */ | ||
| capabilities: AgentCapability[]; | ||
| /** Path to the backend's native config file (for "Advanced" link) */ | ||
| nativeConfigPath?: string; | ||
| } | ||
|
|
||
| // ─── Agent chat types ──────────────────────────────────────────────── | ||
|
|
||
| export type AgentContentBlockType = "text" | "resource_link" | "resource" | "thinking"; | ||
|
|
||
| export type AgentContentBlock = | ||
| | { type: "text"; text: string } | ||
| | { type: "resource_link"; uri: string; name?: string; mimeType?: string } | ||
| | { | ||
| type: "resource"; | ||
| uri: string; | ||
| name?: string; | ||
| mimeType?: string; | ||
| text?: string; | ||
| blob?: string; | ||
| } | ||
| | { type: "thinking"; text: string }; | ||
|
|
||
| export interface AgentChatMessage { | ||
| id: string; | ||
| role: "user" | "assistant" | "system" | "tool"; | ||
| content: string; | ||
| timestamp: string; | ||
| toolCall?: { | ||
| name: string; | ||
| arguments?: Record<string, unknown>; | ||
| status: "pending" | "running" | "succeeded" | "failed"; | ||
| result?: string; | ||
| }; | ||
| isStreaming?: boolean; | ||
| contentBlocks?: AgentContentBlock[]; | ||
| isThinking?: boolean; | ||
| isCancelled?: boolean; | ||
| stopReason?: string; | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| // Agent chat actions | ||
| export const AGENT_SEND_MESSAGE = "AGENT_SEND_MESSAGE"; | ||
| export const AGENT_START = "AGENT_START"; | ||
| export const AGENT_STOP = "AGENT_STOP"; | ||
| export const AGENT_UPDATE_CONFIG = "AGENT_UPDATE_CONFIG"; | ||
| export const AGENT_TOGGLE_VIEW = "AGENT_TOGGLE_VIEW"; | ||
| export const AGENT_INSTALL_CLI = "AGENT_INSTALL_CLI"; | ||
| export const AGENT_OPEN_SETTINGS = "AGENT_OPEN_SETTINGS"; | ||
| export const AGENT_PERMISSION_RESPONSE = "AGENT_PERMISSION_RESPONSE"; | ||
| export const AGENT_CANCEL_GENERATION = "AGENT_CANCEL_GENERATION"; | ||
| export const SET_EXPERIMENTAL_CHAT = "SET_EXPERIMENTAL_CHAT"; | ||
|
|
||
| export type AgentActionType = | ||
| | typeof AGENT_SEND_MESSAGE | ||
| | typeof AGENT_START | ||
| | typeof AGENT_STOP | ||
| | typeof AGENT_UPDATE_CONFIG | ||
| | typeof AGENT_TOGGLE_VIEW | ||
| | typeof AGENT_INSTALL_CLI | ||
| | typeof AGENT_OPEN_SETTINGS | ||
| | typeof AGENT_PERMISSION_RESPONSE | ||
| | typeof AGENT_CANCEL_GENERATION | ||
| | typeof SET_EXPERIMENTAL_CHAT; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| import type { AgentState, AgentChatMessage, AgentContentBlockType, AgentConfig } from "./agent"; | ||
|
|
||
| export const AgentMessageTypes = { | ||
| AGENT_STATE_CHANGE: "AGENT_STATE_CHANGE", | ||
| AGENT_CHAT_STATE_CHANGE: "AGENT_CHAT_STATE_CHANGE", | ||
| AGENT_CHAT_STREAMING_UPDATE: "AGENT_CHAT_STREAMING_UPDATE", | ||
| AGENT_TOOL_CALL: "AGENT_TOOL_CALL", | ||
| AGENT_CONFIG_UPDATE: "AGENT_CONFIG_UPDATE", | ||
| } as const; | ||
|
|
||
| export type AgentMessageType = (typeof AgentMessageTypes)[keyof typeof AgentMessageTypes]; | ||
|
|
||
| export interface AgentStateChangeMessage { | ||
| type: "AGENT_STATE_CHANGE"; | ||
| agentState: AgentState; | ||
| agentError?: string; | ||
| timestamp: string; | ||
| } | ||
|
|
||
| export interface AgentChatStateChangeMessage { | ||
| type: "AGENT_CHAT_STATE_CHANGE"; | ||
| messages: AgentChatMessage[]; | ||
| timestamp: string; | ||
| } | ||
|
|
||
| export interface AgentChatStreamingUpdateMessage { | ||
| type: "AGENT_CHAT_STREAMING_UPDATE"; | ||
| messageId: string; | ||
| content: string; | ||
| done: boolean; | ||
| timestamp: string; | ||
| contentType?: AgentContentBlockType; | ||
| stopReason?: string; | ||
| resourceUri?: string; | ||
| resourceName?: string; | ||
| resourceMimeType?: string; | ||
| resourceContent?: string; | ||
| } | ||
|
|
||
| export interface AgentToolCallMessage { | ||
| type: "AGENT_TOOL_CALL"; | ||
| messageId: string; | ||
| toolName: string; | ||
| callId?: string; | ||
| status: "running" | "succeeded" | "failed"; | ||
| result?: string; | ||
| arguments?: Record<string, unknown>; | ||
| timestamp: string; | ||
| } | ||
|
|
||
| export interface AgentConfigUpdateMessage { | ||
| type: "AGENT_CONFIG_UPDATE"; | ||
| config: AgentConfig; | ||
| timestamp: string; | ||
| } | ||
|
|
||
| export type AgentWebviewMessage = | ||
| | AgentStateChangeMessage | ||
| | AgentChatStateChangeMessage | ||
| | AgentChatStreamingUpdateMessage | ||
| | AgentToolCallMessage | ||
| | AgentConfigUpdateMessage; | ||
|
|
||
| export function isAgentStateChange(msg: any): msg is AgentStateChangeMessage { | ||
| return msg?.type === AgentMessageTypes.AGENT_STATE_CHANGE; | ||
| } | ||
|
|
||
| export function isAgentChatStateChange(msg: any): msg is AgentChatStateChangeMessage { | ||
| return msg?.type === AgentMessageTypes.AGENT_CHAT_STATE_CHANGE; | ||
| } | ||
|
|
||
| export function isAgentChatStreamingUpdate(msg: any): msg is AgentChatStreamingUpdateMessage { | ||
| return msg?.type === AgentMessageTypes.AGENT_CHAT_STREAMING_UPDATE; | ||
| } | ||
|
|
||
| export function isAgentToolCall(msg: any): msg is AgentToolCallMessage { | ||
| return msg?.type === AgentMessageTypes.AGENT_TOOL_CALL; | ||
| } | ||
|
|
||
| export function isAgentConfigUpdate(msg: any): msg is AgentConfigUpdateMessage { | ||
| return msg?.type === AgentMessageTypes.AGENT_CONFIG_UPDATE; | ||
| } |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.