fix: stabilize onboarding auth tests (#703) (thanks @mteam88)

This commit is contained in:
Peter Steinberger
2026-01-11 03:42:27 +01:00
parent 77bc11f91c
commit 2b07a2a8ab
3 changed files with 9 additions and 5 deletions

View File

@@ -52,7 +52,7 @@ function installFailingFetchCapture() {
}
describe("openai-responses reasoning replay", () => {
it("replays reasoning for tool-call-only turns (required by OpenAI)", async () => {
it("skips reasoning for tool-call-only turns (OpenAI rejects standalone reasoning)", async () => {
const cap = installFailingFetchCapture();
try {
const model = buildModel();
@@ -141,11 +141,8 @@ describe("openai-responses reasoning replay", () => {
)
.filter((t): t is string => typeof t === "string");
expect(types).toContain("reasoning");
expect(types).toContain("function_call");
expect(types.indexOf("reasoning")).toBeLessThan(
types.indexOf("function_call"),
);
expect(types).not.toContain("reasoning");
} finally {
cap.restore();
}

View File

@@ -15,6 +15,7 @@ describe("applyAuthChoice", () => {
const previousStateDir = process.env.CLAWDBOT_STATE_DIR;
const previousAgentDir = process.env.CLAWDBOT_AGENT_DIR;
const previousPiAgentDir = process.env.PI_CODING_AGENT_DIR;
const previousOpenrouterKey = process.env.OPENROUTER_API_KEY;
let tempStateDir: string | null = null;
afterEach(async () => {
@@ -37,6 +38,11 @@ describe("applyAuthChoice", () => {
} else {
process.env.PI_CODING_AGENT_DIR = previousPiAgentDir;
}
if (previousOpenrouterKey === undefined) {
delete process.env.OPENROUTER_API_KEY;
} else {
process.env.OPENROUTER_API_KEY = previousOpenrouterKey;
}
});
it("prompts and writes MiniMax API key when selecting minimax-api", async () => {