chore(lint): remove unused helpers and vars in server tests

This commit is contained in:
Mohamed Boudra
2026-04-24 03:04:12 +07:00
parent f8f0240c7d
commit eabaf3508e
6 changed files with 1 additions and 47 deletions

View File

@@ -52,21 +52,12 @@ describe("OpenCode reasoning events (e2e)", () => {
// Wait for agent to complete
const finalState = await ctx.client.waitForFinish(agent.id, 120_000);
// Log all events
for (let i = 0; i < allEvents.length; i++) {
const { event, timestamp } = allEvents[i];
}
// Group by type
const byType = new Map<string, number>();
for (const { event } of allEvents) {
byType.set(event.type, (byType.get(event.type) ?? 0) + 1);
}
for (const [type, count] of byType) {
}
// Check timeline events breakdown
const timelineEvents = allEvents.filter(({ event }) => event.type === "timeline");
const itemTypes = new Map<string, number>();
@@ -76,9 +67,6 @@ describe("OpenCode reasoning events (e2e)", () => {
}
}
for (const [type, count] of itemTypes) {
}
// Find reasoning events
const reasoningEvents = timelineEvents.filter(
({ event }) => event.type === "timeline" && event.item.type === "reasoning",

View File

@@ -154,17 +154,6 @@ async function collectUntilTerminal(
return events;
}
async function waitForCondition(check: () => boolean, timeoutMs: number): Promise<void> {
const started = Date.now();
while (Date.now() - started < timeoutMs) {
if (check()) {
return;
}
await new Promise((resolve) => setTimeout(resolve, 20));
}
throw new Error("Timed out waiting for condition");
}
beforeEach(() => {
sdkQueryFactory.mockReset();
});

View File

@@ -39,7 +39,7 @@ describe("OpenCode reasoning dedup", () => {
streamedEvents.push(event);
});
const result = await session.run("What is 2+2? Think step by step.");
await session.run("What is 2+2? Think step by step.");
const reasoningTexts: string[] = [];
const assistantTexts: string[] = [];

View File

@@ -82,18 +82,6 @@ async function waitForPathExists(options: {
});
}
async function waitForPathRemoved(options: {
targetPath: string;
timeoutMs: number;
label: string;
}): Promise<void> {
await waitForCondition({
timeoutMs: options.timeoutMs,
label: `removal of ${options.label}: ${options.targetPath}`,
predicate: () => !existsSync(options.targetPath),
});
}
async function waitForCondition(options: {
timeoutMs: number;
label: string;

View File

@@ -18,7 +18,6 @@ import { isProviderAvailable } from "./agent-configs.js";
process.env.PASEO_SUPERVISED = "0";
const PI_TEST_TIMEOUT_MS = 240_000;
const PI_SUITE_TIMEOUT_MS = 600_000;
const PI_REAL_TEST_MODEL = "openrouter/google/gemini-2.5-flash-lite";
type ToolCallItem = Extract<AgentTimelineItem, { type: "tool_call" }>;

View File

@@ -376,16 +376,6 @@ function getFrameText(frame: TerminalStreamFrame): string {
return "";
}
function sendRawTerminalInput(input: { ws: WebSocket; slot: number; text: string }): void {
input.ws.send(
encodeTerminalStreamFrame({
opcode: TerminalStreamOpcode.Input,
slot: input.slot,
payload: new Uint8Array(Buffer.from(input.text, "utf8")),
}),
);
}
async function subscribeRawTerminal(
ws: WebSocket,
terminalId: string,