mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-01 14:12:51 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b10dabbd31 |
@@ -0,0 +1,48 @@
|
|||||||
|
import pino from "pino";
|
||||||
|
import { describe, expect, test } from "vitest";
|
||||||
|
|
||||||
|
import { ClaudeAgentClient } from "./agent.js";
|
||||||
|
|
||||||
|
describe("Claude runtime info before a turn", () => {
|
||||||
|
const client = new ClaudeAgentClient({ logger: pino({ level: "silent" }) });
|
||||||
|
|
||||||
|
test("reports the explicitly configured model before the first turn", async () => {
|
||||||
|
const session = await client.createSession({
|
||||||
|
provider: "claude",
|
||||||
|
cwd: process.cwd(),
|
||||||
|
model: "claude-haiku-5-5",
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
expect(await session.getRuntimeInfo()).toMatchObject({ model: "claude-haiku-5-5" });
|
||||||
|
} finally {
|
||||||
|
await session.close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
test("reports the persisted configured model after rebuilding an idle session", async () => {
|
||||||
|
const session = await client.resumeSession({
|
||||||
|
provider: "claude",
|
||||||
|
sessionId: "runtime-model-before-turn",
|
||||||
|
metadata: { cwd: process.cwd(), model: "claude-haiku-5-5" },
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
expect(await session.getRuntimeInfo()).toMatchObject({
|
||||||
|
sessionId: "runtime-model-before-turn",
|
||||||
|
model: "claude-haiku-5-5",
|
||||||
|
});
|
||||||
|
expect((await session.getRuntimeInfo()).model).toBe("claude-haiku-5-5");
|
||||||
|
expect((await session.getRuntimeInfo()).extra?.runtimeModel).toBeUndefined();
|
||||||
|
} finally {
|
||||||
|
await session.close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
test("leaves the model unknown when Claude will choose its default", async () => {
|
||||||
|
const session = await client.createSession({ provider: "claude", cwd: process.cwd() });
|
||||||
|
try {
|
||||||
|
expect((await session.getRuntimeInfo()).model).toBeNull();
|
||||||
|
} finally {
|
||||||
|
await session.close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -2460,7 +2460,7 @@ class ClaudeAgentSession implements AgentSession {
|
|||||||
const info: AgentRuntimeInfo = {
|
const info: AgentRuntimeInfo = {
|
||||||
provider: "claude",
|
provider: "claude",
|
||||||
sessionId: this.claudeSessionId,
|
sessionId: this.claudeSessionId,
|
||||||
model: this.lastOptionsModel,
|
model: this.lastOptionsModel ?? this.config.model ?? null,
|
||||||
modeId: this.currentMode ?? null,
|
modeId: this.currentMode ?? null,
|
||||||
...(this.lastRuntimeModel
|
...(this.lastRuntimeModel
|
||||||
? {
|
? {
|
||||||
|
|||||||
Reference in New Issue
Block a user