Skip to content

The open-source app everyone uses to manage agents at work

Merge upstream/master into add-gpt-5-4-xhigh-effort

Kevin Mok432d7e72fa1e
diff --cc packages/adapters/opencode-local/src/index.ts
index 5f5be6059c,0c16e2d87c..0603630d30
--- a/packages/adapters/opencode-local/src/index.ts
+++ b/packages/adapters/opencode-local/src/index.ts
@@@ -1,14 -1,7 +1,15 @@@
export const type = "opencode_local";
export const label = "OpenCode (local)";
+
-export const models: Array<{ id: string; label: string }> = [];
+export const DEFAULT_OPENCODE_LOCAL_MODEL = "openai/gpt-5.2-codex";
+
- export const models = [
++export const models: Array<{ id: string; label: string }> = [
+ { id: DEFAULT_OPENCODE_LOCAL_MODEL, label: DEFAULT_OPENCODE_LOCAL_MODEL },
+ { id: "openai/gpt-5.4", label: "openai/gpt-5.4" },
+ { id: "openai/gpt-5.2", label: "openai/gpt-5.2" },
+ { id: "openai/gpt-5.1-codex-max", label: "openai/gpt-5.1-codex-max" },
+ { id: "openai/gpt-5.1-codex-mini", label: "openai/gpt-5.1-codex-mini" },
+];
export const agentConfigurationDoc = `# opencode_local agent configuration
@@@ -27,8 -20,8 +28,8 @@@ Don't use when
Core fields:
- cwd (string, optional): default absolute working directory fallback for the agent process (created if missing when possible)
- instructionsFilePath (string, optional): absolute path to a markdown instructions file prepended to the run prompt
- - model (string, optional): OpenCode model id in provider/model format (for example openai/gpt-5.2-codex)
+ - model (string, required): OpenCode model id in provider/model format (for example anthropic/claude-sonnet-4-5)
-- variant (string, optional): provider-specific model variant (for example minimal|low|medium|high|max)
+- variant (string, optional): provider-specific reasoning/profile variant passed as --variant (for example minimal|low|medium|high|xhigh|max)
- promptTemplate (string, optional): run prompt template
- command (string, optional): defaults to "opencode"
- extraArgs (string[], optional): additional CLI args
diff --cc server/src/__tests__/adapter-models.test.ts
index 81be014e32,7ec3f965f1..a6c5eb3584
--- a/server/src/__tests__/adapter-models.test.ts
+++ b/server/src/__tests__/adapter-models.test.ts
@@@ -1,7 -1,7 +1,8 @@@
import { beforeEach, describe, expect, it, vi } from "vitest";
import { models as codexFallbackModels } from "@paperclipai/adapter-codex-local";
import { models as cursorFallbackModels } from "@paperclipai/adapter-cursor-local";
+import { models as opencodeFallbackModels } from "@paperclipai/adapter-opencode-local";
+ import { resetOpenCodeModelsCacheForTests } from "@paperclipai/adapter-opencode-local/server";
import { listAdapterModels } from "../adapters/index.js";
import { resetCodexModelsCacheForTests } from "../adapters/codex-models.js";
import { resetCursorModelsCacheForTests, setCursorModelsRunnerForTests } from "../adapters/cursor-models.js";
@@@ -73,12 -76,6 +77,14 @@@ describe("adapter model listing", () =
expect(models).toEqual(cursorFallbackModels);
});
+ it("returns opencode fallback models including gpt-5.4", async () => {
++ process.env.PAPERCLIP_OPENCODE_COMMAND = "__paperclip_missing_opencode_command__";
++
+ const models = await listAdapterModels("opencode_local");
+
+ expect(models).toEqual(opencodeFallbackModels);
+ });
+
it("loads cursor models dynamically and caches them", async () => {
const runner = vi.fn(() => ({
status: 0,
@@@ -97,4 -94,11 +103,5 @@@
expect(first.some((model) => model.id === "gpt-5.3-codex-high")).toBe(true);
expect(first.some((model) => model.id === "composer-1")).toBe(true);
});
+
- it("returns no opencode models when opencode command is unavailable", async () => {
- process.env.PAPERCLIP_OPENCODE_COMMAND = "__paperclip_missing_opencode_command__";
-
- const models = await listAdapterModels("opencode_local");
- expect(models).toEqual([]);
- });
});
diff --cc server/src/adapters/registry.ts
index 57b057d1e1,9fe536a086..8c56aef9a7
--- a/server/src/adapters/registry.ts
+++ b/server/src/adapters/registry.ts
@@@ -18,21 -18,33 +18,34 @@@ import
} from "@paperclipai/adapter-cursor-local/server";
import { agentConfigurationDoc as cursorAgentConfigurationDoc, models as cursorModels } from "@paperclipai/adapter-cursor-local";
import {
- execute as opencodeExecute,
- testEnvironment as opencodeTestEnvironment,
- sessionCodec as opencodeSessionCodec,
+ execute as openCodeExecute,
+ testEnvironment as openCodeTestEnvironment,
+ sessionCodec as openCodeSessionCodec,
+ listOpenCodeModels,
} from "@paperclipai/adapter-opencode-local/server";
- import { agentConfigurationDoc as opencodeAgentConfigurationDoc, models as opencodeModels } from "@paperclipai/adapter-opencode-local";
import {
- execute as openclawExecute,
- testEnvironment as openclawTestEnvironment,
- } from "@paperclipai/adapter-openclaw/server";
+ agentConfigurationDoc as openCodeAgentConfigurationDoc,
++ models as openCodeModels,
+ } from "@paperclipai/adapter-opencode-local";
import {
- agentConfigurationDoc as openclawAgentConfigurationDoc,
- models as openclawModels,
- } from "@paperclipai/adapter-openclaw";
+ execute as openclawGatewayExecute,
+ testEnvironment as openclawGatewayTestEnvironment,
+ } from "@paperclipai/adapter-openclaw-gateway/server";
+ import {
+ agentConfigurationDoc as openclawGatewayAgentConfigurationDoc,
+ models as openclawGatewayModels,
+ } from "@paperclipai/adapter-openclaw-gateway";
import { listCodexModels } from "./codex-models.js";
import { listCursorModels } from "./cursor-models.js";
+ import {
+ execute as piExecute,
+ testEnvironment as piTestEnvironment,
+ sessionCodec as piSessionCodec,
+ listPiModels,
+ } from "@paperclipai/adapter-pi-local/server";
+ import {
+ agentConfigurationDoc as piAgentConfigurationDoc,
+ } from "@paperclipai/adapter-pi-local";
import { processAdapter } from "./process/index.js";
import { httpAdapter } from "./http/index.js";
@@@ -78,13 -80,35 +81,35 @@@ const cursorLocalAdapter: ServerAdapter
agentConfigurationDoc: cursorAgentConfigurationDoc,
};
- const openclawAdapter: ServerAdapterModule = {
- type: "openclaw",
- execute: openclawExecute,
- testEnvironment: openclawTestEnvironment,
- models: openclawModels,
+ const openclawGatewayAdapter: ServerAdapterModule = {
+ type: "openclaw_gateway",
+ execute: openclawGatewayExecute,
+ testEnvironment: openclawGatewayTestEnvironment,
+ models: openclawGatewayModels,
supportsLocalAgentJwt: false,
- agentConfigurationDoc: openclawAgentConfigurationDoc,
+ agentConfigurationDoc: openclawGatewayAgentConfigurationDoc,
+ };
+
+ const openCodeLocalAdapter: ServerAdapterModule = {
+ type: "opencode_local",
+ execute: openCodeExecute,
+ testEnvironment: openCodeTestEnvironment,
+ sessionCodec: openCodeSessionCodec,
- models: [],
++ models: openCodeModels,
+ listModels: listOpenCodeModels,
+ supportsLocalAgentJwt: true,
+ agentConfigurationDoc: openCodeAgentConfigurationDoc,
+ };
+
+ const piLocalAdapter: ServerAdapterModule = {
+ type: "pi_local",
+ execute: piExecute,
+ testEnvironment: piTestEnvironment,
+ sessionCodec: piSessionCodec,
+ models: [],
+ listModels: listPiModels,
+ supportsLocalAgentJwt: true,
+ agentConfigurationDoc: piAgentConfigurationDoc,
};
const adaptersByType = new Map<string, ServerAdapterModule>(
diff --cc ui/src/components/AgentConfigForm.tsx
index b5a23db410,06cf01d428..004b35c458
--- a/ui/src/components/AgentConfigForm.tsx
+++ b/ui/src/components/AgentConfigForm.tsx
@@@ -130,10 -131,9 +131,10 @@@ const codexThinkingEffortOptions =
{ id: "low", label: "Low" },
{ id: "medium", label: "Medium" },
{ id: "high", label: "High" },
+ { id: "xhigh", label: "X-High" },
] as const;
- const opencodeVariantOptions = [
+ const openCodeThinkingEffortOptions = [
{ id: "", label: "Auto" },
{ id: "minimal", label: "Minimal" },
{ id: "low", label: "Low" },