fix: clean up 49 unused variables, catch params, and stale imports (#22695)
This commit is contained in:
@@ -276,7 +276,7 @@ describe("file/index Filesystem patterns", () => {
|
||||
|
||||
test("returns empty array buffer on error for images", async () => {
|
||||
await using tmp = await tmpdir()
|
||||
const filepath = path.join(tmp.path, "broken.png")
|
||||
const _filepath = path.join(tmp.path, "broken.png")
|
||||
// Don't create the file
|
||||
|
||||
await Instance.provide({
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// Simple JSON-RPC 2.0 LSP-like fake server over stdio
|
||||
// Implements a minimal LSP handshake and triggers a request upon notification
|
||||
|
||||
const net = require("net")
|
||||
|
||||
let nextId = 1
|
||||
|
||||
function encode(message) {
|
||||
|
||||
@@ -2,8 +2,6 @@ import { describe, expect, test } from "bun:test"
|
||||
import { ProviderTransform } from "../../src/provider/transform"
|
||||
import { ModelID, ProviderID } from "../../src/provider/schema"
|
||||
|
||||
const OUTPUT_TOKEN_MAX = 32000
|
||||
|
||||
describe("ProviderTransform.options - setCacheKey", () => {
|
||||
const sessionID = "test-session-123"
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ describe("session.list", () => {
|
||||
await Instance.provide({
|
||||
directory: tmp.path,
|
||||
fn: async () => {
|
||||
const session = await svc.create({ title: "new-session" })
|
||||
await svc.create({ title: "new-session" })
|
||||
const futureStart = Date.now() + 86400000
|
||||
|
||||
const sessions = [...svc.list({ start: futureStart })]
|
||||
|
||||
@@ -1181,7 +1181,6 @@ describe("session.llm.stream", () => {
|
||||
const providerID = "google"
|
||||
const modelID = "gemini-2.5-flash"
|
||||
const fixture = await loadFixture(providerID, modelID)
|
||||
const provider = fixture.provider
|
||||
const model = fixture.model
|
||||
const pathSuffix = `/v1beta/models/${model.id}:streamGenerateContent`
|
||||
|
||||
|
||||
@@ -724,7 +724,7 @@ describe("MessageV2.filterCompacted", () => {
|
||||
|
||||
const u1 = await addUser(session.id, "hello")
|
||||
await addCompactionPart(session.id, u1)
|
||||
const u2 = await addUser(session.id, "world")
|
||||
await addUser(session.id, "world")
|
||||
|
||||
const result = MessageV2.filterCompacted(MessageV2.stream(session.id))
|
||||
expect(result).toHaveLength(2)
|
||||
@@ -748,7 +748,7 @@ describe("MessageV2.filterCompacted", () => {
|
||||
isRetryable: true,
|
||||
}).toObject() as MessageV2.Assistant["error"]
|
||||
await addAssistant(session.id, u1, { summary: true, finish: "end_turn", error })
|
||||
const u2 = await addUser(session.id, "retry")
|
||||
await addUser(session.id, "retry")
|
||||
|
||||
const result = MessageV2.filterCompacted(MessageV2.stream(session.id))
|
||||
// Error assistant doesn't add to completed, so compaction boundary never triggers
|
||||
@@ -770,7 +770,7 @@ describe("MessageV2.filterCompacted", () => {
|
||||
|
||||
// summary=true but no finish
|
||||
await addAssistant(session.id, u1, { summary: true })
|
||||
const u2 = await addUser(session.id, "next")
|
||||
await addUser(session.id, "next")
|
||||
|
||||
const result = MessageV2.filterCompacted(MessageV2.stream(session.id))
|
||||
expect(result).toHaveLength(3)
|
||||
@@ -892,7 +892,7 @@ describe("MessageV2 consistency", () => {
|
||||
directory: root,
|
||||
fn: async () => {
|
||||
const session = await svc.create({})
|
||||
const ids = await fill(session.id, 4)
|
||||
await fill(session.id, 4)
|
||||
|
||||
const filtered = MessageV2.filterCompacted(MessageV2.stream(session.id))
|
||||
const all = Array.from(MessageV2.stream(session.id)).reverse()
|
||||
|
||||
Reference in New Issue
Block a user