fix(tui): restore compaction model marker
This commit is contained in:
parent
634386fe0f
commit
76f205d260
13 changed files with 105 additions and 19 deletions
|
|
@ -1126,7 +1126,13 @@ test("tracks session status from active sessions and execution events", async ()
|
|||
created: 0,
|
||||
type: "session.compaction.ended",
|
||||
durable: durable("session-live", 5),
|
||||
data: { sessionID: "session-live", reason: "auto", text: "Live summary", recent: "recent" },
|
||||
data: {
|
||||
sessionID: "session-live",
|
||||
reason: "auto",
|
||||
model: { providerID: "anthropic", id: "claude-sonnet" },
|
||||
text: "Live summary",
|
||||
recent: "recent",
|
||||
},
|
||||
})
|
||||
await wait(() => {
|
||||
const message = data.session.message.get("session-live", "msg_compaction_started")
|
||||
|
|
@ -1135,6 +1141,7 @@ test("tracks session status from active sessions and execution events", async ()
|
|||
expect(data.session.message.get("session-live", "msg_compaction_started")).toMatchObject({
|
||||
type: "compaction",
|
||||
status: "completed",
|
||||
model: { providerID: "anthropic", id: "claude-sonnet" },
|
||||
summary: "Live summary",
|
||||
})
|
||||
expect(rows.find((row) => row.type === "message" && row.messageID === "msg_compaction_started")).toBe(
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { describe, expect, test } from "bun:test"
|
||||
import { formatRef, parse, switchLabel } from "../../src/util/model"
|
||||
import { compactionMarker, formatRef, parse, switchLabel } from "../../src/util/model"
|
||||
|
||||
describe("util.model", () => {
|
||||
test("splits provider from a nested model identifier", () => {
|
||||
|
|
@ -12,6 +12,20 @@ describe("util.model", () => {
|
|||
expect(formatRef({ providerID: "anthropic", id: "sonnet" })).toBe("anthropic/sonnet")
|
||||
})
|
||||
|
||||
test("labels completed compactions with their actual model", () => {
|
||||
const models = [{ providerID: "anthropic", id: "sonnet", name: "Claude Sonnet" }]
|
||||
|
||||
expect(compactionMarker({ providerID: "anthropic", id: "sonnet" }, models)).toEqual({
|
||||
agent: "compaction",
|
||||
model: "Claude Sonnet",
|
||||
})
|
||||
expect(compactionMarker({ providerID: "removed", id: "gone", variant: "high" }, models)).toEqual({
|
||||
agent: "compaction",
|
||||
model: "removed/gone/high",
|
||||
})
|
||||
expect(compactionMarker(undefined, models)).toBeUndefined()
|
||||
})
|
||||
|
||||
test("includes the selected variant in model switch notices", () => {
|
||||
expect(switchLabel({ providerID: "anthropic", id: "sonnet", variant: "thinking" })).toBe(
|
||||
"Switched model to anthropic/sonnet/thinking",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue