diff --git a/src/features/mcp-oauth/provider.test.ts b/src/features/mcp-oauth/provider.test.ts index 96b32216e..98a9b3bdc 100644 --- a/src/features/mcp-oauth/provider.test.ts +++ b/src/features/mcp-oauth/provider.test.ts @@ -1,6 +1,7 @@ -import { describe, expect, it, beforeEach, afterEach, mock, afterAll } from "bun:test" +import { describe, expect, it, beforeEach, afterEach, mock } from "bun:test" import { createHash, randomBytes } from "node:crypto" import type { OAuthTokenData } from "./storage" +import { resetDiscoveryCache } from "./discovery" type ProviderModule = typeof import("./provider") @@ -233,6 +234,7 @@ describe("McpOAuthProvider", () => { beforeEach(() => { originalFetch = globalThis.fetch originalEnv = process.env.OPENCODE_CONFIG_DIR + resetDiscoveryCache() const { mkdirSync } = require("node:fs") const { tmpdir } = require("node:os") const { join } = require("node:path") @@ -248,6 +250,7 @@ describe("McpOAuthProvider", () => { } else { process.env.OPENCODE_CONFIG_DIR = originalEnv } + resetDiscoveryCache() }) it("exchanges refresh token and preserves it when the response omits a new one", async () => { diff --git a/src/hooks/ralph-loop/completion-promise-session-negative.test.ts b/src/hooks/ralph-loop/completion-promise-session-negative.test.ts index 4805c4994..7acd7f879 100644 --- a/src/hooks/ralph-loop/completion-promise-session-negative.test.ts +++ b/src/hooks/ralph-loop/completion-promise-session-negative.test.ts @@ -51,14 +51,14 @@ describe("detectCompletionInSessionMessages negative cases", () => { }) describe("#given promise appears outside assistant text parts", () => { - test("#when VERIFIED appears only in tool_result part #then should NOT detect completion", async () => { - // #given + test("#when VERIFIED appears only in non-oracle tool_result part #then should NOT detect completion", async () => { + // #given -- oracle tool_result VERIFIED is detectable (56f2a9df); non-oracle is not const messages = [ { info: { role: "assistant" }, parts: [ - { type: "tool_result", text: 'Task completed.\n\nAgent: oracle\n\nVERIFIED' }, - { type: "text", text: "Oracle verified the task." }, + { type: "tool_result", text: 'Task completed.\n\nAgent: hephaestus\n\nVERIFIED' }, + { type: "text", text: "Hephaestus completed the task." }, ], }, ]