fix(composer): match effort options to adapter execution (#14576)

## Thinking Path

> - Paperclip is an open source control plane for AI agents.
> - The issue composer lets operators choose a model and effort for a
task message.
> - The picker must show only effort levels that the selected adapter
can execute.
> - The Codex Runner fix in #14568 exposed similar gaps in other
adapters.
> - Grok hid a supported control. Claude used one range for all models.
Kimi ACP showed a control that it ignored.
> - This pull request aligns the picker with each adapter and adds
matching stories.
> - Operators can see and save supported effort settings without false
controls.

## Linked Issues or Issue Description

**What happened?**

The composer hid Grok effort. It showed an incomplete effort range for
some Claude models and a slider for Claude Haiku. It showed Kimi effort
on the default ACP engine even though that engine drops the value.

**Expected behavior**

The composer should show only effort levels supported by the selected
model and execution engine. Grok effort should reach its adapter as
`reasoningEffort`.

**Steps to reproduce**

1. Select a Grok agent and `grok-4.7`. Observe that the picker has no
effort slider.
2. Select Claude Sonnet 5 or Haiku 4.5. Observe the generic low to high
slider.
3. Select a Kimi agent on ACP. Observe the slider even though ACP
ignores effort.

Related fix: #14568.

## What Changed

- Use Claude and Grok adapter capability helpers in the production
picker and Storybook preview.
- Map Grok composer effort to `reasoningEffort` in per-message
overrides.
- Show Kimi effort only when its agent uses the CLI engine, including
when it runs its default model.
- Show Grok effort when it runs its default model.
- Add design and production stories for Claude, Grok, and Kimi ACP and
CLI cases.
- Document the picker rules and add focused tests.

## Verification

- `pnpm --filter @paperclipai/ui exec vitest run
src/components/task-chat/composer-run-settings.test.ts`
- `pnpm --filter @paperclipai/ui typecheck`
- `pnpm check:token-gates`
- `pnpm -r typecheck`, `pnpm test:run`, and `pnpm build` passed on the
first commit.
- The focused test, UI typecheck, token check, and Storybook build
passed again after the review fixes.
- Browser smoke: production stories show effort for default Grok and CLI
Kimi, and hide it for ACP Kimi and Claude Haiku.

## Risks

- Existing Kimi ACP agents lose a slider that could not change
execution. Their stored effort override remains unchanged until the next
edit.
- Claude and Grok ranges follow their adapter catalogs. A provider can
change model support before the catalog is updated.

## Model Used

OpenAI Codex based on GPT-6. The exact runtime model ID and context
window are not exposed in this session. Reasoning, tool use, and code
execution were used.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip authored and GitHub committed 2026-09-29 10:34:29 -05:00
1 parent 83076d7e7c
commit 29c8fb0b66
6 files changed
+164 -20

No files matched your search

+4
View File
@@ -117,6 +117,10 @@ choices. Codex uses the curated adapter catalog unless the instance declares
`PAPERCLIP_ADAPTER_MODELS`; general OpenAI API models are not Codex choices.
The Paperclip Runner Codex profile shows the same known model effort levels.
Its selected effort is saved with the run and sent to Codex for each turn.
Claude Code uses model-specific effort levels; Haiku has no effort slider.
Grok uses its adapter's reasoning levels, including for its default model.
Kimi shows effort only when its agent uses the CLI engine, including with its
default model, because the default ACP engine ignores effort.
The Storybook visual regression suite uses external PNG baselines instead of
committed screenshots:
@@ -16,7 +16,14 @@ describe("composer run settings", () => {
expect(composerEfforts(agent("paperclip_runner", "opencode"), "gpt-6-astra", [])).toEqual([]);
expect(composerEfforts(agent("codex_local"), "custom-private-model", [])).toEqual([]);
expect(composerEfforts(agent("opencode_local"), "openrouter/x/y", ["openrouter/x/y"])).toEqual([]);
expect(composerEfforts(agent("kimi_local"), "kimi-code/k3", ["kimi-code/k3"])).toEqual(["low", "high", "max"]);
expect(composerEfforts(agent("claude_local"), "claude-sonnet-5", ["claude-sonnet-5"])).toEqual(["low", "medium", "high", "xhigh", "max"]);
expect(composerEfforts(agent("claude_local"), "claude-haiku-4-5", ["claude-haiku-4-5"])).toEqual([]);
expect(composerEfforts(agent("grok_local"), "grok-4.7", ["grok-4.7"])).toEqual(["low", "medium", "high", "xhigh"]);
expect(composerEfforts(agent("grok_local"), "grok-4.7", [])).toEqual([]);
expect(composerEfforts(agent("grok_local"), "", ["grok-build"])).toEqual(["low", "medium", "high"]);
expect(composerEfforts(agent("kimi_local"), "kimi-code/k3", ["kimi-code/k3"])).toEqual([]);
expect(composerEfforts({ ...agent("kimi_local"), adapterConfig: { engine: "cli" } }, "kimi-code/k3", ["kimi-code/k3"])).toEqual(["low", "high", "max"]);
expect(composerEfforts({ ...agent("kimi_local"), adapterConfig: { engine: " CLI " } }, "", ["kimi-code/kimi-for-coding"])).toEqual(["low", "high", "max"]);
expect(composerEfforts(agent("kimi_local"), "kimi-code/kimi-for-coding-highspeed", ["kimi-code/kimi-for-coding-highspeed"])).toEqual([]);
expect(composerFastAvailable(agent("codex_local"), "gpt-6-astra")).toBe(true);
expect(composerFastAvailable(agent("codex_local"), "custom-private-model")).toBe(false);
@@ -37,5 +44,8 @@ describe("composer run settings", () => {
const runner = mergeComposerRunSettings(null, "paperclip_runner", { model: "gpt-6-astra", effort: "ultra", fast: false });
expect(runner).toEqual({ adapterConfig: { model: "gpt-6-astra", modelReasoningEffort: "ultra" } });
expect(readComposerRunSettings(runner, "paperclip_runner").effort).toBe("ultra");
const grok = mergeComposerRunSettings(null, "grok_local", { model: "grok-4.7", effort: "xhigh", fast: false });
expect(grok).toEqual({ adapterConfig: { model: "grok-4.7", reasoningEffort: "xhigh" } });
expect(readComposerRunSettings(grok, "grok_local").effort).toBe("xhigh");
});
});
@@ -1,5 +1,7 @@
import { codexLocalReasoningEffortsForModel, isCodexLocalFastModeSupported, isCodexLocalKnownModel } from "@paperclipai/adapter-codex-local";
import { modelSupportsEffort, KIMI_SUPPORTED_EFFORTS } from "@paperclipai/adapter-kimi-local";
import { claudeLocalReasoningEffortsForModel } from "@paperclipai/adapter-claude-local";
import { DEFAULT_GROK_LOCAL_MODEL, grokLocalReasoningEffortsForModel } from "@paperclipai/adapter-grok-local";
import { DEFAULT_KIMI_LOCAL_MODEL, modelSupportsEffort, KIMI_SUPPORTED_EFFORTS } from "@paperclipai/adapter-kimi-local";
import { aiConnectionBindingSchema, type Agent, type IssueAssigneeAdapterOverrides } from "@paperclipai/shared";
export interface ComposerRunSettings {
@@ -34,14 +36,19 @@ export function composerCatalogProvider(agent: Agent | undefined): string | unde
}
export function composerEfforts(agent: Agent | undefined, model: string, catalogIds: readonly string[]): readonly string[] {
if (!agent || !model) return [];
if (!agent) return [];
const effectiveModel = model.trim() || (agent.adapterType === "grok_local" ? DEFAULT_GROK_LOCAL_MODEL
: agent.adapterType === "kimi_local" ? DEFAULT_KIMI_LOCAL_MODEL : "");
if (!effectiveModel) return [];
if (agent.adapterType === "codex_local" || (agent.adapterType === "paperclip_runner" && composerCatalogProvider(agent) === "codex")) {
return isCodexLocalKnownModel(model) ? codexLocalReasoningEffortsForModel(model) : [];
return isCodexLocalKnownModel(effectiveModel) ? codexLocalReasoningEffortsForModel(effectiveModel) : [];
}
if (!catalogIds.includes(model)) return [];
if (agent.adapterType === "claude_local") return ["low", "medium", "high"];
if (!catalogIds.includes(effectiveModel)) return [];
if (agent.adapterType === "claude_local") return claudeLocalReasoningEffortsForModel(effectiveModel);
if (agent.adapterType === "grok_local") return grokLocalReasoningEffortsForModel(effectiveModel);
if (agent.adapterType === "pi_local") return ["off", "minimal", "low", "medium", "high", "xhigh"];
if (agent.adapterType === "kimi_local" && modelSupportsEffort(model)) return KIMI_SUPPORTED_EFFORTS;
if (agent.adapterType === "kimi_local" && typeof agent.adapterConfig.engine === "string"
&& agent.adapterConfig.engine.trim().toLowerCase() === "cli" && modelSupportsEffort(effectiveModel)) return KIMI_SUPPORTED_EFFORTS;
return [];
}
@@ -64,6 +71,7 @@ export function readComposerRunSettings(overrides: IssueAssigneeAdapterOverrides
function composerEffortKey(adapterType: string | undefined): string | null {
if (adapterType === "codex_local" || adapterType === "paperclip_runner") return "modelReasoningEffort";
if (adapterType === "claude_local" || adapterType === "kimi_local") return "effort";
if (adapterType === "grok_local") return "reasoningEffort";
if (adapterType === "pi_local") return "thinking";
if (adapterType === "opencode_local") return "variant";
return null;
@@ -16,6 +16,7 @@ const agents = new Map(composerAgents.map((fixture) => [fixture.id, {
adapterConfig: {
...(fixture.defaultModel ? { model: fixture.defaultModel } : {}),
...(fixture.provider === "OpenRouter" ? { provider: "openrouter" } : {}),
...(fixture.engine ? { engine: fixture.engine } : {}),
},
defaultEnvironmentId: null,
} as Agent]));
@@ -1,5 +1,7 @@
import { codexLocalReasoningEffortsForModel, isCodexLocalFastModeSupported, isCodexLocalKnownModel } from "@paperclipai/adapter-codex-local";
import { modelSupportsEffort, KIMI_SUPPORTED_EFFORTS } from "@paperclipai/adapter-kimi-local";
import { claudeLocalReasoningEffortsForModel } from "@paperclipai/adapter-claude-local";
import { DEFAULT_GROK_LOCAL_MODEL, grokLocalReasoningEffortsForModel } from "@paperclipai/adapter-grok-local";
import { DEFAULT_KIMI_LOCAL_MODEL, modelSupportsEffort, KIMI_SUPPORTED_EFFORTS } from "@paperclipai/adapter-kimi-local";
import { AGENT_PALETTE_IDS, appearanceForPalette } from "@paperclipai/shared";
export type ModelOption = { id: string; label: string; detail?: string };
@@ -10,6 +12,7 @@ export type ComposerAgent = {
harness: string;
adapterType: string;
provider?: string;
engine?: string;
defaultModel?: string;
defaultLabel?: string;
models: ModelOption[];
@@ -42,7 +45,7 @@ export const composerAgents: ComposerAgent[] = [
{ id: "openrouter/anthropic/claude-sonnet-4.6", label: "Claude Sonnet 4.6", detail: "OpenRouter" },
{ id: "openai/gpt-5.6-sol", label: "GPT-5.6 Sol", detail: "OpenAI" },
], manualPattern: "provider/model" },
{ id: "kimi", name: "Kimi", role: "Planning", harness: "Kimi Code", adapterType: "kimi_local", provider: "CLI engine", defaultModel: "kimi-code/k3", models: [
{ id: "kimi", name: "Kimi", role: "Planning", harness: "Kimi Code", adapterType: "kimi_local", provider: "CLI engine", engine: "cli", defaultModel: "kimi-code/k3", models: [
{ id: "kimi-code/k3", label: "K3", detail: "Supports effort on CLI" },
{ id: "kimi-code/kimi-for-coding", label: "K2.8 Preview", detail: "Supports effort on CLI" },
{ id: "kimi-code/kimi-for-coding-highspeed", label: "K2.7 Coding Highspeed", detail: "Uses model default" },
@@ -60,12 +63,29 @@ export const composerAgents: ComposerAgent[] = [
], manualPattern: "Cursor model ID" },
{ id: "cursor-cloud", name: "Cloudy", role: "Remote engineering", harness: "Cursor Cloud", adapterType: "cursor_cloud", defaultLabel: "Account default", models: [], manualPattern: "Cursor Cloud model ID" },
{ id: "runner", name: "Runa", role: "Operations", harness: "Paperclip Runner", adapterType: "paperclip_runner", provider: "Codex profile", defaultModel: "gpt-5.6-sol", models: codexModels, manualPattern: "Codex model ID" },
{ id: "grok", name: "Grok", role: "Investigation", harness: "Grok CLI", adapterType: "grok_local", defaultModel: "grok-build", models: [{ id: "grok-build", label: "Grok Build" }], manualPattern: "Grok model ID" },
{ id: "grok", name: "Grok", role: "Investigation", harness: "Grok CLI", adapterType: "grok_local", defaultModel: "grok-build", models: [
{ id: "grok-build", label: "Grok Build" },
{ id: "grok-4.7", label: "Grok 4.7" },
{ id: "grok-4.6", label: "Grok 4.6" },
{ id: "grok-4.5", label: "Grok 4.5" },
], manualPattern: "Grok model ID" },
{ id: "hermes", name: "Hermes", role: "Operations", harness: "Hermes CLI", adapterType: "hermes_local", defaultModel: "auto", models: [{ id: "auto", label: "Auto" }], manualPattern: "Hermes model ID" },
{ id: "process", name: "Relay", role: "Automation", harness: "Process", adapterType: "process", models: [], noModelReason: "This agent runs a command. Its harness does not expose a model or effort setting." },
{ id: "http", name: "Hook", role: "Integration", harness: "HTTP", adapterType: "http", models: [], noModelReason: "This agent calls an HTTP endpoint. The destination service chooses its model." },
{ id: "openclaw", name: "Ollie", role: "Support", harness: "OpenClaw Gateway", adapterType: "openclaw_gateway", models: [], noModelReason: "This gateway chooses its model remotely; Paperclip has no model catalog or per-message setting for it." },
{ id: "hermes-gateway", name: "Hera", role: "Remote operations", harness: "Hermes Gateway", adapterType: "hermes_gateway", models: [], noModelReason: "This Hermes gateway chooses its model remotely; Paperclip cannot override it here." },
{ id: "kimi-acp", name: "Kima", role: "Planning", harness: "Kimi Code", adapterType: "kimi_local", provider: "ACP engine", engine: "acp", defaultModel: "kimi-code/k3", models: [
{ id: "kimi-code/k3", label: "K3" },
{ id: "kimi-code/kimi-for-coding", label: "K2.8 Preview" },
], manualPattern: "kimi-code/model" },
{ id: "grok-default", name: "Grok Default", role: "Investigation", harness: "Grok CLI", adapterType: "grok_local", models: [
{ id: "grok-build", label: "Grok Build" },
{ id: "grok-4.7", label: "Grok 4.7" },
], manualPattern: "Grok model ID" },
{ id: "kimi-cli-default", name: "Kimi Default", role: "Planning", harness: "Kimi Code", adapterType: "kimi_local", provider: "CLI engine", engine: " CLI ", models: [
{ id: "kimi-code/kimi-for-coding", label: "K2.8 Preview" },
{ id: "kimi-code/k3", label: "K3" },
], manualPattern: "kimi-code/model" },
];
/** Share the capsule-avatar palettes used by the agent persona stories. */
@@ -79,11 +99,14 @@ export const effortLabels: Record<string, string> = {
};
export function effortChoices(agent: ComposerAgent, model: string): readonly string[] {
if (agent.adapterType === "codex_local" || agent.id === "runner") return isCodexLocalKnownModel(model) ? codexLocalReasoningEffortsForModel(model) : [];
if (!agent.models.some((option) => option.id === model)) return [];
if (agent.adapterType === "claude_local") return ["low", "medium", "high"];
const effectiveModel = model.trim() || (agent.adapterType === "grok_local" ? DEFAULT_GROK_LOCAL_MODEL
: agent.adapterType === "kimi_local" ? DEFAULT_KIMI_LOCAL_MODEL : "");
if (agent.adapterType === "codex_local" || agent.id === "runner") return isCodexLocalKnownModel(effectiveModel) ? codexLocalReasoningEffortsForModel(effectiveModel) : [];
if (!agent.models.some((option) => option.id === effectiveModel)) return [];
if (agent.adapterType === "claude_local") return claudeLocalReasoningEffortsForModel(effectiveModel);
if (agent.adapterType === "grok_local") return grokLocalReasoningEffortsForModel(effectiveModel);
if (agent.adapterType === "pi_local") return ["off", "minimal", "low", "medium", "high", "xhigh"];
if (agent.adapterType === "kimi_local" && modelSupportsEffort(model)) return KIMI_SUPPORTED_EFFORTS;
if (agent.adapterType === "kimi_local" && agent.engine?.trim().toLowerCase() === "cli" && modelSupportsEffort(effectiveModel)) return KIMI_SUPPORTED_EFFORTS;
// The current model API only returns id/label. OpenCode/OpenRouter variants are
// model-specific, so a guessed generic slider would send unsupported values.
return [];
@@ -75,8 +75,21 @@ export const ResetToAgentDefault: Story = {
},
};
export const Claude: Story = {
name: "07 · Claude Code · low to high",
args: { agentId: "claude", initialPanel: "settings", initialEffort: "medium" },
name: "07 · Claude Sonnet 5 · full effort range",
args: { agentId: "claude", initialPanel: "settings", initialEffort: "max" },
play: async ({ canvasElement }) => {
const screen = within(canvasElement.ownerDocument.body);
await expect(screen.getByRole("slider", { name: "Effort" })).toBeVisible();
await expect(screen.getByTestId("selected-effort")).toHaveTextContent("Max");
},
};
export const ClaudeHaiku: Story = {
name: "07b · Claude Haiku · no effort override",
args: { agentId: "claude", initialModel: "claude-haiku-4-5", initialPanel: "settings" },
play: async ({ canvasElement }) => {
const screen = within(canvasElement.ownerDocument.body);
await expect(screen.queryByRole("slider")).toBeNull();
},
};
export const OpenRouterSearch: Story = {
name: "08 · OpenRouter · search this provider",
@@ -116,9 +129,25 @@ export const PiThinking: Story = {
args: { agentId: "pi", initialPanel: "settings", initialEffort: "high" },
};
export const KimiSupported: Story = {
name: "12 · Kimi K3 · low, high, max",
name: "12 · Kimi CLI K3 · low, high, max",
args: { agentId: "kimi", initialPanel: "settings", initialEffort: "high" },
};
export const KimiAcpNoEffort: Story = {
name: "12b · Kimi ACP K3 · no effort override",
args: { agentId: "kimi-acp", initialPanel: "settings" },
play: async ({ canvasElement }) => {
const screen = within(canvasElement.ownerDocument.body);
await expect(screen.queryByRole("slider")).toBeNull();
},
};
export const KimiCliDefaultEffort: Story = {
name: "12c · Kimi CLI default model · effort",
args: { agentId: "kimi-cli-default", initialPanel: "settings" },
play: async ({ canvasElement }) => {
const screen = within(canvasElement.ownerDocument.body);
await expect(screen.getByRole("slider", { name: "Effort" })).toBeVisible();
},
};
export const KimiModelDefault: Story = {
name: "13 · Kimi highspeed · no effort override",
args: { agentId: "kimi", initialModel: "kimi-code/kimi-for-coding-highspeed", initialPanel: "settings" },
@@ -143,9 +172,22 @@ export const RunnerCodexEffort: Story = {
name: "16b · Runner · Codex effort",
args: { agentId: "runner", initialPanel: "settings", initialModel: "gpt-6-astra", initialEffort: "high" },
};
export const GrokModelOnly: Story = {
name: "17 · Grok · model only",
args: { agentId: "grok", initialPanel: "settings" },
export const GrokEffort: Story = {
name: "17 · Grok 4.7 · reasoning effort",
args: { agentId: "grok", initialPanel: "settings", initialModel: "grok-4.7", initialEffort: "xhigh" },
play: async ({ canvasElement }) => {
const screen = within(canvasElement.ownerDocument.body);
await expect(screen.getByRole("slider", { name: "Effort" })).toBeVisible();
await expect(screen.getByTestId("selected-effort")).toHaveTextContent("Extra High");
},
};
export const GrokDefaultEffort: Story = {
name: "17a · Grok default model · reasoning effort",
args: { agentId: "grok-default", initialPanel: "settings" },
play: async ({ canvasElement }) => {
const screen = within(canvasElement.ownerDocument.body);
await expect(screen.getByRole("slider", { name: "Effort" })).toBeVisible();
},
};
export const HermesManual: Story = {
name: "17b · Hermes CLI · manual model ID",
@@ -264,6 +306,62 @@ export const ProductionRunnerCodexEffort: Story = {
},
};
export const ProductionClaudeEffort: Story = {
name: "23aa · App Claude Sonnet 5 effort",
render: () => <ComposerRunSettingsLiveStory agentId="claude" initialPanel="settings" initialEffort="max" />,
play: async ({ canvasElement }) => {
const screen = within(canvasElement.ownerDocument.body);
await expect(screen.getByRole("slider", { name: "Effort" })).toBeVisible();
await expect(screen.getByTestId("selected-effort")).toHaveTextContent("Max");
},
};
export const ProductionGrokEffort: Story = {
name: "23ab · App Grok 4.7 effort",
render: () => <ComposerRunSettingsLiveStory agentId="grok" initialPanel="settings" initialModel="grok-4.7" initialEffort="xhigh" />,
play: async ({ canvasElement }) => {
const screen = within(canvasElement.ownerDocument.body);
await expect(screen.getByRole("slider", { name: "Effort" })).toBeVisible();
await expect(screen.getByTestId("selected-effort")).toHaveTextContent("Extra High");
},
};
export const ProductionGrokDefaultEffort: Story = {
name: "23aba · App Grok default model effort",
render: () => <ComposerRunSettingsLiveStory agentId="grok-default" initialPanel="settings" />,
play: async ({ canvasElement }) => {
const screen = within(canvasElement.ownerDocument.body);
await expect(screen.getByRole("slider", { name: "Effort" })).toBeVisible();
},
};
export const ProductionKimiAcpNoEffort: Story = {
name: "23ac · App Kimi ACP without effort",
render: () => <ComposerRunSettingsLiveStory agentId="kimi-acp" initialPanel="settings" />,
play: async ({ canvasElement }) => {
const screen = within(canvasElement.ownerDocument.body);
await expect(screen.queryByRole("slider")).toBeNull();
},
};
export const ProductionKimiCliEffort: Story = {
name: "23ad · App Kimi CLI effort",
render: () => <ComposerRunSettingsLiveStory agentId="kimi" initialPanel="settings" initialEffort="high" />,
play: async ({ canvasElement }) => {
const screen = within(canvasElement.ownerDocument.body);
await expect(screen.getByRole("slider", { name: "Effort" })).toBeVisible();
},
};
export const ProductionKimiCliDefaultEffort: Story = {
name: "23ada · App Kimi CLI default model effort",
render: () => <ComposerRunSettingsLiveStory agentId="kimi-cli-default" initialPanel="settings" />,
play: async ({ canvasElement }) => {
const screen = within(canvasElement.ownerDocument.body);
await expect(screen.getByRole("slider", { name: "Effort" })).toBeVisible();
},
};
export const ProductionMobileComposer: Story = {
name: "23b · App picker on mobile",
render: () => <ComposerRunSettingsLiveStory initialPanel="settings" mobile compact />,