Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ function getModelConfigOption(response: {
return response.configOptions?.find((opt) => opt.id === "model");
}

function getEffortConfigOption(response: {
configOptions?: Array<{ id: string; currentValue?: unknown }> | null;
}) {
return response.configOptions?.find((opt) => opt.id === "effort");
}

// Real temp dirs: createSession validates cwd and SettingsManager reads
// settings from disk; CLAUDE_CONFIG_DIR keeps both away from the real home.
const cwd = mkdtempSync(path.join(os.tmpdir(), "claude-agent-test-cwd-"));
Expand Down Expand Up @@ -358,6 +364,21 @@ describe("ClaudeAcpAgent session creation", () => {
}
});

it("does not expose effort controls when a new session starts with Kimi K3", async () => {
const agent = makeAgent();

const response = await agent.newSession({
cwd,
mcpServers: [],
_meta: { taskRunId: "run-kimi", model: "moonshotai/kimi-k3" },
});

expect(getModelConfigOption(response)?.currentValue).toBe(
"moonshotai/kimi-k3",
);
expect(getEffortConfigOption(response)).toBeUndefined();
});

// The timeout *message* (RequestError "... timed out after ...") is covered
// by claude-agent.refresh.test.ts. Here we cover the leak fix on the
// new-session and resume paths: any init failure must close the query so the
Expand Down
1 change: 1 addition & 0 deletions packages/agent/src/adapters/claude/claude-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2252,6 +2252,7 @@ export class ClaudeAcpAgent extends BaseAcpAgent {
settingsManager.getSettings().model,
meta?.model,
]);
modelOptions.currentModelId = resolvedModelId;
session.modelId = resolvedModelId;
session.lastContextWindowSize =
this.getContextWindowForModel(resolvedModelId);
Expand Down
Loading