🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
✨ feat(hetero-agent): add Qoder CLI support (#17965)
AmAzing-5f6b11a990cc
diff --git a/apps/cli/src/commands/hetero.test.ts b/apps/cli/src/commands/hetero.test.tsindex 61301116c2f..0f1d86fdb14 100644--- a/apps/cli/src/commands/hetero.test.ts+++ b/apps/cli/src/commands/hetero.test.ts@@ -102,7 +102,10 @@ describe('hetero exec command', () => {stdoutSpy = vi.spyOn(process.stdout, 'write').mockImplementation(() => true);mockResolveHeteroSpawnCommand.mockReset();mockResolveHeteroSpawnCommand.mockImplementation(- async (agentType: 'amp' | 'claude-code' | 'codex' | 'opencode' | 'pi', command?: string) => ({+ async (+ agentType: 'amp' | 'claude-code' | 'codex' | 'opencode' | 'pi' | 'qoder',+ command?: string,+ ) => ({command:command ??(agentType === 'amp'@@ -113,7 +116,9 @@ describe('hetero exec command', () => {? 'opencode': agentType === 'pi'? 'pi'- : 'claude'),+ : agentType === 'qoder'+ ? 'qodercli'+ : 'claude'),}),);mockSpawnAgent.mockReset();@@ -202,6 +207,33 @@ describe('hetero exec command', () => {expect(call.operationId).toMatch(/^[0-9a-f-]{36}$/i);});+ it('runs Qoder with its default command and forwards model but not effort', async () => {+ mockSpawnAgent.mockReturnValue(createFakeHandle());++ await runCmd([+ 'hetero',+ 'exec',+ '--type',+ 'qoder',+ '--prompt',+ 'do thing',+ '--model',+ 'Claude Sonnet 4.5',+ '--effort',+ 'high',+ ]);++ expect(mockResolveHeteroSpawnCommand).toHaveBeenCalledWith('qoder', undefined);+ expect(mockSpawnAgent).toHaveBeenCalledWith(+ expect.objectContaining({+ agentType: 'qoder',+ command: 'qodercli',+ extraArgs: ['--model', 'Claude Sonnet 4.5'],+ prompt: 'do thing',+ }),+ );+ });+it('uses the provided --operation-id verbatim', async () => {mockSpawnAgent.mockReturnValue(createFakeHandle());diff --git a/apps/cli/src/commands/hetero.ts b/apps/cli/src/commands/hetero.tsindex 653949b16ca..9cb203eb377 100644--- a/apps/cli/src/commands/hetero.ts+++ b/apps/cli/src/commands/hetero.ts@@ -28,7 +28,7 @@ import { CoalescingBatchIngester } from '../utils/CoalescingBatchIngester';import { log } from '../utils/logger';import { TrpcIngestSink } from '../utils/TrpcIngestSink';-const SUPPORTED_AGENT_TYPES = new Set(['amp', 'claude-code', 'codex', 'opencode', 'pi']);+const SUPPORTED_AGENT_TYPES = new Set(['amp', 'claude-code', 'codex', 'opencode', 'pi', 'qoder']);const CODEX_REASONING_EFFORT_CONFIG_KEY = 'model_reasoning_effort';const CODEX_SERVICE_TIER_CONFIG_KEY = 'service_tier';@@ -132,7 +132,9 @@ const buildExtraArgs = (? [...(options.model ? ['--model', options.model] : [])]: options.type === 'pi'? [...(options.model ? ['--model', options.model] : [])]- : [];+ : options.type === 'qoder'+ ? [...(options.model ? ['--model', options.model] : [])]+ : [];const extraArgs = [...(options.agentArg ?? []), ...selectorArgs];return extraArgs.length > 0 ? extraArgs : undefined;@@ -383,7 +385,7 @@ const exec = async (options: ExecOptions): Promise<void> => {// Build the ingest sink — no-op for standalone mode, real tRPC sink for// server-ingest mode. The tRPC client reads LOBEHUB_JWT (operation-scoped// JWT injected by the server) for authentication.- const agentType = options.type as 'amp' | 'claude-code' | 'codex' | 'opencode' | 'pi';+ const agentType = options.type as 'amp' | 'claude-code' | 'codex' | 'opencode' | 'pi' | 'qoder';let sink: TrpcIngestSink | undefined;let serverIngester: CoalescingBatchIngester | undefined;// Uploader for tool_result images (CC `Read` on an image file). Reuses the@@ -414,7 +416,7 @@ const exec = async (options: ExecOptions): Promise<void> => {});}- // ─── AskUserQuestion MCP — remote Human-in-the-loop (claude-code only) ──────+ // ─── AskUserQuestion MCP — remote Human-in-the-loop ────────────────────────//// Mount the same `lobe_cc` MCP server the desktop app uses, but resolve the// bridge over the server's Redis stream instead of Electron IPC:@@ -430,7 +432,7 @@ const exec = async (options: ExecOptions): Promise<void> => {let askBridge: AskUserBridge | undefined;let askMcpConfigPath: string | undefined;const askPollAbort = new AbortController();- if (serverIngest && agentType === 'claude-code' && serverIngester) {+ if (serverIngest && (agentType === 'claude-code' || agentType === 'qoder') && serverIngester) {askServer = new LobeBuiltinMcpServer();await askServer.start();askBridge = askServer.registerOperation(operationId);@@ -745,11 +747,11 @@ const exec = async (options: ExecOptions): Promise<void> => {const interceptResume = !!options.resume;const extraArgs = [...(buildExtraArgs(options) ?? []),- // Point CC at the lobe_cc AskUserQuestion MCP server we just mounted.+ // Point the supported CLI at the lobe_cc AskUserQuestion MCP server we just mounted....(askMcpConfigPath ? ['--mcp-config', askMcpConfigPath] : []),];// Resolve the CLI binary once, up front, and reuse it for both the initial- // run and the resume-retry. For the default bare command (`amp`/`codex`/`claude`)+ // run and the resume-retry. For each provider's default bare command// this finds the validated binary — including an app-bundled Codex CLI when// a broken `codex` shim shadows PATH — so sandbox/terminal runs no longer// ENOENT on a stale global install. Custom commands are used verbatim.@@ -887,7 +889,7 @@ export function registerHeteroCommand(program: Command) {const hetero = program.command('hetero').description(- 'Run heterogeneous agent CLIs (Amp / Claude Code / Codex / OpenCode / Pi) and stream their output',+ 'Run heterogeneous agent CLIs (Amp / Claude Code / Codex / OpenCode / Pi / Qoder) and stream their output',);hetero@@ -921,7 +923,7 @@ export function registerHeteroCommand(program: Command) {).option('-c, --command <bin>',- 'Override the agent CLI binary name (default: `amp`, `claude`, `codex`, `opencode`, or `pi`)',+ 'Override the agent CLI binary name (default: `amp`, `claude`, `codex`, `opencode`, `pi`, or `qodercli`)',).option('--operation-id <id>',diff --git a/apps/cli/src/utils/TrpcIngestSink.ts b/apps/cli/src/utils/TrpcIngestSink.tsindex 8f769976a67..b75e89712ab 100644--- a/apps/cli/src/utils/TrpcIngestSink.ts+++ b/apps/cli/src/utils/TrpcIngestSink.ts@@ -13,7 +13,7 @@ import type { IngestSink } from './BatchIngester';export class TrpcIngestSink implements IngestSink {constructor(private readonly client: TrpcClient,- private readonly agentType: 'amp' | 'claude-code' | 'codex' | 'opencode' | 'pi',+ private readonly agentType: 'amp' | 'claude-code' | 'codex' | 'opencode' | 'pi' | 'qoder',private readonly operationId: string,private readonly topicId: string,private readonly assistantMessageId?: string,diff --git a/apps/desktop/src/main/controllers/HeterogeneousAgentImpl.ts b/apps/desktop/src/main/controllers/HeterogeneousAgentImpl.tsindex 63da6e71bf7..7a0340920c0 100644--- a/apps/desktop/src/main/controllers/HeterogeneousAgentImpl.ts+++ b/apps/desktop/src/main/controllers/HeterogeneousAgentImpl.ts@@ -27,6 +27,9 @@ import {OPENCODE_CLI_INSTALL_DOCS_URL,PI_CLI_INSTALL_COMMANDS,PI_CLI_INSTALL_DOCS_URL,+ QODER_CLI_AUTH_DOCS_URL,+ QODER_CLI_INSTALL_COMMANDS,+ QODER_CLI_INSTALL_DOCS_URL,} from '@lobechat/electron-client-ipc/types/heterogeneous-agent';import type { AskUserBridge } from '@lobechat/heterogeneous-agents/askUser';import type {@@ -136,6 +139,7 @@ const CLI_AUTH_REQUIRED_PATTERNS = [/no models available/i,] as const;const AMP_AUTH_REQUIRED_PATTERNS = [/please (?:log|sign) in/i, /amp_api_key/i] as const;+const QODER_AUTH_REQUIRED_PATTERNS = [/not logged in/i, /please run \/login/i] as const;const CODEX_RESUME_CWD_MISMATCH_PATTERNS = [/working directory/i,/\bcwd\b/i,@@ -426,6 +430,9 @@ export default class HeterogeneousAgentCtr {case 'pi': {return 'pi';}+ case 'qoder': {+ return 'qodercli';+ }default: {return 'claude';}@@ -497,6 +504,19 @@ export default class HeterogeneousAgentCtr {};}+ private buildQoderCliMissingError(session: AgentSession): HeterogeneousAgentSessionError {+ const command = this.resolveSessionCommand(session);++ return {+ agentType: 'qoder',+ code: HeterogeneousAgentSessionErrorCode.CliNotFound,+ command,+ docsUrl: QODER_CLI_INSTALL_DOCS_URL,+ installCommands: QODER_CLI_INSTALL_COMMANDS,+ message: `Qoder CLI was not found. Install it and make sure \`${command}\` can be executed.`,+ };+ }+private buildCliMissingError(session: AgentSession): HeterogeneousAgentSessionError | undefined {switch (session.agentType) {case 'amp': {@@ -514,6 +534,9 @@ export default class HeterogeneousAgentCtr {case 'pi': {return this.buildPiCliMissingError(session);}+ case 'qoder': {+ return this.buildQoderCliMissingError(session);+ }default: {return;}@@ -581,6 +604,16 @@ export default class HeterogeneousAgentCtr {stderr,};}+ case 'qoder': {+ return {+ agentType: 'qoder',+ code: HeterogeneousAgentSessionErrorCode.AuthRequired,+ command,+ docsUrl: QODER_CLI_AUTH_DOCS_URL,+ message: 'Qoder could not authenticate. Run `qodercli login`, then retry.',+ stderr,+ };+ }default: {return;}@@ -660,7 +693,9 @@ export default class HeterogeneousAgentCtr {const patterns =session.agentType === 'amp'? [...CLI_AUTH_REQUIRED_PATTERNS, ...AMP_AUTH_REQUIRED_PATTERNS]- : CLI_AUTH_REQUIRED_PATTERNS;+ : session.agentType === 'qoder'+ ? [...CLI_AUTH_REQUIRED_PATTERNS, ...QODER_AUTH_REQUIRED_PATTERNS]+ : CLI_AUTH_REQUIRED_PATTERNS;if (!patterns.some((pattern) => pattern.test(message))) return;return this.buildCliAuthRequiredError(session, message);@@ -738,7 +773,9 @@ export default class HeterogeneousAgentCtr {? 'opencode': session.agentType === 'pi'? 'pi'- : undefined;+ : session.agentType === 'qoder'+ ? 'qodercli'+ : undefined;if (!defaultCommand) return;const command = this.resolveSessionCommand(session);@@ -1254,11 +1291,11 @@ export default class HeterogeneousAgentCtr {});}- // Stand up the AskUserQuestion MCP bridge for claude-code prompts BEFORE+ // Stand up the AskUserQuestion MCP bridge for supported prompts BEFORE// building the spawn plan so the driver can wire the temp config path- // into `--mcp-config`. Codex / future agents skip this entirely.+ // into `--mcp-config`. Other agents skip this entirely.const intervention =- session.agentType === 'claude-code'+ session.agentType === 'claude-code' || session.agentType === 'qoder'? await this.setupInterventionForOp(params.operationId, {agentId: params.agentId,topicId: params.topicId,diff --git a/apps/desktop/src/main/modules/binaries/__tests__/cliAgentBinaries.test.ts b/apps/desktop/src/main/modules/binaries/__tests__/cliAgentBinaries.test.tsindex 727f5f743c2..86bf6d09c5a 100644--- a/apps/desktop/src/main/modules/binaries/__tests__/cliAgentBinaries.test.ts+++ b/apps/desktop/src/main/modules/binaries/__tests__/cliAgentBinaries.test.ts@@ -218,6 +218,20 @@ describe('cliAgentBinaries', () => {});});+ it('detects Qoder through the shared bare-version probe', async () => {+ callExecFile('/Users/test/.local/bin/qodercli\n');+ callExecFile('1.1.15');++ const { qoderBinary } = await import('../cliAgentBinaries');+ const status = await qoderBinary.detect();++ expect(status).toMatchObject({+ available: true,+ path: '/Users/test/.local/bin/qodercli',+ version: '1.1.15',+ });+ });+it('runs the binary directly via execFile (no shell)', async () => {callExecFile('/usr/local/bin/claude\n');callExecFile('1.2.3 (Claude Code)');diff --git a/apps/desktop/src/main/modules/binaries/cliAgentBinaries.ts b/apps/desktop/src/main/modules/binaries/cliAgentBinaries.tsindex 234f2b53c21..fbbb833773c 100644--- a/apps/desktop/src/main/modules/binaries/cliAgentBinaries.ts+++ b/apps/desktop/src/main/modules/binaries/cliAgentBinaries.ts@@ -109,6 +109,14 @@ export const piBinary: BinarySpec = {priority: 5,};+/** Qoder CLI @see https://docs.qoder.com/cli/install.md */+export const qoderBinary: BinarySpec = {+ description: 'Qoder - AI coding agent CLI',+ detect: () => detectHeterogeneousCliCommand('qoder', 'qodercli'),+ name: 'qodercli',+ priority: 6,+};+/*** Google Gemini CLI* @see https://github.com/google-gemini/gemini-cli@@ -117,7 +125,7 @@ export const geminiCliBinary: BinarySpec = defineValidatedBinary({candidates: ['gemini'],description: 'Gemini CLI - Google agentic coding CLI',name: 'gemini',- priority: 6,+ priority: 7,validateKeywords: ['gemini'],});@@ -129,7 +137,7 @@ export const qwenCodeBinary: BinarySpec = defineValidatedBinary({candidates: ['qwen'],description: 'Qwen Code - Alibaba Qwen agentic coding CLI',name: 'qwen',- priority: 7,+ priority: 8,validateKeywords: ['qwen'],});@@ -141,7 +149,7 @@ export const kimiCliBinary: BinarySpec = defineValidatedBinary({candidates: ['kimi'],description: 'Kimi CLI - Moonshot AI agentic coding CLI',name: 'kimi',- priority: 8,+ priority: 9,validateKeywords: ['kimi'],});@@ -152,7 +160,7 @@ export const kimiCliBinary: BinarySpec = defineValidatedBinary({*/export const aiderBinary: BinarySpec = defineCommandBinary('aider', {description: 'Aider - AI pair programming in your terminal',- priority: 9,+ priority: 10,});/**@@ -164,6 +172,7 @@ export const cliAgentBinaries: BinarySpec[] = [ampBinary,opencodeBinary,piBinary,+ qoderBinary,geminiCliBinary,qwenCodeBinary,kimiCliBinary,diff --git a/apps/desktop/src/main/modules/heterogeneousAgent/drivers/qoder.test.ts b/apps/desktop/src/main/modules/heterogeneousAgent/drivers/qoder.test.tsnew file mode 100644index 00000000000..679392e4c8b--- /dev/null+++ b/apps/desktop/src/main/modules/heterogeneousAgent/drivers/qoder.test.ts@@ -0,0 +1,59 @@+import { describe, expect, it, vi } from 'vitest';++import { getHeterogeneousAgentDriver } from '../index';+import type {+ HeterogeneousAgentBuildPlanHelpers,+ HeterogeneousAgentBuildPlanParams,+} from '../types';+import { qoderDriver } from './qoder';++const buildAgentInput = vi.fn(async () => ({+ args: ['--attachment', '/tmp/image.png'],+ stdin: '{"type":"user"}\n',+}));+const helpers: HeterogeneousAgentBuildPlanHelpers = { buildAgentInput };++const buildParams = (+ overrides: Partial<HeterogeneousAgentBuildPlanParams> = {},+): HeterogeneousAgentBuildPlanParams => ({+ args: [],+ helpers,+ promptInput: 'raw prompt',+ ...overrides,+});++describe('qoderDriver', () => {+ it('is registered and composes protocol, MCP, resume, custom, and attachment args', async () => {+ expect(getHeterogeneousAgentDriver('qoder')).toBe(qoderDriver);++ const plan = await qoderDriver.buildSpawnPlan(+ buildParams({+ args: ['--verbose'],+ mcpConfigPath: '/tmp/lobe-qoder-mcp.json',+ resumeSessionId: 'qoder-session-1',+ }),+ );++ expect(buildAgentInput).toHaveBeenCalledWith('qoder', 'raw prompt');+ expect(plan).toEqual({+ args: [+ '-p',+ '--input-format',+ 'stream-json',+ '--output-format',+ 'stream-json',+ '--include-partial-messages',+ '--permission-mode',+ 'bypass_permissions',+ '--resume',+ 'qoder-session-1',+ '--mcp-config',+ '/tmp/lobe-qoder-mcp.json',+ '--verbose',+ '--attachment',+ '/tmp/image.png',+ ],+ stdinPayload: '{"type":"user"}\n',+ });+ });+});diff --git a/apps/desktop/src/main/modules/heterogeneousAgent/drivers/qoder.ts b/apps/desktop/src/main/modules/heterogeneousAgent/drivers/qoder.tsnew file mode 100644index 00000000000..ad9d956d192--- /dev/null+++ b/apps/desktop/src/main/modules/heterogeneousAgent/drivers/qoder.ts@@ -0,0 +1,24 @@+import { buildQoderArgs } from '@lobechat/heterogeneous-agents/spawn';++import type { HeterogeneousAgentBuildPlanParams, HeterogeneousAgentDriver } from '../types';++export const qoderDriver: HeterogeneousAgentDriver = {+ async buildSpawnPlan({+ args,+ helpers,+ mcpConfigPath,+ promptInput,+ resumeSessionId,+ }: HeterogeneousAgentBuildPlanParams) {+ const inputPlan = await helpers.buildAgentInput('qoder', promptInput);++ return {+ args: buildQoderArgs({+ extraArgs: [...(mcpConfigPath ? ['--mcp-config', mcpConfigPath] : []), ...args],+ inputArgs: inputPlan.args,+ resumeSessionId,+ }),+ stdinPayload: inputPlan.stdin,+ };+ },+};diff --git a/apps/desktop/src/main/modules/heterogeneousAgent/index.ts b/apps/desktop/src/main/modules/heterogeneousAgent/index.tsindex fe99450a7bd..5c3712791bf 100644--- a/apps/desktop/src/main/modules/heterogeneousAgent/index.ts+++ b/apps/desktop/src/main/modules/heterogeneousAgent/index.ts@@ -3,6 +3,7 @@ import { claudeCodeDriver } from './drivers/claudeCode';import { codexDriver } from './drivers/codex';import { opencodeDriver } from './drivers/opencode';import { piDriver } from './drivers/pi';+import { qoderDriver } from './drivers/qoder';import type { HeterogeneousAgentDriver } from './types';const heterogeneousAgentDrivers: Record<string, HeterogeneousAgentDriver> = {@@ -11,6 +12,7 @@ const heterogeneousAgentDrivers: Record<string, HeterogeneousAgentDriver> = {'codex': codexDriver,'opencode': opencodeDriver,'pi': piDriver,+ 'qoder': qoderDriver,};export const getHeterogeneousAgentDriver = (agentType: string): HeterogeneousAgentDriver => {diff --git a/apps/server/src/routers/lambda/aiAgent.ts b/apps/server/src/routers/lambda/aiAgent.tsindex 6a14df1a99a..612c9cc99d8 100644--- a/apps/server/src/routers/lambda/aiAgent.ts+++ b/apps/server/src/routers/lambda/aiAgent.ts@@ -557,7 +557,7 @@ const AgentStreamEventSchema = z.object({* → topic reverse-lookup is unreliable per design decision).*/const HeteroIngestSchema = z.object({- agentType: z.enum(['amp', 'claude-code', 'codex', 'opencode', 'pi']),+ agentType: z.enum(['amp', 'claude-code', 'codex', 'opencode', 'pi', 'qoder']),/** Initial assistant placeholder message id forwarded from the sandbox env var.* When present, `loadOrCreateState` uses it directly and skips the DB read of* topic.metadata.runningOperation, eliminating the replica-lag race condition. */@@ -574,7 +574,7 @@ const HeteroIngestSchema = z.object({* (CC's per-cwd id), kept here so the server can resume next time.*/const HeteroFinishSchema = z.object({- agentType: z.enum(['amp', 'claude-code', 'codex', 'opencode', 'pi']),+ agentType: z.enum(['amp', 'claude-code', 'codex', 'opencode', 'pi', 'qoder']),error: z.object({/**diff --git a/apps/server/src/routers/lambda/device.ts b/apps/server/src/routers/lambda/device.tsindex 3d9b8c4e6ab..53613a5efdb 100644--- a/apps/server/src/routers/lambda/device.ts+++ b/apps/server/src/routers/lambda/device.ts@@ -306,7 +306,7 @@ export const deviceRouter = router({cwd: z.string().optional(),deviceId: z.string(),env: z.record(z.string(), z.string()).optional(),- type: z.enum(['opencode', 'pi']),+ type: z.enum(['opencode', 'pi', 'qoder']),}),).query(async ({ ctx, input }) =>diff --git a/apps/server/src/services/aiAgent/index.ts b/apps/server/src/services/aiAgent/index.tsindex 7c293217cef..460af32ef54 100644--- a/apps/server/src/services/aiAgent/index.ts+++ b/apps/server/src/services/aiAgent/index.ts@@ -1910,7 +1910,7 @@ export class AiAgentService {// 3.5. Hetero-agent early exit — local CLI and remote platform agents bypass the// server-side LLM pipeline. After topic + message creation we hand off to// the device gateway (desktop) or cloud sandbox, which will push events- // back via `heteroIngest` / `heteroFinish` (amp / claude-code / codex / opencode / pi) or+ // back via `heteroIngest` / `heteroFinish` (amp / claude-code / codex / opencode / pi / qoder) or// `agentNotify.notify` (openclaw / hermes).//// Detection: prefer agencyConfig.heterogeneousProvider.type (set by the UI),@@ -1919,7 +1919,7 @@ export class AiAgentService {const heteroProviderType = agentConfig.agencyConfig?.heterogeneousProvider?.type;const isHeteroAgent = !!heteroProviderType || isHeterogeneousAgentModelId(model);const heteroType = (heteroProviderType ?? model) as- 'amp' | 'claude-code' | 'codex' | 'hermes' | 'openclaw' | 'opencode' | 'pi';+ 'amp' | 'claude-code' | 'codex' | 'hermes' | 'openclaw' | 'opencode' | 'pi' | 'qoder';// ── Shared turn setup (runs for BOTH hetero and normal agents) ──────────// Everything up to and including persisting the turn is identical for both@@ -2214,7 +2214,8 @@ export class AiAgentService {heteroType === 'claude-code' ||heteroType === 'codex' ||heteroType === 'opencode' ||- heteroType === 'pi'+ heteroType === 'pi' ||+ heteroType === 'qoder'? buildHeteroExecArgs(agentConfig.agencyConfig?.heterogeneousProvider?.type === heteroType? agentConfig.agencyConfig.heterogeneousProvider@@ -2493,7 +2494,10 @@ export class AiAgentService {agentId: resolvedAgentId,assistantMessageId: assistantMessageRecord.id,detail:- heteroType === 'amp' || heteroType === 'opencode' || heteroType === 'pi'+ heteroType === 'amp' ||+ heteroType === 'opencode' ||+ heteroType === 'pi' ||+ heteroType === 'qoder'? 'No device bound. Pick a local or connected device in the Execution Device switcher.': 'No device bound. Pick a device in the Execution Device switcher, or switch to Cloud sandbox.',message: 'No bound device for hetero agent',diff --git a/apps/server/src/services/deviceGateway/index.ts b/apps/server/src/services/deviceGateway/index.tsindex 25e486df54e..80d18cccf5d 100644--- a/apps/server/src/services/deviceGateway/index.ts+++ b/apps/server/src/services/deviceGateway/index.ts@@ -465,7 +465,7 @@ export class DeviceGateway {deviceId: string;env?: Record<string, string>;timeout?: number;- type: 'opencode' | 'pi';+ type: 'opencode' | 'pi' | 'qoder';userId: string;workspaceId?: string;}): Promise<HeterogeneousAgentModelCatalog> {diff --git a/apps/server/src/services/heterogeneousAgent/index.ts b/apps/server/src/services/heterogeneousAgent/index.tsindex 3cf61fe2309..8836a60e46a 100644--- a/apps/server/src/services/heterogeneousAgent/index.ts+++ b/apps/server/src/services/heterogeneousAgent/index.ts@@ -22,7 +22,7 @@ import { HeteroTraceRecorder } from './HeteroTraceRecorder';const log = debug('lobe-server:hetero-agent-service');-export type HeterogeneousAgentType = 'amp' | 'claude-code' | 'codex' | 'opencode' | 'pi';+export type HeterogeneousAgentType = 'amp' | 'claude-code' | 'codex' | 'opencode' | 'pi' | 'qoder';export type HeterogeneousFinishResult = 'success' | 'error' | 'cancelled';@@ -74,7 +74,7 @@ export interface HeterogeneousAgentServiceOptions {/*** Server-side ingest handler for heterogeneous agent CLIs (`lh hetero exec`- * for Amp / Claude Code / Codex / OpenCode). Receives `AgentStreamEvent` batches from the+ * for Amp / Claude Code / Codex / OpenCode / Pi / Qoder). Receives `AgentStreamEvent` batches from the* producer and republishes them through the existing `StreamEventManager`* fanout, so renderer-side gateway WS subscribers see the same wire shape* regardless of whether the run came from the agent gateway or a CLI process.diff --git a/locales/en-US/chat.json b/locales/en-US/chat.jsonindex 146245c23fe..6f3c7a1e789 100644--- a/locales/en-US/chat.json+++ b/locales/en-US/chat.json@@ -213,6 +213,7 @@"connectAgent.providerDesc.openclaw": "Personal agent platform","connectAgent.providerDesc.opencode": "Open-source coding agent CLI","connectAgent.providerDesc.pi": "Minimal coding agent CLI",+ "connectAgent.providerDesc.qoder": "Qoder coding agent CLI","createModal.createBlank": "Start Blank","createModal.groupPlaceholder": "Describe what this Group should do...","createModal.groupTitle": "What should this Group do?",@@ -724,6 +725,7 @@"newPiAgent": "Add Pi","newPlatformAgent": "Connect an Agent","newPlatformAgentDesc": "Connect Claude Code, Codex, Hermes, OpenClaw, and other agents",+ "newQoderAgent": "Add Qoder","noAgentsYet": "This group has no members yet. Click the + button to invite agents.","noAvailableAgents": "No members available to invite","noMatchingAgents": "No matching members found",@@ -793,6 +795,15 @@"plus.search.offDesc": "","plus.title": "Add","plus.tooltip": "Add files, skills, and more context...",+ "qoderInstallGuide.actions.openDocs": "Open Install Guide",+ "qoderInstallGuide.actions.openSystemTools": "Open System Tools",+ "qoderInstallGuide.afterInstall": "After installing, run `qodercli login`, then retry your message or click Re-detect in System Tools.",+ "qoderInstallGuide.desc": "Qoder needs its CLI to run locally. Install it and make sure the qodercli command is available in your PATH.",+ "qoderInstallGuide.installWithBrew": "npm install",+ "qoderInstallGuide.installWithNpm": "Recommended install",+ "qoderInstallGuide.menuNotification.title": "Qoder CLI not found",+ "qoderInstallGuide.reason": "LobeHub could not start Qoder: {{message}}",+ "qoderInstallGuide.title": "Install Qoder CLI","rag.referenceChunks": "Reference Source","rag.userQuery.actions.delete": "Delete Query Rewrite","rag.userQuery.actions.regenerate": "Regenerate Query",diff --git a/locales/zh-CN/chat.json b/locales/zh-CN/chat.jsonindex 9818505d43e..53908cd8cc4 100644--- a/locales/zh-CN/chat.json+++ b/locales/zh-CN/chat.json@@ -213,6 +213,7 @@"connectAgent.providerDesc.openclaw": "个人智能体平台","connectAgent.providerDesc.opencode": "开源编码助理 CLI","connectAgent.providerDesc.pi": "轻量编码助理 CLI",+ "connectAgent.providerDesc.qoder": "Qoder 编码助理 CLI","createModal.createBlank": "从空白开始","createModal.groupPlaceholder": "描述这个群组要完成什么…","createModal.groupTitle": "这个群组要做什么?",@@ -724,6 +725,7 @@"newPiAgent": "添加 Pi","newPlatformAgent": "连接智能体","newPlatformAgentDesc": "连接 Claude Code、Codex、Hermes、OpenClaw 等智能体",+ "newQoderAgent": "添加 Qoder","noAgentsYet": "这个群组还没有成员。点击「+」邀请助理加入","noAvailableAgents": "暂无可邀请的成员","noMatchingAgents": "未找到匹配的成员",@@ -793,6 +795,15 @@"plus.search.offDesc": "","plus.title": "添加","plus.tooltip": "添加文件、技能和更多上下文...",+ "qoderInstallGuide.actions.openDocs": "打开安装指南",+ "qoderInstallGuide.actions.openSystemTools": "打开系统工具",+ "qoderInstallGuide.afterInstall": "安装后,请运行 `qodercli login` 登录,然后重试消息或在系统工具中点击「重新检测」。",+ "qoderInstallGuide.desc": "Qoder 需要通过本地 CLI 运行。请完成安装,并确保 PATH 中可以执行 qodercli 命令。",+ "qoderInstallGuide.installWithBrew": "npm 安装",+ "qoderInstallGuide.installWithNpm": "推荐安装方式",+ "qoderInstallGuide.menuNotification.title": "未找到 Qoder CLI",+ "qoderInstallGuide.reason": "LobeHub 无法启动 Qoder:{{message}}",+ "qoderInstallGuide.title": "安装 Qoder CLI","rag.referenceChunks": "引用源","rag.userQuery.actions.delete": "删除 Query 重写","rag.userQuery.actions.regenerate": "重新生成 Query",diff --git a/packages/agent-manager-runtime/src/heteroAgentDescriptor.ts b/packages/agent-manager-runtime/src/heteroAgentDescriptor.tsindex 5dd4f86b51c..f29199fe154 100644--- a/packages/agent-manager-runtime/src/heteroAgentDescriptor.ts+++ b/packages/agent-manager-runtime/src/heteroAgentDescriptor.ts@@ -5,8 +5,8 @@* whether a target agent is fit for a job — typically "can this agent fix a bug* in a real codebase?". For a normal model-backed agent the answer lives in* `model` / `provider` / `plugins`. For a **heterogeneous** agent (an external- * CLI/runtime such as Claude Code, Codex, OpenCode, or Pi) those fields are misleading: the- * agent brings its own toolset and ignores the plugin list, so we must instead+ * CLI/runtime such as Claude Code, Codex, OpenCode, Pi, or Qoder) those fields are misleading:+ * the agent brings its own toolset and ignores the plugin list, so we must instead* describe what the external runtime is and what it can do.** This module maps a `LobeAgentAgencyConfig` into a compact, LLM-facing runtime@@ -89,6 +89,13 @@ const HETERO_PROFILES: Record<HeteroType, HeteroTypeProfile> = {displayName: 'Pi',kind: 'cli',},+ 'qoder': {+ capabilities: CODING_CAPABILITIES,+ description:+ 'Qoder — an autonomous terminal coding agent with filesystem and shell access that completes software-engineering tasks autonomously.',+ displayName: 'Qoder',+ kind: 'cli',+ },};const EXECUTION_TARGET_DESCRIPTIONS: Record<DeviceExecutionTarget, string> = {diff --git a/packages/builtin-tools/src/displayControls.test.ts b/packages/builtin-tools/src/displayControls.test.tsindex 2cef6862638..c3d09e5d40a 100644--- a/packages/builtin-tools/src/displayControls.test.ts+++ b/packages/builtin-tools/src/displayControls.test.ts@@ -28,6 +28,14 @@ describe('getBuiltinRenderDisplayControl', () => {).toBe('expand');});+ it('uses the Claude Code dynamic resolver for Qoder', () => {+ expect(+ getBuiltinRenderDisplayControl('qoder', 'Read', {+ images: [{ mediaType: 'image/png', url: 'https://cdn/a.png' }],+ }),+ ).toBe('expand');+ });+it('leaves a non-image Read undecided, so the caller falls back to collapsed', () => {expect(getBuiltinRenderDisplayControl('claude-code', 'Read')).toBeUndefined();expect(getBuiltinRenderDisplayControl('claude-code', 'Read', {})).toBeUndefined();diff --git a/packages/builtin-tools/src/displayControls.ts b/packages/builtin-tools/src/displayControls.tsindex 7bec5549d88..89be683f448 100644--- a/packages/builtin-tools/src/displayControls.ts+++ b/packages/builtin-tools/src/displayControls.ts@@ -6,6 +6,8 @@ import { type RenderDisplayControl } from '@lobechat/types';import { CodexRenderDisplayControls } from './codex/displayControls';+const QODER_IDENTIFIER = 'qoder';+// Kept separate from `./renders` so consumers that only need display-control// fallbacks (e.g. the tool store selector) don't pull in every builtin tool's// render registry — that graph cycles back through `@/store/tool/selectors`.@@ -28,6 +30,7 @@ const getDynamicRenderDisplayControlResolvers = (): Record<> => {return {[ClaudeCodeIdentifier]: resolveClaudeCodeRenderDisplayControl,+ [QODER_IDENTIFIER]: resolveClaudeCodeRenderDisplayControl,};};diff --git a/packages/builtin-tools/src/register.ts b/packages/builtin-tools/src/register.tsindex 52a86d9ba81..4fa6b88d413 100644--- a/packages/builtin-tools/src/register.ts+++ b/packages/builtin-tools/src/register.ts@@ -169,6 +169,8 @@ import { registerBuiltinRenders } from './renders';import { registerBuiltinStreamings } from './streamings';import { TwitterIdentifier, TwitterInspectors } from './twitter';+const QODER_IDENTIFIER = 'qoder';+let builtinToolSurfacesRegistered = false;export const registerBuiltinToolSurfaces = (): void => {@@ -179,6 +181,7 @@ export const registerBuiltinToolSurfaces = (): void => {[AgentDocumentsManifest.identifier]: AgentDocumentsRenders as Record<string, BuiltinRender>,[AgentManagementManifest.identifier]: AgentManagementRenders as Record<string, BuiltinRender>,[ClaudeCodeIdentifier]: ClaudeCodeRenders as Record<string, BuiltinRender>,+ [QODER_IDENTIFIER]: ClaudeCodeRenders as Record<string, BuiltinRender>,[CloudSandboxManifest.identifier]: CloudSandboxRenders as Record<string, BuiltinRender>,[GroupAgentBuilderManifest.identifier]: GroupAgentBuilderRenders as Record<string,@@ -225,6 +228,7 @@ export const registerBuiltinToolSurfaces = (): void => {BuiltinInspector>,[ClaudeCodeIdentifier]: ClaudeCodeInspectors as Record<string, BuiltinInspector>,+ [QODER_IDENTIFIER]: ClaudeCodeInspectors as Record<string, BuiltinInspector>,[CloudSandboxManifest.identifier]: CloudSandboxInspectors as Record<string, BuiltinInspector>,[GroupAgentBuilderManifest.identifier]: GroupAgentBuilderInspectors as Record<string,@@ -277,6 +281,7 @@ export const registerBuiltinToolSurfaces = (): void => {BuiltinStreaming>,[ClaudeCodeIdentifier]: ClaudeCodeStreamings as Record<string, BuiltinStreaming>,+ [QODER_IDENTIFIER]: ClaudeCodeStreamings as Record<string, BuiltinStreaming>,[CloudSandboxManifest.identifier]: CloudSandboxStreamings as Record<string, BuiltinStreaming>,[GroupAgentBuilderManifest.identifier]: GroupAgentBuilderStreamings as Record<string,@@ -299,6 +304,7 @@ export const registerBuiltinToolSurfaces = (): void => {BuiltinIntervention>,[ClaudeCodeIdentifier]: ClaudeCodeInterventions as Record<string, BuiltinIntervention>,+ [QODER_IDENTIFIER]: ClaudeCodeInterventions as Record<string, BuiltinIntervention>,[CloudSandboxManifest.identifier]: CloudSandboxInterventions as Record<string,BuiltinInterventiondiff --git a/packages/const/src/heterogeneousAgent.test.ts b/packages/const/src/heterogeneousAgent.test.tsnew file mode 100644index 00000000000..392dae7661d--- /dev/null+++ b/packages/const/src/heterogeneousAgent.test.ts@@ -0,0 +1,21 @@+import { describe, expect, it } from 'vitest';++import { HETEROGENEOUS_AGENT_MODEL_IDS, isHeterogeneousAgentModelId } from './heterogeneousAgent';++describe('isHeterogeneousAgentModelId', () => {+ it.each([...HETEROGENEOUS_AGENT_MODEL_IDS])('recognizes legacy model id %s', (model) => {+ expect(isHeterogeneousAgentModelId(model)).toBe(true);+ });++ it('includes qoder so bare model: "qoder" routes as a heterogeneous agent', () => {+ expect(HETEROGENEOUS_AGENT_MODEL_IDS).toContain('qoder');+ expect(isHeterogeneousAgentModelId('qoder')).toBe(true);+ });++ it('rejects normal cloud model ids and empty values', () => {+ expect(isHeterogeneousAgentModelId('gpt-4o')).toBe(false);+ expect(isHeterogeneousAgentModelId('')).toBe(false);+ expect(isHeterogeneousAgentModelId(null)).toBe(false);+ expect(isHeterogeneousAgentModelId(undefined)).toBe(false);+ });+});diff --git a/packages/const/src/heterogeneousAgent.ts b/packages/const/src/heterogeneousAgent.tsindex 69a5519b3ff..b320a8ab860 100644--- a/packages/const/src/heterogeneousAgent.ts+++ b/packages/const/src/heterogeneousAgent.ts@@ -16,10 +16,14 @@ export const HETEROGENEOUS_AGENT_MODEL_IDS = ['codex','opencode','pi',+ 'qoder',] as const;+export type HeterogeneousAgentModelId = (typeof HETEROGENEOUS_AGENT_MODEL_IDS)[number];+const HETEROGENEOUS_AGENT_MODEL_ID_SET = new Set<string>(HETEROGENEOUS_AGENT_MODEL_IDS);/** Whether a bare `model` value identifies a legacy heterogeneous agent runtime. */-export const isHeterogeneousAgentModelId = (model?: string | null): boolean =>- !!model && HETEROGENEOUS_AGENT_MODEL_ID_SET.has(model);+export const isHeterogeneousAgentModelId = (+ model?: string | null,+): model is HeterogeneousAgentModelId => !!model && HETEROGENEOUS_AGENT_MODEL_ID_SET.has(model);diff --git a/packages/device-control/src/types.ts b/packages/device-control/src/types.tsindex 65c7b2316e1..cc969d355f8 100644--- a/packages/device-control/src/types.ts+++ b/packages/device-control/src/types.ts@@ -241,11 +241,12 @@ export interface ListHeterogeneousAgentModelsParams {command?: string;cwd?: string;env?: Record<string, string>;- type: 'opencode' | 'pi';+ type: 'opencode' | 'pi' | 'qoder';}export interface HeterogeneousAgentModelCatalogItem {id: string;+ label?: string;modelId: string;providerId: string;}diff --git a/packages/electron-client-ipc/src/types/binary.ts b/packages/electron-client-ipc/src/types/binary.tsindex e981e78ea63..19846861b03 100644--- a/packages/electron-client-ipc/src/types/binary.ts+++ b/packages/electron-client-ipc/src/types/binary.ts@@ -23,7 +23,8 @@ export interface BinaryInfo {priority?: number;}-export type HeterogeneousCliAgentType = 'amp' | 'claude-code' | 'codex' | 'opencode' | 'pi';+export type HeterogeneousCliAgentType =+ 'amp' | 'claude-code' | 'codex' | 'opencode' | 'pi' | 'qoder';export type DetectableHeterogeneousAgentType = HeterogeneousCliAgentType | 'hermes' | 'openclaw';diff --git a/packages/electron-client-ipc/src/types/heterogeneousAgent.ts b/packages/electron-client-ipc/src/types/heterogeneousAgent.tsindex 8ceabb7c796..673d64b8db4 100644--- a/packages/electron-client-ipc/src/types/heterogeneousAgent.ts+++ b/packages/electron-client-ipc/src/types/heterogeneousAgent.ts@@ -35,6 +35,15 @@ export const PI_CLI_INSTALL_DOCS_URL = 'https://github.com/earendil-works/pi';export const PI_CLI_INSTALL_COMMANDS = ['npm install -g @earendil-works/pi-coding-agent'] as const;+export const QODER_CLI_AUTH_DOCS_URL = 'https://docs.qoder.com/cli/auth.md';++export const QODER_CLI_INSTALL_DOCS_URL = 'https://docs.qoder.com/cli/install.md';++export const QODER_CLI_INSTALL_COMMANDS = [+ 'curl -fsSL https://qoder.com/install | bash',+ 'npm install -g @qoder-ai/qodercli',+] as const;+export const HeterogeneousAgentSessionErrorCode = {AuthRequired: 'auth_required',CliNotFound: 'cli_not_found',diff --git a/packages/heterogeneous-agents/src/adapters/index.ts b/packages/heterogeneous-agents/src/adapters/index.tsindex 04ab1819f2b..95b90d512bb 100644--- a/packages/heterogeneous-agents/src/adapters/index.ts+++ b/packages/heterogeneous-agents/src/adapters/index.ts@@ -3,3 +3,4 @@ export { ClaudeCodeAdapter, ClaudeCodeSdkAdapter } from './claudeCode';export { CodexAdapter } from './codex';export { OpenCodeAdapter } from './opencode';export { PiAdapter } from './pi';+export { QoderAdapter } from './qoder';diff --git a/packages/heterogeneous-agents/src/adapters/qoder.test.ts b/packages/heterogeneous-agents/src/adapters/qoder.test.tsnew file mode 100644index 00000000000..c0bc4bfb0f1--- /dev/null+++ b/packages/heterogeneous-agents/src/adapters/qoder.test.ts@@ -0,0 +1,176 @@+import { describe, expect, it } from 'vitest';++import { QoderAdapter } from './qoder';++describe('QoderAdapter', () => {+ it('maps lifecycle, text, and usage with Qoder identity', () => {+ const adapter = new QoderAdapter();+ const start = adapter.adapt({+ model: 'qoder-default',+ session_id: 'qoder-session-1',+ subtype: 'init',+ type: 'system',+ });++ expect(start[0]).toMatchObject({+ data: { model: 'qoder-default', provider: 'qoder', sessionId: 'qoder-session-1' },+ type: 'stream_start',+ });+ expect(adapter.sessionId).toBe('qoder-session-1');++ const assistant = adapter.adapt({+ message: {+ content: [{ text: 'hello', type: 'text' }],+ id: 'msg-1',+ model: 'qoder-default',+ usage: { input_tokens: 12, output_tokens: 3 },+ },+ type: 'assistant',+ });+ expect(assistant).toContainEqual(+ expect.objectContaining({+ data: expect.objectContaining({ chunkType: 'text', content: 'hello' }),+ type: 'stream_chunk',+ }),+ );+ expect(assistant).toContainEqual(+ expect.objectContaining({+ data: expect.objectContaining({ provider: 'qoder' }),+ type: 'step_complete',+ }),+ );++ expect(+ adapter.adapt({ is_error: false, result: 'done', type: 'result' }).map((event) => event.type),+ ).toEqual(['stream_end', 'visible_output_end', 'agent_runtime_end']);+ });++ it('maps partial text and thinking deltas', () => {+ const adapter = new QoderAdapter();+ adapter.adapt({ subtype: 'init', type: 'system' });+ adapter.adapt({+ event: { message: { id: 'msg-1', model: 'qoder-default' }, type: 'message_start' },+ type: 'stream_event',+ });++ const text = adapter.adapt({+ event: {+ delta: { text: 'Hel', type: 'text_delta' },+ index: 0,+ type: 'content_block_delta',+ },+ type: 'stream_event',+ });+ const thinking = adapter.adapt({+ event: {+ delta: { thinking: 'reasoning', type: 'thinking_delta' },+ index: 0,+ type: 'content_block_delta',+ },+ type: 'stream_event',+ });++ expect(text[0]).toMatchObject({ data: { chunkType: 'text', content: 'Hel' } });+ expect(thinking[0]).toMatchObject({+ data: { chunkType: 'reasoning', reasoning: 'reasoning' },+ });+ });++ it('normalizes tool calls, results, and parent lineage to Qoder', () => {+ const adapter = new QoderAdapter();+ adapter.adapt({ subtype: 'init', type: 'system' });++ const toolEvents = adapter.adapt({+ message: {+ content: [{ id: 'tool-1', input: { command: 'pwd' }, name: 'Bash', type: 'tool_use' }],+ id: 'msg-sub',+ },+ parent_tool_use_id: 'parent-tool-1',+ type: 'assistant',+ });+ const calling = toolEvents.find(+ (event) => event.type === 'stream_chunk' && event.data.chunkType === 'tools_calling',+ );+ expect(calling?.data).toMatchObject({+ subagent: { parentToolCallId: 'parent-tool-1' },+ toolsCalling: [{ apiName: 'Bash', id: 'tool-1', identifier: 'qoder' }],+ });+ expect(toolEvents.find((event) => event.type === 'tool_start')?.data).toMatchObject({+ subagent: { parentToolCallId: 'parent-tool-1' },+ toolCalling: { identifier: 'qoder' },+ });++ const resultEvents = adapter.adapt({+ message: {+ content: [{ content: '/workspace', tool_use_id: 'tool-1', type: 'tool_result' }],+ role: 'user',+ },+ parent_tool_use_id: 'parent-tool-1',+ type: 'user',+ });+ expect(resultEvents.find((event) => event.type === 'tool_result')?.data).toMatchObject({+ content: '/workspace',+ subagent: { parentToolCallId: 'parent-tool-1' },+ toolCallId: 'tool-1',+ });+ expect(resultEvents.find((event) => event.type === 'tool_end')?.data).toMatchObject({+ payload: { toolCalling: { identifier: 'qoder' } },+ subagent: { parentToolCallId: 'parent-tool-1' },+ });+ });++ it('emits one structured Qoder auth error even though Qoder exits successfully', () => {+ const adapter = new QoderAdapter();+ adapter.adapt({ subtype: 'init', type: 'system' });+ const authText = 'Not logged in · Please run /login';++ expect(+ adapter.adapt({+ message: {+ content: [+ { text: 'Not logged in', type: 'text' },+ { text: 'Please run /login', type: 'text' },+ ],+ id: 'msg-auth',+ },+ type: 'assistant',+ }),+ ).toEqual([]);++ const events = adapter.adapt({+ is_error: true,+ result: authText,+ subtype: 'success',+ type: 'result',+ });+ expect(events.map((event) => event.type)).toEqual([+ 'stream_end',+ 'visible_output_end',+ 'error',+ ]);+ expect(events[2].data).toMatchObject({+ agentType: 'qoder',+ code: 'auth_required',+ docsUrl: 'https://docs.qoder.com/cli/auth.md',+ stderr: authText,+ });+ expect(events[2].data.message).toContain('Qoder');+ });++ it('normalizes pending tool identity when flushing', () => {+ const adapter = new QoderAdapter();+ adapter.adapt({ subtype: 'init', type: 'system' });+ adapter.adapt({+ message: {+ content: [{ id: 'tool-1', input: {}, name: 'Read', type: 'tool_use' }],+ id: 'msg-1',+ },+ type: 'assistant',+ });++ expect(adapter.flush()[0]).toMatchObject({+ data: { payload: { toolCalling: { identifier: 'qoder' } }, toolCallId: 'tool-1' },+ type: 'tool_end',+ });+ });+});diff --git a/packages/heterogeneous-agents/src/adapters/qoder.ts b/packages/heterogeneous-agents/src/adapters/qoder.tsnew file mode 100644index 00000000000..1fee93f0e81--- /dev/null+++ b/packages/heterogeneous-agents/src/adapters/qoder.ts@@ -0,0 +1,90 @@+/**+ * Qoder CLI adapter.+ *+ * Qoder's stream-json protocol is intentionally compatible with the+ * assistant/user/result framing used by Claude Code. Reuse that mature state+ * machine, but keep Qoder as a first-class provider: every normalized event,+ * tool payload, error, and usage record is stamped with Qoder's identity.+ */++import type { HeterogeneousAgentEvent } from '../types';+import { ClaudeCodeAdapter } from './claudeCode';++export const QODER_IDENTIFIER = 'qoder';++const CLAUDE_CODE_AUTH_DOCS_URL = 'https://docs.anthropic.com/en/docs/claude-code/setup';+const QODER_AUTH_DOCS_URL = 'https://docs.qoder.com/cli/auth.md';+const QODER_AUTH_REQUIRED_PATTERNS = [/not logged in/i, /please run \/login/i] as const;++const isQoderAuthAssistant = (raw: unknown): boolean => {+ if (!raw || typeof raw !== 'object') return false;+ const event = raw as { message?: { content?: unknown }; type?: string };+ if (event.type !== 'assistant' || !Array.isArray(event.message?.content)) return false;++ const text = event.message.content+ .map((block) =>+ block && typeof block === 'object' && 'text' in block && typeof block.text === 'string'+ ? block.text+ : '',+ )+ .join(' ');++ return QODER_AUTH_REQUIRED_PATTERNS.every((pattern) => pattern.test(text));+};++const normalizeQoderValue = (value: unknown, key?: string): void => {+ if (!value || typeof value !== 'object') return;++ if (Array.isArray(value)) {+ for (const entry of value) normalizeQoderValue(entry);+ return;+ }++ const record = value as Record<string, unknown>;+ for (const [childKey, childValue] of Object.entries(record)) {+ if (+ (childKey === 'agentType' || childKey === 'identifier' || childKey === 'provider') &&+ childValue === 'claude-code'+ ) {+ record[childKey] = QODER_IDENTIFIER;+ continue;+ }+ if (childKey === 'docsUrl' && childValue === CLAUDE_CODE_AUTH_DOCS_URL) {+ record[childKey] = QODER_AUTH_DOCS_URL;+ continue;+ }+ if (+ (childKey === 'error' || childKey === 'message') &&+ typeof childValue === 'string' &&+ childValue.includes('Claude Code')+ ) {+ record[childKey] = childValue.replaceAll('Claude Code', 'Qoder');+ continue;+ }+ normalizeQoderValue(childValue, childKey);+ }++ // Qoder's Task tools are not the Claude Code Todo/Task UI contract. Keep+ // their native tool calls/results, but do not attach Claude-specific derived+ // todo state to the normalized result.+ if (key === 'pluginState') delete record.todos;+};++const normalizeQoderEvents = (events: HeterogeneousAgentEvent[]): HeterogeneousAgentEvent[] => {+ for (const event of events) normalizeQoderValue(event);+ return events;+};++export class QoderAdapter extends ClaudeCodeAdapter {+ adapt(raw: unknown): HeterogeneousAgentEvent[] {+ // Qoder reports a missing login as both an assistant text block and a+ // terminal `result { subtype: "success", is_error: true }`. Suppress the+ // transient text echo; the result becomes one structured auth guide error.+ if (isQoderAuthAssistant(raw)) return [];+ return normalizeQoderEvents(super.adapt(raw));+ }++ flush(): HeterogeneousAgentEvent[] {+ return normalizeQoderEvents(super.flush());+ }+}diff --git a/packages/heterogeneous-agents/src/client/index.ts b/packages/heterogeneous-agents/src/client/index.tsindex b377830bfd0..deb51c7b7b9 100644--- a/packages/heterogeneous-agents/src/client/index.ts+++ b/packages/heterogeneous-agents/src/client/index.ts@@ -1,5 +1,5 @@import type { IconType } from '@lobehub/icons';-import { Amp, ClaudeCode, Codex, getLobeIconCDN, OpenCode, Pi } from '@lobehub/icons';+import { Amp, ClaudeCode, Codex, getLobeIconCDN, OpenCode, Pi, Qoder } from '@lobehub/icons';import {getHeterogeneousAgentConfig,@@ -21,6 +21,7 @@ const heterogeneousAgentIcons = {'codex': Codex,'opencode': OpenCode,'pi': Pi,+ 'qoder': Qoder,} as const satisfies Record<HeterogeneousAgentConfig['type'], IconType>;const createAgentAvatar = (iconId: string) =>diff --git a/packages/heterogeneous-agents/src/config.test.ts b/packages/heterogeneous-agents/src/config.test.tsindex 13cd63d24c0..84da4bac476 100644--- a/packages/heterogeneous-agents/src/config.test.ts+++ b/packages/heterogeneous-agents/src/config.test.ts@@ -15,6 +15,7 @@ describe('heterogeneous agent config', () => {'codex','opencode','pi',+ 'qoder',]);});@@ -44,6 +45,11 @@ describe('heterogeneous agent config', () => {title: 'Pi',type: 'pi',});+ expect(getHeterogeneousAgentConfig('qoder')).toMatchObject({+ command: 'qodercli',+ title: 'Qoder',+ type: 'qoder',+ });});it('derives display labels from the shared config source', () => {@@ -55,6 +61,7 @@ describe('heterogeneous agent config', () => {'openclaw': 'OpenClaw','opencode': 'OpenCode','pi': 'Pi',+ 'qoder': 'Qoder',});});@@ -62,6 +69,7 @@ describe('heterogeneous agent config', () => {expect(isRemoteHeterogeneousType('amp')).toBe(false);expect(isRemoteHeterogeneousType('opencode')).toBe(false);expect(isRemoteHeterogeneousType('pi')).toBe(false);+ expect(isRemoteHeterogeneousType('qoder')).toBe(false);expect(isRemoteHeterogeneousType('openclaw')).toBe(true);expect(isRemoteHeterogeneousType('hermes')).toBe(true);});diff --git a/packages/heterogeneous-agents/src/config.ts b/packages/heterogeneous-agents/src/config.tsindex dbf7d7da37f..5d99feb7229 100644--- a/packages/heterogeneous-agents/src/config.ts+++ b/packages/heterogeneous-agents/src/config.ts@@ -1,8 +1,13 @@export type HeterogeneousAgentMenuLabelKey =- 'newAmpAgent' | 'newClaudeCodeAgent' | 'newCodexAgent' | 'newOpenCodeAgent' | 'newPiAgent';+ | 'newAmpAgent'+ | 'newClaudeCodeAgent'+ | 'newCodexAgent'+ | 'newOpenCodeAgent'+ | 'newPiAgent'+ | 'newQoderAgent';/**- * Config for local CLI hetero agents (Amp, Claude Code, Codex, OpenCode, Pi) that run as+ * Config for local CLI hetero agents (Amp, Claude Code, Codex, OpenCode, Pi, Qoder) that run as* desktop subprocesses via Electron IPC. Platform task agents (openclaw,* hermes) use a separate notify-based runner and are not listed here.*/@@ -12,7 +17,7 @@ export interface HeterogeneousAgentConfig {menuKey: string;menuLabelKey: HeterogeneousAgentMenuLabelKey;title: string;- type: 'amp' | 'claude-code' | 'codex' | 'opencode' | 'pi';+ type: 'amp' | 'claude-code' | 'codex' | 'opencode' | 'pi' | 'qoder';}export const HETEROGENEOUS_AGENT_CONFIGS = [@@ -56,6 +61,14 @@ export const HETEROGENEOUS_AGENT_CONFIGS = [title: 'Pi',type: 'pi',},+ {+ command: 'qodercli',+ iconId: 'Qoder',+ menuKey: 'newQoderAgent',+ menuLabelKey: 'newQoderAgent',+ title: 'Qoder',+ type: 'qoder',+ },] as const satisfies readonly HeterogeneousAgentConfig[];export const getHeterogeneousAgentConfig = (type: string) =>diff --git a/packages/heterogeneous-agents/src/index.ts b/packages/heterogeneous-agents/src/index.tsindex a2e8ec51227..abf24445298 100644--- a/packages/heterogeneous-agents/src/index.ts+++ b/packages/heterogeneous-agents/src/index.ts@@ -1,4 +1,4 @@-export { AmpAdapter, ClaudeCodeAdapter } from './adapters';+export { AmpAdapter, ClaudeCodeAdapter, QoderAdapter } from './adapters';export type {HeterogeneousAgentType,LocalHeterogeneousAgentType,diff --git a/packages/heterogeneous-agents/src/models/index.ts b/packages/heterogeneous-agents/src/models/index.tsindex bd32e565cae..e04e0b64654 100644--- a/packages/heterogeneous-agents/src/models/index.ts+++ b/packages/heterogeneous-agents/src/models/index.ts@@ -2,4 +2,5 @@ export {listHeterogeneousAgentModels,parseOpenCodeModelCatalog,parsePiModelCatalog,+ parseQoderModelCatalog,} from './listHeterogeneousAgentModels';diff --git a/packages/heterogeneous-agents/src/models/listHeterogeneousAgentModels.test.ts b/packages/heterogeneous-agents/src/models/listHeterogeneousAgentModels.test.tsindex c099821f3b2..7389b7438a3 100644--- a/packages/heterogeneous-agents/src/models/listHeterogeneousAgentModels.test.ts+++ b/packages/heterogeneous-agents/src/models/listHeterogeneousAgentModels.test.ts@@ -222,4 +222,59 @@ describe('heterogeneous agent model discovery', () => {expect.any(Function),);});++ it('parses and discovers Qoder built-in names and custom model IDs', async () => {+ const stdout = [+ 'MODEL',+ 'Auto',+ 'Claude Sonnet 4.5',+ 'Team Gateway (team-model-id)',+ 'Team Gateway (team-model-id)',+ 'Long custom model (model-id-that-was-truncated-at-forty-ch…)',+ '',+ ].join('\n');+ resolveExecFile(stdout);+ const { listHeterogeneousAgentModels, parseQoderModelCatalog } = await importModule();++ expect(parseQoderModelCatalog(stdout)).toEqual([+ { id: 'Auto', modelId: 'Auto', providerId: 'qoder' },+ { id: 'Claude Sonnet 4.5', modelId: 'Claude Sonnet 4.5', providerId: 'qoder' },+ {+ id: 'team-model-id',+ label: 'Team Gateway',+ modelId: 'team-model-id',+ providerId: 'qoder',+ },+ ]);++ await expect(+ listHeterogeneousAgentModels({+ command: '/custom/qodercli',+ cwd: '/repo',+ env: { QODER_CONFIG_DIR: '/config' },+ type: 'qoder',+ }),+ ).resolves.toMatchObject({+ models: [+ { id: 'Auto', modelId: 'Auto', providerId: 'qoder' },+ { id: 'Claude Sonnet 4.5', modelId: 'Claude Sonnet 4.5', providerId: 'qoder' },+ {+ id: 'team-model-id',+ label: 'Team Gateway',+ modelId: 'team-model-id',+ providerId: 'qoder',+ },+ ],+ status: 'success',+ });+ expect(execFileMock).toHaveBeenLastCalledWith(+ '/custom/qodercli',+ ['--list-models'],+ expect.objectContaining({+ cwd: '/repo',+ env: { QODER_CONFIG_DIR: '/config' },+ }),+ expect.any(Function),+ );+ });});diff --git a/packages/heterogeneous-agents/src/models/listHeterogeneousAgentModels.ts b/packages/heterogeneous-agents/src/models/listHeterogeneousAgentModels.tsindex d2840098f29..b349ccdcf5e 100644--- a/packages/heterogeneous-agents/src/models/listHeterogeneousAgentModels.ts+++ b/packages/heterogeneous-agents/src/models/listHeterogeneousAgentModels.ts@@ -17,6 +17,7 @@ const MODEL_CATALOG_MAX_BUFFER = 256 * 1024;const MODEL_CATALOG_TIMEOUT_MS = 15_000;const OPENCODE_MODEL_ID_PATTERN = /^[A-Z0-9][\w.-]*\/[A-Z0-9@][\w./:@+-]*$/i;const PI_MODEL_ROW_PATTERN = /^(\S+)\s{2,}(\S+)\s{2,}\S+\s{2,}\S+\s{2,}(?:yes|no)\s{2,}(?:yes|no)$/;+const QODER_CUSTOM_MODEL_ROW_PATTERN = /^(.+?) \(([^()\s]+)\)$/;export const parseOpenCodeModelCatalog = (stdout: string): HeterogeneousAgentModel[] => {const seen = new Set<string>();@@ -58,6 +59,37 @@ export const parsePiModelCatalog = (stdout: string): HeterogeneousAgentModel[] =return models;};+/**+ * Parse the one-column table emitted by `qodercli --list-models`.+ * Built-in models are selected by name; custom models append their modelID in+ * parentheses and must be selected by that id.+ */+export const parseQoderModelCatalog = (stdout: string): HeterogeneousAgentModel[] => {+ const seen = new Set<string>();+ const models: HeterogeneousAgentModel[] = [];++ for (const rawLine of stdout.split(/\r?\n/)) {+ const line = rawLine.trim();+ if (!line || line === 'MODEL') continue;++ const match = QODER_CUSTOM_MODEL_ROW_PATTERN.exec(line);+ const id = match?.[2] ?? line;+ // Qoder truncates model IDs longer than 40 characters in this human-readable+ // command. Do not persist an id that the native `--model` flag cannot resolve.+ if (id.endsWith('…') || seen.has(id)) continue;++ seen.add(id);+ models.push({+ id,+ ...(match?.[1] ? { label: match[1] } : {}),+ modelId: id,+ providerId: 'qoder',+ });+ }++ return models;+};+const getErrorRecord = (error: unknown) =>error as {code?: string;@@ -78,7 +110,7 @@ const getCatalogErrorMessage = (code: HeterogeneousAgentModelCatalogErrorCode,type: ListHeterogeneousAgentModelsParams['type'],): string => {- const name = type === 'pi' ? 'Pi' : 'OpenCode';+ const name = type === 'pi' ? 'Pi' : type === 'qoder' ? 'Qoder' : 'OpenCode';if (code === 'cli_not_found') return `${name} CLI was not found`;if (code === 'timeout') return `${name} model discovery timed out`;@@ -98,7 +130,7 @@ export const listHeterogeneousAgentModels = async (): Promise<HeterogeneousAgentModelCatalog> => {const updatedAt = Date.now();const resolved = await resolveHeteroSpawnCommand(params.type, params.command);- const args = params.type === 'pi' ? ['--list-models'] : ['models'];+ const args = params.type === 'opencode' ? ['models'] : ['--list-models'];const spawnPlan = await resolveCliSpawnPlan(resolved.command, args);const callerEnv = params.env ?? process.env;const mergedPath = [@@ -127,7 +159,9 @@ export const listHeterogeneousAgentModels = async (models:params.type === 'pi'? parsePiModelCatalog(String(stdout))- : parseOpenCodeModelCatalog(String(stdout)),+ : params.type === 'qoder'+ ? parseQoderModelCatalog(String(stdout))+ : parseOpenCodeModelCatalog(String(stdout)),status: 'success',updatedAt,};diff --git a/packages/heterogeneous-agents/src/registry.test.ts b/packages/heterogeneous-agents/src/registry.test.tsindex c2976953466..3f8d5a158b5 100644--- a/packages/heterogeneous-agents/src/registry.test.ts+++ b/packages/heterogeneous-agents/src/registry.test.ts@@ -6,6 +6,7 @@ import {CodexAdapter,OpenCodeAdapter,PiAdapter,+ QoderAdapter,} from './adapters';import { createAdapter, listAgentTypes } from './registry';@@ -34,6 +35,10 @@ describe('registry', () => {expect(createAdapter('pi')).toBeInstanceOf(PiAdapter);});+ it('creates a QoderAdapter for "qoder"', () => {+ expect(createAdapter('qoder')).toBeInstanceOf(QoderAdapter);+ });+it('throws for unknown agent type', () => {expect(() => createAdapter('unknown-agent')).toThrow('Unknown agent type: "unknown-agent"');});@@ -47,6 +52,7 @@ describe('registry', () => {expect(types).toContain('codex');expect(types).toContain('opencode');expect(types).toContain('pi');+ expect(types).toContain('qoder');});});});diff --git a/packages/heterogeneous-agents/src/registry.ts b/packages/heterogeneous-agents/src/registry.tsindex 2c22acfa2c2..99ccc35fab3 100644--- a/packages/heterogeneous-agents/src/registry.ts+++ b/packages/heterogeneous-agents/src/registry.ts@@ -12,6 +12,7 @@ import {CodexAdapter,OpenCodeAdapter,PiAdapter,+ QoderAdapter,} from './adapters';import type { AgentEventAdapter } from './types';@@ -38,6 +39,9 @@ const registry: Record<string, AgentRegistryEntry> = {'pi': {createAdapter: () => new PiAdapter(),},+ 'qoder': {+ createAdapter: () => new QoderAdapter(),+ },// 'kimi-cli': { createAdapter: () => new KimiCLIAdapter() },};diff --git a/packages/heterogeneous-agents/src/spawn/classifyProcessFailure.test.ts b/packages/heterogeneous-agents/src/spawn/classifyProcessFailure.test.tsindex b165aebbff3..10c860fe64f 100644--- a/packages/heterogeneous-agents/src/spawn/classifyProcessFailure.test.ts+++ b/packages/heterogeneous-agents/src/spawn/classifyProcessFailure.test.ts@@ -35,6 +35,13 @@ describe('isHeteroStatusGuideErrorData', () => {message: 'No API key found',}),).toBe(true);+ expect(+ isHeteroStatusGuideErrorData({+ agentType: 'qoder',+ code: 'auth_required',+ message: 'Not logged in · Please run /login',+ }),+ ).toBe(true);});it('rejects payloads missing the agentType/code pair or outside the guide sets', () => {@@ -109,6 +116,32 @@ describe('classifyHeteroProcessFailure', () => {).toMatchObject({ agentType: 'pi', code: 'auth_required' });});+ it('classifies missing Qoder and its successful-exit login message', () => {+ expect(+ classifyHeteroProcessFailure({+ agentType: 'qoder',+ detail: 'Error: spawn qodercli ENOENT',+ errnoCode: 'ENOENT',+ }),+ ).toMatchObject({ agentType: 'qoder', code: 'cli_not_found' });++ const auth = classifyHeteroProcessFailure({+ agentType: 'qoder',+ detail: 'Not logged in · Please run /login',+ });+ expect(auth).toMatchObject({ agentType: 'qoder', code: 'auth_required' });+ expect(auth?.message).toContain('Qoder');+ });++ it('keeps Qoder-specific login wording scoped to Qoder', () => {+ expect(+ classifyHeteroProcessFailure({ agentType: 'qoder', detail: 'Please run /login' }),+ ).toMatchObject({ code: 'auth_required' });+ expect(+ classifyHeteroProcessFailure({ agentType: 'claude-code', detail: 'Please run /login' }),+ ).toBeUndefined();+ });+it('does NOT treat an in-run ENOENT (no spawn context) as cli_not_found', () => {const result = classifyHeteroProcessFailure({agentType: 'claude-code',diff --git a/packages/heterogeneous-agents/src/spawn/classifyProcessFailure.ts b/packages/heterogeneous-agents/src/spawn/classifyProcessFailure.tsindex f82184671b2..cc9c426836c 100644--- a/packages/heterogeneous-agents/src/spawn/classifyProcessFailure.ts+++ b/packages/heterogeneous-agents/src/spawn/classifyProcessFailure.ts@@ -39,7 +39,8 @@ const CLI_AUTH_REQUIRED_PATTERNS = [/\b401\b/,/no api key found/i,/no models available/i,-];+] as const;+const QODER_AUTH_REQUIRED_PATTERNS = [/not logged in/i, /please run \/login/i] as const;const CLI_NOT_FOUND_MESSAGES: Record<string, string> = {'claude-code':@@ -49,6 +50,8 @@ const CLI_NOT_FOUND_MESSAGES: Record<string, string> = {'opencode':'OpenCode CLI was not found on the machine running this agent. Install it and make sure `opencode` can be executed.','pi': 'Pi CLI was not found on the machine running this agent. Install it and make sure `pi` can be executed.',+ 'qoder':+ 'Qoder CLI was not found on the machine running this agent. Install it and make sure `qodercli` can be executed.',};const AUTH_REQUIRED_MESSAGES: Record<string, string> = {@@ -59,6 +62,8 @@ const AUTH_REQUIRED_MESSAGES: Record<string, string> = {'opencode':'OpenCode could not authenticate on the machine running this agent. Sign in again or refresh its credentials, then retry.','pi': 'Pi could not authenticate on the machine running this agent. Run `pi`, use `/login`, then retry.',+ 'qoder':+ 'Qoder could not authenticate on the machine running this agent. Run `qodercli login`, then retry.',};/**@@ -73,7 +78,14 @@ const STATUS_GUIDE_ERROR_CODES = new Set(['overloaded','rate_limit',]);-const STATUS_GUIDE_AGENT_TYPES = new Set(['amp', 'claude-code', 'codex', 'opencode', 'pi']);+const STATUS_GUIDE_AGENT_TYPES = new Set([+ 'amp',+ 'claude-code',+ 'codex',+ 'opencode',+ 'pi',+ 'qoder',+]);/*** Whether a terminal error payload (an adapter's in-stream `error` event data,@@ -131,7 +143,11 @@ export const classifyHeteroProcessFailure = (};}- if (detail && CLI_AUTH_REQUIRED_PATTERNS.some((pattern) => pattern.test(detail))) {+ const authRequiredPatterns =+ agentType === 'qoder'+ ? [...CLI_AUTH_REQUIRED_PATTERNS, ...QODER_AUTH_REQUIRED_PATTERNS]+ : CLI_AUTH_REQUIRED_PATTERNS;+ if (detail && authRequiredPatterns.some((pattern) => pattern.test(detail))) {return {agentType,code: 'auth_required',diff --git a/packages/heterogeneous-agents/src/spawn/index.ts b/packages/heterogeneous-agents/src/spawn/index.tsindex fc6db7ca016..625cb1100f3 100644--- a/packages/heterogeneous-agents/src/spawn/index.ts+++ b/packages/heterogeneous-agents/src/spawn/index.ts@@ -89,6 +89,7 @@ export {} from './ensureResumeTranscript';export {AMP_BASE_ARGS,+ buildQoderArgs,CLAUDE_CODE_BASE_ARGS,CODEX_BYPASS_APPROVALS_AND_SANDBOX_ARG,CODEX_DEFAULT_EXECUTION_ARGS,@@ -96,6 +97,8 @@ export {CODEX_REQUIRED_ARGS,OPENCODE_BASE_ARGS,PI_BASE_ARGS,+ QODER_BASE_ARGS,+ type QoderSpawnArgsOptions,spawnAgent,type SpawnAgentHandle,type SpawnAgentOptions,diff --git a/packages/heterogeneous-agents/src/spawn/input/buildAgentInput.test.ts b/packages/heterogeneous-agents/src/spawn/input/buildAgentInput.test.tsindex 7c550a1f6dd..0f22750a039 100644--- a/packages/heterogeneous-agents/src/spawn/input/buildAgentInput.test.ts+++ b/packages/heterogeneous-agents/src/spawn/input/buildAgentInput.test.ts@@ -300,6 +300,45 @@ describe('buildAgentInput', () => {});});+ describe('qoder', () => {+ it('uses Qoder stream-json stdin and path-based --attachment flags', async () => {+ const filePath = path.join(tmp, 'qoder input.png');+ await writeFile(filePath, PNG_BYTES);+ const plan = await buildAgentInput('qoder', [+ { text: 'first', type: 'text' },+ { source: { path: filePath, type: 'path' }, type: 'image' },+ { text: 'second', type: 'text' },+ ]);++ expect(plan.args).toEqual(['--attachment', filePath]);+ expect(JSON.parse(plan.stdin.trim())).toEqual({+ message: {+ content: [{ text: 'first\n\nsecond', type: 'text' }],+ role: 'user',+ },+ parent_tool_use_id: null,+ type: 'user',+ });+ });++ it('materializes base64 images instead of embedding Claude-style image blocks', async () => {+ const plan = await buildAgentInput(+ 'qoder',+ [+ {+ source: { data: PNG_BYTES.toString('base64'), mediaType: 'image/png', type: 'base64' },+ type: 'image',+ },+ ],+ { cacheDir: tmp },+ );++ expect(plan.args[0]).toBe('--attachment');+ expect(plan.args[1]).toMatch(/\.png$/);+ expect(JSON.parse(plan.stdin.trim()).message.content).toEqual([]);+ });+ });+it('throws on unknown agent types', async () => {await expect(buildAgentInput('kimi-cli', 'hi')).rejects.toThrow(/unsupported agent type/);});diff --git a/packages/heterogeneous-agents/src/spawn/input/buildAgentInput.ts b/packages/heterogeneous-agents/src/spawn/input/buildAgentInput.tsindex f6d7deb7096..78587d4cad1 100644--- a/packages/heterogeneous-agents/src/spawn/input/buildAgentInput.ts+++ b/packages/heterogeneous-agents/src/spawn/input/buildAgentInput.ts@@ -143,6 +143,26 @@ const buildPiInput = async (};};+const buildQoderInput = async (+ blocks: AgentContentBlock[],+ options: BuildAgentInputOptions,+): Promise<AgentInputPlan> => {+ const imagePaths = await resolvePathInputImagePaths(blocks, options);+ const text = collectText(blocks);++ return {+ args: imagePaths.flatMap((imagePath) => ['--attachment', imagePath]),+ stdin: `${JSON.stringify({+ message: {+ content: text ? [{ text, type: 'text' }] : [],+ role: 'user',+ },+ parent_tool_use_id: null,+ type: 'user',+ })}\n`,+ };+};+/*** Convert a unified `AgentPromptInput` into the per-agent stdin payload + any* extra CLI args required to attach images. The single source of truth for@@ -152,6 +172,7 @@ const buildPiInput = async (* - `codex`: raw text on stdin + repeatable `--image <path>` flags* - `opencode`: raw text on stdin + repeatable `--file <path>` flags* - `pi`: raw text on stdin + repeatable `@<path>` arguments+ * - `qoder`: stream-json text on stdin + repeatable `--attachment <path>` flags** Path-mode agents materialize URL / base64 images via `materializeImageToPath`* into `imageMaterializeDir` (defaults to `cacheDir` then `os.tmpdir()`).@@ -177,6 +198,9 @@ export const buildAgentInput = async (case 'pi': {return buildPiInput(blocks, options);}+ case 'qoder': {+ return buildQoderInput(blocks, options);+ }default: {throw new Error(`buildAgentInput: unsupported agent type "${agentType}"`);}diff --git a/packages/heterogeneous-agents/src/spawn/resolveCliCommand.test.ts b/packages/heterogeneous-agents/src/spawn/resolveCliCommand.test.tsindex 4581fc162a0..5ebfc5e50d4 100644--- a/packages/heterogeneous-agents/src/spawn/resolveCliCommand.test.ts+++ b/packages/heterogeneous-agents/src/spawn/resolveCliCommand.test.ts@@ -104,6 +104,20 @@ describe('resolveCliCommand', () => {});});+ it('resolves and validates Qoder using its bare semver output', async () => {+ callExecFile('/Users/x/.local/bin/qodercli\n');+ callExecFile('1.1.15');++ const { detectHeterogeneousCliCommand } = await importModule();+ const status = await detectHeterogeneousCliCommand('qoder', 'qodercli');++ expect(status).toMatchObject({+ available: true,+ path: '/Users/x/.local/bin/qodercli',+ version: '1.1.15',+ });+ });+it('finds OpenCode in its well-known user-local install path', async () => {const originalPath = process.env.PATH;const originalShell = process.env.SHELL;@@ -330,6 +344,11 @@ describe('resolveCliCommand', () => {expect(DEFAULT_HETERO_COMMAND.pi).toBe('pi');});+ it('defines qodercli as the default Qoder command', async () => {+ const { DEFAULT_HETERO_COMMAND } = await importModule();+ expect(DEFAULT_HETERO_COMMAND.qoder).toBe('qodercli');+ });+it('resolves the default bare command to the validated absolute path', async () => {callExecFile('/usr/local/bin/codex\n');callExecFile('codex-cli 0.142.5');diff --git a/packages/heterogeneous-agents/src/spawn/resolveCliCommand.ts b/packages/heterogeneous-agents/src/spawn/resolveCliCommand.tsindex 7572dc9a3e4..39c3ae78295 100644--- a/packages/heterogeneous-agents/src/spawn/resolveCliCommand.ts+++ b/packages/heterogeneous-agents/src/spawn/resolveCliCommand.ts@@ -4,7 +4,7 @@ import path from 'node:path';import { promisify } from 'node:util';/**- * Shared resolver for external CLI-agent binaries (Amp / Claude Code / Codex / OpenCode / Pi).+ * Shared resolver for external CLI-agent binaries (Amp / Claude Code / Codex / OpenCode / Pi / Qoder).** This is the single source of truth for "given a command name, where is the* runnable binary?". It's consumed by BOTH spawn sites:@@ -20,7 +20,8 @@ import { promisify } from 'node:util';const execFilePromise = promisify(execFile);const execPromise = promisify(exec);-export type HeterogeneousCliAgentType = 'amp' | 'claude-code' | 'codex' | 'opencode' | 'pi';+export type HeterogeneousCliAgentType =+ 'amp' | 'claude-code' | 'codex' | 'opencode' | 'pi' | 'qoder';/*** Resolution result. A structural subset of the desktop `BinaryManager`'s@@ -264,6 +265,10 @@ const HETEROGENEOUS_CLI_AGENT_OPTIONS = {// Pi prints a bare semantic version for `--version`.validatePattern: /^v?\d+\.\d+\.\d+(?:[-+][\dA-Za-z.-]+)?$/,},+ 'qoder': {+ // Qoder prints a bare semantic version for `--version`.+ validatePattern: /^v?\d+\.\d+\.\d+(?:[-+][\dA-Za-z.-]+)?$/,+ },} as const satisfies Record<HeterogeneousCliAgentType, ValidateOptions>;// The default (bare) command each agent type is shipped to run. The well-known@@ -275,6 +280,7 @@ export const DEFAULT_HETERO_COMMAND: Record<HeterogeneousCliAgentType, string> ='codex': 'codex','opencode': 'opencode','pi': 'pi',+ 'qoder': 'qodercli',};// Well-known absolute install locations probed when a bare command isn't on@@ -338,6 +344,16 @@ const getWellKnownCommandPaths = (agentType: HeterogeneousCliAgentType): string[path.join(homedir(), 'Library', 'pnpm', 'pi'),];}+ case 'qoder': {+ if (platform() !== 'darwin' && platform() !== 'linux') return [];++ return [+ path.join(homedir(), '.local', 'bin', 'qodercli'),+ path.join(homedir(), '.bun', 'bin', 'qodercli'),+ path.join(homedir(), '.npm-global', 'bin', 'qodercli'),+ path.join(homedir(), 'Library', 'pnpm', 'qodercli'),+ ];+ }default: {return [];}diff --git a/packages/heterogeneous-agents/src/spawn/spawnAgent.test.ts b/packages/heterogeneous-agents/src/spawn/spawnAgent.test.tsindex fc3ba80d85e..e60db7e4a31 100644--- a/packages/heterogeneous-agents/src/spawn/spawnAgent.test.ts+++ b/packages/heterogeneous-agents/src/spawn/spawnAgent.test.ts@@ -181,6 +181,49 @@ describe('spawnAgent', () => {expect(args[resumeIdx + 1]).toBe('cc-prev-123');});+ it('spawns Qoder with its stream-json protocol, permission mode, and resume id', async () => {+ const fake = createFakeProc({ stdoutChunks: [ccInit] });+ nextFakeProc = fake.proc;++ const { spawnAgent } = await import('./spawnAgent');+ const handle = await spawnAgent({+ agentType: 'qoder',+ operationId: 'op-qoder',+ prompt: 'continue with Qoder',+ resumeSessionId: 'qoder-prev-123',+ });+ fake.start();++ for await (const _event of handle.events) {+ // Drain the stream so the adapter captures the session id.+ }+ await handle.exit;++ expect(spawnCalls[0]).toMatchObject({+ command: 'qodercli',+ });+ expect(spawnCalls[0].args).toEqual([+ '-p',+ '--input-format',+ 'stream-json',+ '--output-format',+ 'stream-json',+ '--include-partial-messages',+ '--permission-mode',+ 'bypass_permissions',+ '--resume',+ 'qoder-prev-123',+ ]);+ expect(JSON.parse(fake.stdinWrites[0].trim())).toEqual({+ message: {+ content: [{ text: 'continue with Qoder', type: 'text' }],+ role: 'user',+ },+ parent_tool_use_id: null,+ type: 'user',+ });+ });+it('spawns AMP with its private headless stream-json protocol', async () => {nextFakeProc = createFakeProc().proc;const { spawnAgent } = await import('./spawnAgent');diff --git a/packages/heterogeneous-agents/src/spawn/spawnAgent.ts b/packages/heterogeneous-agents/src/spawn/spawnAgent.tsindex db27992603c..096b4815bd2 100644--- a/packages/heterogeneous-agents/src/spawn/spawnAgent.ts+++ b/packages/heterogeneous-agents/src/spawn/spawnAgent.ts@@ -10,7 +10,7 @@ import type { AgentPromptInput, BuildAgentInputOptions } from './input';import { buildAgentInput } from './input';export interface SpawnAgentOptions {- /** Agent type key (`'amp'` | `'claude-code'` | `'codex'` | `'opencode'` | `'pi'`). */+ /** Agent type key (`'amp'` | `'claude-code'` | `'codex'` | `'opencode'` | `'pi'` | `'qoder'`). */agentType: string;/*** Override the CLI binary name. Defaults to the agent's standard executable.@@ -178,6 +178,16 @@ export const AMP_BASE_ARGS = [export const OPENCODE_BASE_ARGS = ['run', '--format', 'json', '--thinking', '--auto'] as const;export const PI_BASE_ARGS = ['--mode', 'json'] as const;+export const QODER_BASE_ARGS = [+ '-p',+ '--input-format',+ 'stream-json',+ '--output-format',+ 'stream-json',+ '--include-partial-messages',+ '--permission-mode',+ 'bypass_permissions',+] as const;const hasAnyFlag = (args: string[], flags: readonly string[]) =>args.some((arg) => flags.includes(arg as (typeof flags)[number]));@@ -241,6 +251,23 @@ const buildPiArgs = ({ extraArgs, inputArgs, resumeSessionId }: BuildSpawnArgsPa...extraArgs,];+export interface QoderSpawnArgsOptions {+ extraArgs?: string[];+ inputArgs?: string[];+ resumeSessionId?: string;+}++export const buildQoderArgs = ({+ extraArgs = [],+ inputArgs = [],+ resumeSessionId,+}: QoderSpawnArgsOptions): string[] => [+ ...QODER_BASE_ARGS,+ ...(resumeSessionId ? ['--resume', resumeSessionId] : []),+ ...extraArgs,+ ...inputArgs,+];+const buildSpawnArgs = (params: BuildSpawnArgsParams): string[] => {switch (params.agentType) {case 'amp': {@@ -258,6 +285,9 @@ const buildSpawnArgs = (params: BuildSpawnArgsParams): string[] => {case 'pi': {return buildPiArgs(params);}+ case 'qoder': {+ return buildQoderArgs(params);+ }default: {throw new Error(`spawnAgent: unsupported agent type "${params.agentType}"`);}@@ -278,6 +308,9 @@ const defaultCommand = (agentType: string): string => {case 'pi': {return 'pi';}+ case 'qoder': {+ return 'qodercli';+ }default: {return 'claude';}@@ -312,7 +345,7 @@ const killProcessTree = (proc: ChildProcess, signal: NodeJS.Signals): void => {};/**- * Spawn an external agent CLI (Amp, Claude Code, Codex, OpenCode, or Pi) and yield its stream as+ * Spawn an external agent CLI (Amp, Claude Code, Codex, OpenCode, Pi, or Qoder) and yield its stream as* unified `AgentStreamEvent`s. Used by `lh hetero exec` for both standalone* terminal runs and (later) sandbox-driven runs that ingest into the server.*diff --git a/packages/locales/src/default/chat.ts b/packages/locales/src/default/chat.tsindex b4a15a46c57..f912e9038e5 100644--- a/packages/locales/src/default/chat.ts+++ b/packages/locales/src/default/chat.ts@@ -814,6 +814,17 @@ export default {'piInstallGuide.menuNotification.title': 'Pi CLI not found','piInstallGuide.reason': 'LobeHub could not start Pi: {{message}}','piInstallGuide.title': 'Install Pi CLI',+ 'qoderInstallGuide.actions.openDocs': 'Open Install Guide',+ 'qoderInstallGuide.actions.openSystemTools': 'Open System Tools',+ 'qoderInstallGuide.afterInstall':+ 'After installing, run `qodercli login`, then retry your message or click Re-detect in System Tools.',+ 'qoderInstallGuide.desc':+ 'Qoder needs its CLI to run locally. Install it and make sure the qodercli command is available in your PATH.',+ 'qoderInstallGuide.installWithBrew': 'npm install',+ 'qoderInstallGuide.installWithNpm': 'Recommended install',+ 'qoderInstallGuide.menuNotification.title': 'Qoder CLI not found',+ 'qoderInstallGuide.reason': 'LobeHub could not start Qoder: {{message}}',+ 'qoderInstallGuide.title': 'Install Qoder CLI','addAgent': 'Add Agent','addAgentFromList': 'Add from Agent list','addAgentFromMarket': 'Add from Market',@@ -823,6 +834,7 @@ export default {'newCodexAgent': 'Add Codex','newOpenCodeAgent': 'Add OpenCode','newPiAgent': 'Add Pi',+ 'newQoderAgent': 'Add Qoder','newPlatformAgent': 'Connect an Agent','newPlatformAgentDesc': 'Connect Claude Code, Codex, Hermes, OpenClaw, and other agents','newGroupChat': 'Create Group',@@ -908,6 +920,7 @@ export default {'connectAgent.providerDesc.amp': 'Sourcegraph coding agent CLI','connectAgent.providerDesc.opencode': 'Open-source coding agent CLI','connectAgent.providerDesc.pi': 'Minimal coding agent CLI',+ 'connectAgent.providerDesc.qoder': 'Qoder coding agent CLI','connectAgent.providerDesc.openclaw': 'Personal agent platform','connectAgent.providerDesc.hermes': 'Personal agent platform',diff --git a/packages/types/src/agent/agencyConfig.test.ts b/packages/types/src/agent/agencyConfig.test.tsindex 0fba2713ab5..7bb2304894c 100644--- a/packages/types/src/agent/agencyConfig.test.ts+++ b/packages/types/src/agent/agencyConfig.test.ts@@ -79,6 +79,45 @@ describe('buildHeteroSpawnArgs', () => {expect(buildHeteroExecArgs(provider)).toEqual(['--agent-arg=--mode', '--agent-arg=high']);});+ it('forwards Qoder native args and model while leaving effort to the CLI default', () => {+ const provider: HeterogeneousProviderConfig = {+ args: ['--verbose'],+ effort: 'high',+ model: 'qoder-model',+ type: 'qoder',+ };++ expect(buildHeteroSpawnArgs(provider)).toEqual(['--verbose', '--model', 'qoder-model']);+ expect(buildHeteroExecArgs(provider)).toEqual([+ '--agent-arg=--verbose',+ '--model',+ 'qoder-model',+ ]);+ });++ it('preserves a Qoder model from native args and does not inject Default', () => {+ expect(+ buildHeteroSpawnArgs({+ args: ['-m', 'native-model'],+ model: 'selector-model',+ type: 'qoder',+ }),+ ).toEqual(['-m', 'native-model']);+ expect(+ buildHeteroExecArgs({+ args: ['--model=native-model'],+ model: 'selector-model',+ type: 'qoder',+ }),+ ).toEqual(['--agent-arg=--model=native-model']);+ expect(+ buildHeteroSpawnArgs({+ model: HETEROGENEOUS_AGENT_DEFAULT_SELECTION,+ type: 'qoder',+ }),+ ).toBeUndefined();+ });+it('forwards OpenCode native args and an explicit provider/model selection', () => {const provider: HeterogeneousProviderConfig = {args: ['--variant', 'high'],diff --git a/packages/types/src/agent/agencyConfig.ts b/packages/types/src/agent/agencyConfig.tsindex d787421dc4f..29406d10997 100644--- a/packages/types/src/agent/agencyConfig.ts+++ b/packages/types/src/agent/agencyConfig.ts@@ -16,11 +16,13 @@ export type HeterogeneousAgentModelCatalogErrorCode =/** One model reported by a heterogeneous CLI's device-local model catalog. */export interface HeterogeneousAgentModel {- /** Complete provider/model identifier. Treat as opaque when persisting or spawning. */+ /** Exact value accepted by the CLI's model-selection flag. Treat as opaque. */id: string;- /** Everything after the first slash. May itself contain slashes. */+ /** Optional human-readable model label. */+ label?: string;+ /** Model identifier shown when the CLI does not provide a separate display label. */modelId: string;- /** Everything before the first slash, used only for display grouping. */+ /** Provider or CLI family, used only for display grouping. */providerId: string;}@@ -28,7 +30,7 @@ export interface ListHeterogeneousAgentModelsParams {command?: string;cwd?: string;env?: Record<string, string>;- type: 'opencode' | 'pi';+ type: 'opencode' | 'pi' | 'qoder';}export interface HeterogeneousAgentModelCatalogSuccess {@@ -137,7 +139,7 @@ const CODEX_FAST_SERVICE_TIER_VALUES = ['fast', 'priority'] as const;** Two families of hetero agents are supported:*- * - **Local CLI** (`amp` | `claude-code` | `codex` | `opencode` | `pi`): spawned as a child+ * - **Local CLI** (`amp` | `claude-code` | `codex` | `opencode` | `pi` | `qoder`): spawned as a child* process on the desktop or a connected device; uses `command`, `args`, `env`,* `systemContext`.*@@ -189,7 +191,7 @@ export interface HeterogeneousProviderConfig {*/systemContext?: string;/** Agent runtime type. */- type: 'amp' | 'claude-code' | 'codex' | 'hermes' | 'opencode' | 'openclaw' | 'pi';+ type: 'amp' | 'claude-code' | 'codex' | 'hermes' | 'opencode' | 'openclaw' | 'pi' | 'qoder';}interface ClaudeCodeSelectionSource {@@ -210,6 +212,7 @@ const CODEX_MODEL_FLAGS = ['-m', '--model'] as const;const HETERO_EXEC_AGENT_ARG_FLAG = '--agent-arg';const OPENCODE_MODEL_FLAGS = ['-m', '--model'] as const;const PI_MODEL_FLAGS = ['--model'] as const;+const QODER_MODEL_FLAGS = ['-m', '--model'] as const;const hasCliFlag = (args: string[], flag: string): boolean =>args.some((arg) => arg === flag || arg.startsWith(`${flag}=`));@@ -428,8 +431,8 @@ export const codexModelSupportsFastSpeed = (model: string): boolean =>* For `claude-code` and `codex`, the chat-input selector persists explicit* `model` + `effort` selections on the provider config; this is the single* place that maps those stored settings onto provider-specific argv for direct- * local desktop spawns. OpenCode and Pi use their device-local model catalogs- * and forward the selected provider/model id using the native `--model` flag.+ * local desktop spawns. OpenCode, Pi, and Qoder use their device-local model+ * catalogs and forward the selected model using the native `--model` flag.* Missing/default settings are resolved by the UI helpers for display only.* They are not appended here because CLI overrides must not mask each CLI's* own settings/env/account defaults. User-authored `args` win, so there is@@ -447,7 +450,8 @@ export const buildHeteroSpawnArgs = (provider.type !== 'claude-code' &&provider.type !== 'codex' &&provider.type !== 'opencode' &&- provider.type !== 'pi'+ provider.type !== 'pi' &&+ provider.type !== 'qoder') {return provider.args;}@@ -505,6 +509,17 @@ export const buildHeteroSpawnArgs = (}}+ if (provider.type === 'qoder') {+ const model = provider.model?.trim();+ if (+ model &&+ model !== HETEROGENEOUS_AGENT_DEFAULT_SELECTION &&+ !hasAnyCliFlag(baseArgs, QODER_MODEL_FLAGS)+ ) {+ extraArgs.push('--model', model);+ }+ }+if (extraArgs.length === 0) return provider.args;return [...baseArgs, ...extraArgs];};@@ -528,7 +543,8 @@ export const buildHeteroExecArgs = (provider.type !== 'claude-code' &&provider.type !== 'codex' &&provider.type !== 'opencode' &&- provider.type !== 'pi'+ provider.type !== 'pi' &&+ provider.type !== 'qoder') {return provider.args;}@@ -595,6 +611,17 @@ export const buildHeteroExecArgs = (}}+ if (provider.type === 'qoder') {+ const model = provider.model?.trim();+ if (+ model &&+ model !== HETEROGENEOUS_AGENT_DEFAULT_SELECTION &&+ !hasAnyCliFlag(baseArgs, QODER_MODEL_FLAGS)+ ) {+ selectorArgs.push('--model', model);+ }+ }+const args = [...wrapperArgs, ...selectorArgs];return args.length > 0 ? args : undefined;};diff --git a/src/features/ChatInput/ControlBar/HeteroModel.tsx b/src/features/ChatInput/ControlBar/HeteroModel.tsxindex 79173d276fa..de26bca80b5 100644--- a/src/features/ChatInput/ControlBar/HeteroModel.tsx+++ b/src/features/ChatInput/ControlBar/HeteroModel.tsx@@ -54,7 +54,7 @@ import { HeterogeneousAgentModelSelector } from './HeterogeneousAgentModelSelecttype HeteroReasoningEffort =ClaudeCodeReasoningEffort | CodexReasoningEffort | HeterogeneousAgentDefaultSelection;-type SelectableHeteroProviderType = 'claude-code' | 'codex' | 'opencode' | 'pi';+type SelectableHeteroProviderType = 'claude-code' | 'codex' | 'opencode' | 'pi' | 'qoder';const CLAUDE_CODE_MODEL_OPTIONS = [{ label: 'Fable 5', value: 'fable' },@@ -342,7 +342,11 @@ const stripCodexConfigKey = (args: string[] | undefined, key: string): string[]const isSelectableProviderType = (type: HeterogeneousProviderConfig['type'] | undefined,): type is SelectableHeteroProviderType =>- type === 'claude-code' || type === 'codex' || type === 'opencode' || type === 'pi';+ type === 'claude-code' ||+ type === 'codex' ||+ type === 'opencode' ||+ type === 'pi' ||+ type === 'qoder';const getModelLabel = (model: string, defaultLabel: string) => {if (model === HETEROGENEOUS_AGENT_DEFAULT_SELECTION) return defaultLabel;@@ -419,11 +423,11 @@ const HeteroModel = memo(() => {const sourceArgs = nextPatch.args ?? provider?.args;nextPatch.args = stripCodexConfigKey(sourceArgs, CODEX_SERVICE_TIER_CONFIG_KEY);}- } else if (providerType === 'opencode' || providerType === 'pi') {+ } else if (providerType === 'opencode' || providerType === 'pi' || providerType === 'qoder') {if ('model' in patch) {nextPatch.args = stripCliFlags(provider?.args,- providerType === 'opencode' ? ['--model', '-m'] : ['--model', '--provider'],+ providerType === 'pi' ? ['--model', '--provider'] : ['--model', '-m'],);}} else {@@ -487,7 +491,7 @@ const HeteroModel = memo(() => {if (!isSelectableProviderType(provider?.type)) return null;if (!enabled) return null;- if (provider.type === 'opencode' || provider.type === 'pi') {+ if (provider.type === 'opencode' || provider.type === 'pi' || provider.type === 'qoder') {const model =provider.model && provider.model !== HETEROGENEOUS_AGENT_DEFAULT_SELECTION? provider.modeldiff --git a/src/features/ChatInput/ControlBar/HeterogeneousAgentModelSelector.tsx b/src/features/ChatInput/ControlBar/HeterogeneousAgentModelSelector.tsxindex ab59ddb87a6..1b23bfad0c7 100644--- a/src/features/ChatInput/ControlBar/HeterogeneousAgentModelSelector.tsx+++ b/src/features/ChatInput/ControlBar/HeterogeneousAgentModelSelector.tsx@@ -203,7 +203,7 @@ interface HeterogeneousAgentModelSelectorProps {export const HeterogeneousAgentModelSelector = memo<HeterogeneousAgentModelSelectorProps>(({ agentId, disabled, model, onSelect, permissionReason, type }) => {const { t } = useTranslation('chat');- const agentName = type === 'pi' ? 'Pi' : 'OpenCode';+ const agentName = type === 'pi' ? 'Pi' : type === 'qoder' ? 'Qoder' : 'OpenCode';const [search, setSearch] = useState('');const {contentActive,@@ -288,8 +288,8 @@ export const HeterogeneousAgentModelSelector = memo<HeterogeneousAgentModelSelecconst query = search.trim().toLowerCase();return query? all.filter((item) =>- [item.id, item.providerId, item.modelId].some((value) =>- value.toLowerCase().includes(query),+ [item.id, item.label, item.providerId, item.modelId].some(+ (value) => value && value.toLowerCase().includes(query),),): all;@@ -425,7 +425,7 @@ export const HeterogeneousAgentModelSelector = memo<HeterogeneousAgentModelSeleconClick={() => handleSelect(item.id)}><div className={styles.itemBody}>- <div className={styles.itemTitle}>{item.modelId}</div>+ <div className={styles.itemTitle}>{item.label ?? item.modelId}</div><divclassName={cx(styles.itemSubtitle,diff --git a/src/features/ConnectAgent/index.tsx b/src/features/ConnectAgent/index.tsxindex bb62bd2dec0..7b0636c0a4f 100644--- a/src/features/ConnectAgent/index.tsx+++ b/src/features/ConnectAgent/index.tsx@@ -825,7 +825,6 @@ const ConnectAgentContent = memo<ConnectAgentContentProps>(<Text style={{ textAlign: 'center' }} type={'secondary'}>{t('connectAgent.create.noneDetectedHint')}</Text>- <span className={styles.cmd}>npm install -g @anthropic-ai/claude-code</span><Buttonicon={<Icon icon={RefreshCw} size={13} />}size={'small'}diff --git a/src/features/ConnectAgent/providers.ts b/src/features/ConnectAgent/providers.tsindex 03382b2665c..5bd5e20b14e 100644--- a/src/features/ConnectAgent/providers.ts+++ b/src/features/ConnectAgent/providers.ts@@ -5,7 +5,7 @@ import {type RemoteHeterogeneousAgentType,} from '@lobechat/heterogeneous-agents';import { HETEROGENEOUS_AGENT_CLIENT_CONFIGS } from '@lobechat/heterogeneous-agents/client';-import { Amp, ClaudeCode, Codex, HermesAgent, OpenClaw, OpenCode, Pi } from '@lobehub/icons';+import { Amp, ClaudeCode, Codex, HermesAgent, OpenClaw, OpenCode, Pi, Qoder } from '@lobehub/icons';/*** One row in the connect wizard's agent inventory. `kind` mirrors the domain@@ -23,7 +23,8 @@ export interface ConnectableProvider {| typeof HermesAgent| typeof OpenClaw| typeof OpenCode- | typeof Pi;+ | typeof Pi+ | typeof Qoder;/** Spawn command — cli providers only. */command?: string;kind: 'cli' | 'platform';@@ -37,6 +38,7 @@ const CLI_BRANDS: Record<LocalHeterogeneousAgentType, ConnectableProvider['brand'codex': Codex,'opencode': OpenCode,'pi': Pi,+ 'qoder': Qoder,};const PLATFORM_BRANDS: Record<RemoteHeterogeneousAgentType, ConnectableProvider['brand']> = {diff --git a/src/features/Conversation/Error/heterogeneous.ts b/src/features/Conversation/Error/heterogeneous.tsindex 3d5310c4b5e..324d0d3c788 100644--- a/src/features/Conversation/Error/heterogeneous.ts+++ b/src/features/Conversation/Error/heterogeneous.ts@@ -30,7 +30,8 @@ export const isHeterogeneousAgentStatusGuideError = (agentType === 'claude-code' ||agentType === 'codex' ||agentType === 'opencode' ||- agentType === 'pi') &&+ agentType === 'pi' ||+ agentType === 'qoder') &&typeof code === 'string' &&HETEROGENEOUS_AGENT_STATUS_GUIDE_ERROR_CODES.has(code));diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/customInteractionHandlers.test.ts b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/customInteractionHandlers.test.tsindex d9eb825b582..afba22b6bad 100644--- a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/customInteractionHandlers.test.ts+++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/customInteractionHandlers.test.ts@@ -12,6 +12,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest';import { installMarketplaceAgents } from '@/services/installMarketplaceAgents';import {+ isCustomInteractionIdentifier,prepareCustomInteractionSubmit,recordCustomInteractionResolution,} from './customInteractionHandlers';@@ -103,6 +104,10 @@ describe('customInteractionHandlers', () => {});});+ it('routes Qoder tools through the heterogeneous custom interaction flow', () => {+ expect(isCustomInteractionIdentifier('qoder', 'askUserQuestion')).toBe(true);+ });+it('persists skipped marketplace picks from the original tool arguments', async () => {await recordCustomInteractionResolution(WebOnboardingIdentifier,diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/customInteractionHandlers.ts b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/customInteractionHandlers.tsindex 8266ae6e79c..b21645b7b12 100644--- a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/customInteractionHandlers.ts+++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/customInteractionHandlers.ts@@ -15,6 +15,8 @@ import { pickString } from '@lobechat/utils';import { installMarketplaceAgents } from '@/services/installMarketplaceAgents';import { topicService } from '@/services/topic';+const QODER_IDENTIFIER = 'qoder';+interface SubmitToolInteractionOptions {createUserMessage?: boolean;pluginState?: Record<string, unknown>;@@ -161,7 +163,10 @@ const findCustomInteractionSubmitHandler = (identifier: string, apiName?: string* because the answer ships back through IPC, not through a synthetic user* turn.*/-const HETERO_CUSTOM_INTERACTION_IDENTIFIERS = new Set<string>([ClaudeCodeIdentifier]);+const HETERO_CUSTOM_INTERACTION_IDENTIFIERS = new Set<string>([+ ClaudeCodeIdentifier,+ QODER_IDENTIFIER,+]);export const isHeteroInteractionIdentifier = (identifier: string) =>HETERO_CUSTOM_INTERACTION_IDENTIFIERS.has(identifier);diff --git a/src/features/Electron/HeterogeneousAgent/StatusGuide/config.tsx b/src/features/Electron/HeterogeneousAgent/StatusGuide/config.tsxindex d6f9191cf45..195300b3fa5 100644--- a/src/features/Electron/HeterogeneousAgent/StatusGuide/config.tsx+++ b/src/features/Electron/HeterogeneousAgent/StatusGuide/config.tsx@@ -9,8 +9,10 @@ import {OPENCODE_CLI_INSTALL_DOCS_URL,PI_CLI_INSTALL_COMMANDS,PI_CLI_INSTALL_DOCS_URL,+ QODER_CLI_INSTALL_COMMANDS,+ QODER_CLI_INSTALL_DOCS_URL,} from '@lobechat/electron-client-ipc';-import { Amp, ClaudeCode, Codex, OpenCode, Pi } from '@lobehub/icons';+import { Amp, ClaudeCode, Codex, OpenCode, Pi, Qoder } from '@lobehub/icons';import {type HeterogeneousAgentGuideConfig,@@ -59,6 +61,14 @@ export const HETEROGENEOUS_AGENT_GUIDE_CONFIG = {title: 'Pi',translationPrefix: 'piInstallGuide',},+ 'qoder': {+ docsUrl: QODER_CLI_INSTALL_DOCS_URL,+ icon: Qoder,+ installCommands: QODER_CLI_INSTALL_COMMANDS,+ signInCommand: 'qodercli login',+ title: 'Qoder',+ translationPrefix: 'qoderInstallGuide',+ },} as const satisfies Record<SupportedHeterogeneousAgentType, HeterogeneousAgentGuideConfig>;export const isSupportedHeterogeneousAgentType = (diff --git a/src/features/Electron/HeterogeneousAgent/StatusGuide/types.ts b/src/features/Electron/HeterogeneousAgent/StatusGuide/types.tsindex f8eb7554e0f..152220e3634 100644--- a/src/features/Electron/HeterogeneousAgent/StatusGuide/types.ts+++ b/src/features/Electron/HeterogeneousAgent/StatusGuide/types.ts@@ -47,6 +47,7 @@ export const SUPPORTED_HETEROGENEOUS_AGENT_TYPES = ['codex','opencode','pi',+ 'qoder',] as const;export type SupportedHeterogeneousAgentType = (typeof SUPPORTED_HETEROGENEOUS_AGENT_TYPES)[number];diff --git a/src/features/Recommendations/actions/heteroAgent.ts b/src/features/Recommendations/actions/heteroAgent.tsindex eddda241a47..6102e274364 100644--- a/src/features/Recommendations/actions/heteroAgent.ts+++ b/src/features/Recommendations/actions/heteroAgent.ts@@ -1,5 +1,5 @@import type { HeterogeneousAgentClientConfig } from '@lobechat/heterogeneous-agents/client';-import { Amp, ClaudeCode, Codex, OpenCode, Pi } from '@lobehub/icons';+import { Amp, ClaudeCode, Codex, OpenCode, Pi, Qoder } from '@lobehub/icons';import { createElement } from 'react';import type { RecommendedAction } from './types';@@ -10,6 +10,7 @@ const avatarIcons = {'codex': Codex.Avatar,'opencode': OpenCode.Avatar,'pi': Pi.Avatar,+ 'qoder': Qoder.Avatar,} as const satisfies Record<HeterogeneousAgentClientConfig['type'], unknown>;/**diff --git a/src/helpers/executionTarget.test.ts b/src/helpers/executionTarget.test.tsindex 94fe06b94bb..7aba3d8e332 100644--- a/src/helpers/executionTarget.test.ts+++ b/src/helpers/executionTarget.test.ts@@ -30,12 +30,20 @@ const openClawCfg = (over: Partial<LobeAgentAgencyConfig> = {}): LobeAgentAgencyheterogeneousProvider: { type: 'openclaw' },...over,});+const qoderCfg = (over: Partial<LobeAgentAgencyConfig> = {}): LobeAgentAgencyConfig => ({+ heterogeneousProvider: { command: 'qodercli', type: 'qoder' },+ ...over,+});describe('isHeterogeneousSandboxExecutionAvailable', () => {it('keeps notify-based platform agents on local or connected devices', () => {expect(isHeterogeneousSandboxExecutionAvailable('openclaw')).toBe(false);expect(isHeterogeneousSandboxExecutionAvailable('hermes')).toBe(false);});++ it('keeps Qoder on local or connected devices', () => {+ expect(isHeterogeneousSandboxExecutionAvailable('qoder')).toBe(false);+ });});describe('resolveWorkspaceScoped', () => {@@ -176,6 +184,7 @@ describe('resolveExecutionTarget', () => {['Amp', ampCfg],['OpenCode', openCodeCfg],['Pi', piCfg],+ ['Qoder', qoderCfg],] as const)('keeps an unconfigured %s agent pending on web', (_name, providerCfg) => {expect(resolveExecutionTarget(providerCfg(), {@@ -226,6 +235,17 @@ describe('resolveExecutionTarget', () => {}});+ it('normalizes unsupported Qoder sandbox and unbound web-local targets to pending', () => {+ for (const executionTarget of ['sandbox', 'local'] as const) {+ expect(+ resolveExecutionTarget(qoderCfg({ executionTarget }), {+ clientExecutionAvailable: false,+ isHetero: true,+ }),+ ).toBe('none');+ }+ });+it('still routes a bound Amp desktop-local selection to its device on web', () => {expect(resolveExecutionTarget(ampCfg({ boundDeviceId: 'device-a', executionTarget: 'local' }), {diff --git a/src/helpers/executionTarget.ts b/src/helpers/executionTarget.tsindex ffad0ef3374..4919609a30c 100644--- a/src/helpers/executionTarget.ts+++ b/src/helpers/executionTarget.ts@@ -81,7 +81,7 @@ export interface ResolveExecutionTargetOptions {isHetero?: boolean;/*** Whether this heterogeneous provider can execute in the server cloud- * sandbox. Defaults to `false` for Amp, OpenCode, and Pi (which currently+ * sandbox. Defaults to `false` for Amp, OpenCode, Pi, and Qoder (which currently* require a local or connected device) and `true` otherwise. Callers that only* know the provider through a legacy model discriminator can override the* inferred capability.@@ -117,7 +117,8 @@ export const isHeterogeneousSandboxExecutionAvailable = (type: string | undefinetype !== 'hermes' &&type !== 'opencode' &&type !== 'openclaw' &&- type !== 'pi';+ type !== 'pi' &&+ type !== 'qoder';/*** Single source of truth for where an agent executes — one globaldiff --git a/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/index.tsx b/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/index.tsxindex 199a6618d1e..c03e89d6607 100644--- a/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/index.tsx+++ b/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/index.tsx@@ -108,14 +108,15 @@ const HeterogeneousChatInput = memo(() => {!isHeterogeneousSandboxExecutionAvailable(providerType) &&executionTarget === 'none';- // OpenCode and Pi can discover models on an explicit bound device; Claude Code and+ // OpenCode, Pi, and Qoder discover models on a concrete runtime; Claude Code and// Codex show the selector on every execution path (local / sandbox / device)// since dispatch forwards --model/--effort everywhere.const isSelectableHeteroProvider =providerType === 'claude-code' ||providerType === 'codex' ||providerType === 'opencode' ||- providerType === 'pi';+ providerType === 'pi' ||+ providerType === 'qoder';const showHeteroModel =isSelectableHeteroProvider &&shouldShowHeteroModelSelector({diff --git a/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/shouldShowHeteroModelSelector.test.ts b/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/shouldShowHeteroModelSelector.test.tsindex c1ed43f469c..9d80503ea50 100644--- a/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/shouldShowHeteroModelSelector.test.ts+++ b/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/shouldShowHeteroModelSelector.test.ts@@ -100,6 +100,31 @@ describe('shouldShowHeteroModelSelector', () => {).toBe(false);});+ it('shows Qoder models only when a concrete catalog target is available', () => {+ expect(+ shouldShowHeteroModelSelector({+ executionTarget: 'local',+ isDesktopClient: true,+ providerType: 'qoder',+ }),+ ).toBe(true);+ expect(+ shouldShowHeteroModelSelector({+ boundDeviceId: 'remote-device',+ executionTarget: 'device',+ isDesktopClient: false,+ providerType: 'qoder',+ }),+ ).toBe(true);+ expect(+ shouldShowHeteroModelSelector({+ executionTarget: 'auto',+ isDesktopClient: false,+ providerType: 'qoder',+ }),+ ).toBe(false);+ });+it.each([['device', undefined],['auto', 'remote-device'],diff --git a/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/shouldShowHeteroModelSelector.ts b/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/shouldShowHeteroModelSelector.tsindex a8c1c526d91..f6ac1adab0f 100644--- a/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/shouldShowHeteroModelSelector.ts+++ b/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/shouldShowHeteroModelSelector.ts@@ -13,10 +13,10 @@ export const shouldShowHeteroModelSelector = ({isDesktopClient,providerType,}: ShouldShowHeteroModelSelectorParams): boolean => {- // OpenCode and Pi have no cloud-side model list — their selectors need a concrete- // runtime to discover models from: the desktop itself, or an explicit bound- // device that answers listHeterogeneousAgentModels.- if (providerType === 'opencode' || providerType === 'pi') {+ // OpenCode, Pi, and Qoder have no cloud-side model list — their selectors need+ // a concrete runtime to discover models from: the desktop itself, or an explicit+ // bound device that answers listHeterogeneousAgentModels.+ if (providerType === 'opencode' || providerType === 'pi' || providerType === 'qoder') {if (executionTarget === 'local') return isDesktopClient;return executionTarget === 'device' && !!boundDeviceId;}diff --git a/src/routes/(main)/agent/profile/features/ProfileEditor/HeterogeneousAgentStatusCard.tsx b/src/routes/(main)/agent/profile/features/ProfileEditor/HeterogeneousAgentStatusCard.tsxindex 21e2c7b5669..1169e086e03 100644--- a/src/routes/(main)/agent/profile/features/ProfileEditor/HeterogeneousAgentStatusCard.tsx+++ b/src/routes/(main)/agent/profile/features/ProfileEditor/HeterogeneousAgentStatusCard.tsx@@ -237,7 +237,8 @@ const HeterogeneousAgentStatusCard = memo<HeterogeneousAgentStatusCardProps>(provider.type === 'claude-code' ||provider.type === 'codex' ||provider.type === 'opencode' ||- provider.type === 'pi') &&+ provider.type === 'pi' ||+ provider.type === 'qoder') &&!detecting &&!status?.available &&!isUsingCustomCommand;diff --git a/src/store/chat/slices/agentRun/actions/__tests__/conversationLifecycle.test.ts b/src/store/chat/slices/agentRun/actions/__tests__/conversationLifecycle.test.tsindex 4c0349a6fdf..29afc8f7590 100644--- a/src/store/chat/slices/agentRun/actions/__tests__/conversationLifecycle.test.ts+++ b/src/store/chat/slices/agentRun/actions/__tests__/conversationLifecycle.test.ts@@ -1874,6 +1874,78 @@ describe('ConversationLifecycle actions', () => {);});+ it('routes a legacy bare Qoder model to the desktop heterogeneous runtime without gateway mode', async () => {+ mockConstEnv.isDesktop = true;+ setupMockSelectors({ agentConfig: { agencyConfig: undefined, model: 'qoder' } });++ const executeGatewayAgent = vi.fn();+ act(() => {+ useChatStore.setState({+ executeGatewayAgent,+ isGatewayModeEnabled: () => false,+ });+ });++ vi.spyOn(aiChatService, 'sendMessageInServer').mockResolvedValue({+ assistantMessageId: TEST_IDS.ASSISTANT_MESSAGE_ID,+ messages: [+ createMockMessage({ id: TEST_IDS.USER_MESSAGE_ID, role: 'user' }),+ createMockMessage({ id: TEST_IDS.ASSISTANT_MESSAGE_ID, role: 'assistant' }),+ ],+ topicId: TEST_IDS.TOPIC_ID,+ topics: [],+ userMessageId: TEST_IDS.USER_MESSAGE_ID,+ } as any);+ executeHeterogeneousAgentMock.mockResolvedValue(undefined);++ const { result } = renderHook(() => useChatStore());+ await act(async () => {+ await result.current.sendMessage({+ message: TEST_CONTENT.USER_MESSAGE,+ context: createTestContext(),+ });+ });++ expect(executeHeterogeneousAgentMock).toHaveBeenCalledWith(+ expect.any(Function),+ expect.objectContaining({ heterogeneousProvider: { type: 'qoder' } }),+ );+ expect(executeGatewayAgent).not.toHaveBeenCalled();+ expect(result.current.executeClientAgent).not.toHaveBeenCalled();+ });++ it('keeps a legacy bare Qoder model on the gateway when gateway mode is available', async () => {+ mockConstEnv.isDesktop = true;+ setupMockSelectors({ agentConfig: { agencyConfig: undefined, model: 'qoder' } });++ const executeGatewayAgent = vi.fn().mockImplementation(async (params) => {+ useChatStore.getState().completeOperation(params.parentOperationId);+ return {+ assistantMessageId: TEST_IDS.ASSISTANT_MESSAGE_ID,+ operationId: 'gateway-operation',+ userMessageId: TEST_IDS.USER_MESSAGE_ID,+ };+ });+ act(() => {+ useChatStore.setState({+ executeGatewayAgent,+ isGatewayModeEnabled: () => true,+ });+ });++ const { result } = renderHook(() => useChatStore());+ await act(async () => {+ await result.current.sendMessage({+ message: TEST_CONTENT.USER_MESSAGE,+ context: createTestContext(),+ });+ });++ expect(executeGatewayAgent).toHaveBeenCalledTimes(1);+ expect(executeHeterogeneousAgentMock).not.toHaveBeenCalled();+ expect(result.current.executeClientAgent).not.toHaveBeenCalled();+ });+it('runs a workspace Codex local-device override in the desktop heterogeneous runtime', async () => {mockConstEnv.isDesktop = true;setupMockSelectors({diff --git a/src/store/chat/slices/agentRun/actions/entries/conversationLifecycle.ts b/src/store/chat/slices/agentRun/actions/entries/conversationLifecycle.tsindex fc3b135f7ae..aac376ce219 100644--- a/src/store/chat/slices/agentRun/actions/entries/conversationLifecycle.ts+++ b/src/store/chat/slices/agentRun/actions/entries/conversationLifecycle.ts@@ -5,7 +5,7 @@ import {AgentManagementIdentifier,createCallAgentManifest,} from '@lobechat/builtin-tool-agent-management';-import { isDesktop, LOADING_FLAT } from '@lobechat/const';+import { isDesktop, isHeterogeneousAgentModelId, LOADING_FLAT } from '@lobechat/const';import { formatSelectedSkillsContext, formatSelectedToolsContext } from '@lobechat/context-engine';import { isRemoteHeterogeneousType } from '@lobechat/heterogeneous-agents';import { chainCompressContext } from '@lobechat/prompts';@@ -313,12 +313,21 @@ export class ConversationLifecycleActionImpl {visibility: agent?.visibility,workspaceId: agent?.workspaceId,});- const heterogeneousProvider = agencyConfig?.heterogeneousProvider;+ const isGatewayMode = this.#get().isGatewayModeEnabled(agentId);+ // Legacy agents may only carry `model: '<cli-type>'`. Keep gateway routing+ // unchanged when it is available, but recover the provider before the+ // desktop-only local fallback so both runtime selection and the executor+ // receive the same heterogeneous identity.+ const heterogeneousProvider =+ agencyConfig?.heterogeneousProvider ??+ (isDesktop && !isGatewayMode && isHeterogeneousAgentModelId(agentConfig?.model)+ ? { type: agentConfig.model }+ : undefined);const runtimeType = selectRuntimeType({boundDeviceId: agencyConfig?.boundDeviceId,executionTarget: agencyConfig?.executionTarget,heterogeneousProvider,- isGatewayMode: this.#get().isGatewayModeEnabled(agentId),+ isGatewayMode,isWorkspaceAgent: workspaceScoped,// Callers that need to pin the runtime (e.g. task topics that were// started server-side via runTask) pass `forceRuntime` to overridediff --git a/src/store/chat/slices/agentRun/actions/transports/hetero/heterogeneousAgentExecutor.ts b/src/store/chat/slices/agentRun/actions/transports/hetero/heterogeneousAgentExecutor.tsindex bb2c5ffb82c..d10d1ae484e 100644--- a/src/store/chat/slices/agentRun/actions/transports/hetero/heterogeneousAgentExecutor.ts+++ b/src/store/chat/slices/agentRun/actions/transports/hetero/heterogeneousAgentExecutor.ts@@ -11,6 +11,7 @@ import {HeterogeneousAgentSessionErrorCode,OPENCODE_CLI_INSTALL_DOCS_URL,PI_CLI_INSTALL_DOCS_URL,+ QODER_CLI_AUTH_DOCS_URL,} from '@lobechat/electron-client-ipc';import {createMainAgentRunState,@@ -99,9 +100,10 @@ const CLI_AUTH_REQUIRED_PATTERNS = [/no models available/i,] as const;const AMP_AUTH_REQUIRED_PATTERNS = [/please (?:log|sign) in/i, /amp_api_key/i] as const;+const QODER_AUTH_REQUIRED_PATTERNS = [/not logged in/i, /please run \/login/i] as const;const buildCliAuthRequiredSessionError = (- agentType: 'amp' | 'claude-code' | 'codex' | 'opencode' | 'pi',+ agentType: 'amp' | 'claude-code' | 'codex' | 'opencode' | 'pi' | 'qoder',rawMessage: string,): HeterogeneousAgentSessionError => {switch (agentType) {@@ -154,6 +156,15 @@ const buildCliAuthRequiredSessionError = (stderr: rawMessage,};}+ case 'qoder': {+ return {+ agentType,+ code: HeterogeneousAgentSessionErrorCode.AuthRequired,+ docsUrl: QODER_CLI_AUTH_DOCS_URL,+ message: 'Qoder could not authenticate. Run `qodercli login`, then retry.',+ stderr: rawMessage,+ };+ }}};@@ -168,7 +179,8 @@ const maybeClassifyCliAuthRequiredError = (agentType !== 'claude-code' &&agentType !== 'codex' &&agentType !== 'opencode' &&- agentType !== 'pi'+ agentType !== 'pi' &&+ agentType !== 'qoder') {return;}@@ -189,7 +201,9 @@ const maybeClassifyCliAuthRequiredError = (const patterns =agentType === 'amp'? [...CLI_AUTH_REQUIRED_PATTERNS, ...AMP_AUTH_REQUIRED_PATTERNS]- : CLI_AUTH_REQUIRED_PATTERNS;+ : agentType === 'qoder'+ ? [...CLI_AUTH_REQUIRED_PATTERNS, ...QODER_AUTH_REQUIRED_PATTERNS]+ : CLI_AUTH_REQUIRED_PATTERNS;if (!patterns.some((pattern) => pattern.test(message))) return;return buildCliAuthRequiredSessionError(agentType, message);@@ -227,6 +241,9 @@ const getDefaultHeterogeneousCommand = (agentType: string): string => {case 'pi': {return 'pi';}+ case 'qoder': {+ return 'qodercli';+ }default: {return 'claude';}diff --git a/src/store/tool/builtinToolRegistry.test.ts b/src/store/tool/builtinToolRegistry.test.tsindex 0c689f73297..f8ad454699c 100644--- a/src/store/tool/builtinToolRegistry.test.ts+++ b/src/store/tool/builtinToolRegistry.test.ts@@ -1,5 +1,11 @@import { WEB_ONBOARDING } from '@lobechat/builtin-agents';-import { ClaudeCodeIdentifier as ClaudeCodeToolIdentifier } from '@lobechat/builtin-tool-claude-code/client';+import {+ ClaudeCodeIdentifier as ClaudeCodeToolIdentifier,+ ClaudeCodeInspectors,+ ClaudeCodeInterventions,+ ClaudeCodeRenders,+ ClaudeCodeStreamings,+} from '@lobechat/builtin-tool-claude-code/client';import {GroupAgentBuilderApiName,GroupAgentBuilderIdentifier,@@ -21,8 +27,10 @@ import {import { getBuiltinRenderDisplayControl } from '@lobechat/builtin-tools/displayControls';import { builtinToolIdentifiers } from '@lobechat/builtin-tools/identifiers';import { getBuiltinInspector } from '@lobechat/builtin-tools/inspectors';+import { getBuiltinIntervention } from '@lobechat/builtin-tools/interventions';import { registerBuiltinToolSurfaces } from '@lobechat/builtin-tools/register';import { getBuiltinRender } from '@lobechat/builtin-tools/renders';+import { getBuiltinStreaming } from '@lobechat/builtin-tools/streamings';import { beforeAll, describe, expect, it } from 'vitest';describe('builtin tool registry', () => {@@ -58,6 +66,21 @@ describe('builtin tool registry', () => {expect(getBuiltinRenderDisplayControl(ClaudeCodeToolIdentifier, apiName)).toBe('expand');});+ it('registers Claude-compatible surfaces for Qoder', () => {+ for (const [apiName, render] of Object.entries(ClaudeCodeRenders)) {+ expect(getBuiltinRender('qoder', apiName)).toBe(render);+ }+ for (const [apiName, inspector] of Object.entries(ClaudeCodeInspectors)) {+ expect(getBuiltinInspector('qoder', apiName)).toBe(inspector);+ }+ for (const [apiName, streaming] of Object.entries(ClaudeCodeStreamings)) {+ expect(getBuiltinStreaming('qoder', apiName)).toBe(streaming);+ }+ for (const [apiName, intervention] of Object.entries(ClaudeCodeInterventions)) {+ expect(getBuiltinIntervention('qoder', apiName)).toBe(intervention);+ }+ });+it('registers the Codex error inspector', () => {expect(getBuiltinInspector('codex', 'error')).toBeDefined();});@@ -94,6 +117,7 @@ describe('builtin tool registry', () => {expect(getBuiltinRender(ClaudeCodeToolIdentifier, UserInteractionApiName.askUserQuestion),).toBeDefined();+ expect(getBuiltinIntervention('qoder', UserInteractionApiName.askUserQuestion)).toBeDefined();});it('exposes the marketplace APIs under the web onboarding manifest', () => {diff --git a/src/store/tool/slices/builtin/executors/__tests__/heteroCli.test.ts b/src/store/tool/slices/builtin/executors/__tests__/heteroCli.test.tsindex 7f06006794c..06975a4f7ad 100644--- a/src/store/tool/slices/builtin/executors/__tests__/heteroCli.test.ts+++ b/src/store/tool/slices/builtin/executors/__tests__/heteroCli.test.ts@@ -1,6 +1,12 @@import { beforeEach, describe, expect, it, vi } from 'vitest';-import { claudeCodeExecutor, codexExecutor, openCodeExecutor, piExecutor } from '../heteroCli';+import {+ claudeCodeExecutor,+ codexExecutor,+ openCodeExecutor,+ piExecutor,+ qoderExecutor,+} from '../heteroCli';const detectMocks = vi.hoisted(() => ({recordGitCommandEffects: vi.fn(),@@ -31,6 +37,7 @@ describe('heteroCli executors', () => {expect(codexExecutor.identifier).toBe('codex');expect(openCodeExecutor.identifier).toBe('opencode');expect(piExecutor.identifier).toBe('pi');+ expect(qoderExecutor.identifier).toBe('qoder');// Empty apiEnum → never treated as an invokable client tool.expect(claudeCodeExecutor.hasApi('Bash')).toBe(false);expect(claudeCodeExecutor.getApiNames()).toEqual([]);@@ -92,6 +99,21 @@ describe('heteroCli executors', () => {});});+ it('observes Qoder Bash calls for worktree side effects', async () => {+ await qoderExecutor.onAfterCall!(+ call({+ identifier: 'qoder',+ params: { command: 'git worktree add /tmp/qoder-wt' },+ }),+ );++ expect(detectMocks.recordGitCommandEffects).toHaveBeenCalledWith({+ command: 'git worktree add /tmp/qoder-wt',+ resultContent: '',+ topicId: 't1',+ });+ });+it('passes shell output through for branch and PR detection', async () => {await claudeCodeExecutor.onAfterCall!(call({diff --git a/src/store/tool/slices/builtin/executors/catalog.ts b/src/store/tool/slices/builtin/executors/catalog.tsindex fe1d557a5ac..a4c4fd70c10 100644--- a/src/store/tool/slices/builtin/executors/catalog.ts+++ b/src/store/tool/slices/builtin/executors/catalog.ts@@ -20,6 +20,7 @@ import {codexExecutor,openCodeExecutor,piExecutor,+ qoderExecutor,} from './heteroCli';import { activatorExecutor } from './lobe-activator';import { agentDocumentsExecutor } from './lobe-agent-documents';@@ -41,6 +42,7 @@ export const builtinToolExecutors = [codexExecutor,openCodeExecutor,piExecutor,+ qoderExecutor,agentBuilderExecutor,agentDocumentsExecutor,agentManagementExecutor,diff --git a/src/store/tool/slices/builtin/executors/heteroCli.ts b/src/store/tool/slices/builtin/executors/heteroCli.tsindex a8c6087fd74..ffa5daf6f6a 100644--- a/src/store/tool/slices/builtin/executors/heteroCli.ts+++ b/src/store/tool/slices/builtin/executors/heteroCli.ts@@ -9,7 +9,7 @@ import {/*** Hook-only executor for a heterogeneous CLI agent's tool identifier- * (`amp` / `claude-code` / `codex` / `opencode` / `pi` — set by the adapters in+ * (`amp` / `claude-code` / `codex` / `opencode` / `pi` / `qoder` — set by the adapters in* `packages/heterogeneous-agents/src/adapters/*`). These agents run their OWN* tools, so this executor is NEVER invoked: `apiEnum` is empty → `hasApi()` is* always false → the client-tool dispatch (`hasExecutor`) never routes to@@ -95,7 +95,7 @@ class HeteroCliExecutor extends BaseExecutor<typeof EMPTY_API_ENUM> {};}-// AMP's shell tool is `shell_command`; CC's is `Bash`; Codex's is+// AMP's shell tool is `shell_command`; CC and Qoder use `Bash`; Codex's is// `command_execution`; OpenCode and Pi both use `bash`.export const ampExecutor = new HeteroCliExecutor('amp', new Set(['shell_command']));export const claudeCodeExecutor = new HeteroCliExecutor('claude-code', new Set(['Bash']), {@@ -105,3 +105,4 @@ export const claudeCodeExecutor = new HeteroCliExecutor('claude-code', new Set([export const codexExecutor = new HeteroCliExecutor('codex', new Set(['command_execution']));export const openCodeExecutor = new HeteroCliExecutor('opencode', new Set(['bash']));export const piExecutor = new HeteroCliExecutor('pi', new Set(['bash']));+export const qoderExecutor = new HeteroCliExecutor('qoder', new Set(['Bash']));