fix(lint): resolve more ESLint errors for unused variables/imports

- Remove unused imports in test files (manager.test.ts, discord-reply.test.ts)
- Remove unused ThetaPhase import in session/types.ts
- Change unused expiresAt to _expiresAt in session/recovery.ts
- Change unused SEARCH_PROVIDERS to _SEARCH_PROVIDERS in web-search.js
- Remove unused catch parameter _error in codex-reviewer.ts
- Clean up agent-flow.test.ts and githubops.test.ts imports

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Shunsuke Hayashi 2026-01-26 13:02:09 +09:00
parent 4ec77dc3f4
commit 4d4a478758
8 changed files with 6 additions and 82 deletions

View File

@ -3,18 +3,6 @@
*/
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import {
save,
saveFile,
getDownloadUrl,
get,
listBySession,
listByUser,
deleteArtifact,
deleteBySession,
initializeTable,
} from "./manager.js";
import { ArtifactType } from "./types.js";
// AWS SDKモック
vi.mock("@aws-sdk/client-s3");
@ -23,9 +11,6 @@ vi.mock("@aws-sdk/lib-dynamodb");
vi.mock("@aws-sdk/s3-request-presigner");
describe("artifact manager", () => {
const mockSessionId = "test-session-123";
const mockUserId = "user-456";
beforeEach(() => {
vi.clearAllMocks();
});

View File

@ -3,22 +3,11 @@
*/
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { sendReply, createDiscordReply } from "./discord-reply.js";
import { ResponseFormat } from "./types.js";
// Carbonモック
vi.mock("@buape/carbon");
describe("discord-reply", () => {
const mockApi = {
rest: {
post: vi.fn().mockResolvedValue({ id: "new-message-id" }),
},
};
const mockChannelId = "123456789";
const mockMessageId = "987654321";
beforeEach(() => {
vi.clearAllMocks();
});

View File

@ -323,7 +323,7 @@ function buildCodexCommand(
}
},
};
} catch (_error) {
} catch {
// ファイル書き込みエラー時はフォールバック
console.warn("[CodexReviewer] Failed to write temp file, using inline content");
}

View File

@ -3,46 +3,13 @@
*/
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import {
restoreState,
getPendingSessions,
deleteSession,
updateStatus,
cleanupExpiredSessions,
initializeTable,
} from "./manager.js";
import { SessionStatus } from "./types.js";
import type { PersistedSessionState } from "./types.js";
// DynamoDBモック
vi.mock("@aws-sdk/client-dynamodb");
vi.mock("@aws-sdk/lib-dynamodb");
describe("session manager", () => {
const mockSessionId = "test-session-123";
const mockState: PersistedSessionState = {
metadata: {
sessionId: mockSessionId,
userId: "user-123",
channelId: "channel-456",
guildId: "guild-789",
startTime: Date.now(),
lastUpdateTime: Date.now(),
status: SessionStatus.RUNNING,
expiresAt: Math.floor(Date.now() / 1000) + 3600,
},
thetaState: {
runId: "run-123",
startTime: Date.now(),
currentPhase: "θ₁ OBSERVE" as any,
events: [],
context: new Map(),
},
context: {
testKey: "testValue",
},
};
beforeEach(() => {
vi.clearAllMocks();
});

View File

@ -129,7 +129,7 @@ export async function recoverPendingSessions(
* @param ttl - TTL (), デフォルト: 1時間
*/
export async function heartbeatSession(sessionId: string, ttl: number = 3600): Promise<void> {
const expiresAt = Math.floor(Date.now() / 1000) + ttl;
const _expiresAt = Math.floor(Date.now() / 1000) + ttl;
// TODO: UpdateItemでexpiresAtを更新
// 現状のupdateStatus()はlastUpdateTimeのみ更新

View File

@ -4,7 +4,7 @@
* DynamoDBでθサイクルのセッション状態を永続化するための型
*/
import type { ThetaCycleState, ThetaPhase } from "../theta/types.js";
import type { ThetaCycleState } from "../theta/types.js";
/**
*

View File

@ -15,9 +15,7 @@
* - θ (Observe Analyze Decide Allocate Execute Improve)
*/
import { describe, it, expect, beforeAll, beforeEach } from "vitest";
import { readFileSync } from "fs";
import { join } from "path";
import { describe, it, expect } from "vitest";
// Agent definitions based on Miyabi Agent Society
interface Agent {
@ -121,13 +119,6 @@ function executeAgentTask(agentId: string, task: string): ThetaCycleResult {
};
}
function validateDependencies(agentId: string): boolean {
const agent = MIYABI_AGENTS[agentId];
if (!agent) return false;
return agent.dependencies.every((dep) => MIYABI_AGENTS[dep]);
}
function validateHandoff(fromAgent: string, toAgent: string): boolean {
const from = MIYABI_AGENTS[fromAgent];
const to = MIYABI_AGENTS[toAgent];
@ -305,13 +296,6 @@ describe("Agent Flow Integration Tests", () => {
describe("Escalation (エスカレーション)", () => {
it("should escalate to しきるん on failure", () => {
const failureResult: ThetaCycleResult = {
phase: "execute",
agent: "kaede",
status: "blocked",
error: "Technical issue",
};
// Escalate to conductor
const escalation = {
from: "kaede",

View File

@ -8,10 +8,9 @@
* 4. PR creation/review
*/
import { describe, it, expect, beforeAll, afterAll, afterEach, vi } from "vitest";
import { describe, it, expect, beforeAll, afterAll, afterEach } from "vitest";
import { execSync } from "child_process";
import { readFileSync, unlinkSync, existsSync } from "fs";
import { join } from "path";
import { unlinkSync, existsSync } from "fs";
// Test repository configuration
const TEST_REPO = process.env.GITHUBOPS_TEST_REPO || "ShunsukeHayashi/dev-workspace";