Skip to content

Commit b67ddb9

Browse files
jhste102labclaude
andcommitted
test(claude): cover exact xhigh effort restoration
Extend the routed endpoint regression to verify that the shared 31,999-token Claude Code budget preserves both xhigh and max as distinct outbound effort tiers. Co-Authored-By: Claude <[email protected]>
1 parent 5635eda commit b67ddb9

1 file changed

Lines changed: 20 additions & 17 deletions

File tree

‎tests/claude-messages-endpoint.test.ts‎

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -782,27 +782,30 @@ test("effort safety valve: routes with a definitive no-effort ladder get reasoni
782782
}
783783
});
784784

785-
test("generated agent effort directive restores max after Claude Code collapses it to a thinking budget", async () => {
785+
test("generated agent effort directive restores exact xhigh and max after Claude Code collapses them to a thinking budget", async () => {
786786
const { server: upstream, captured } = mockChatUpstreamCapturing();
787787
saveConfig(mockConfig(`${upstream.url.toString().replace(/\/$/, "")}/v1`));
788788
const server = startServer(0);
789789
try {
790-
const response = await postMessages(server.url.toString(), {
791-
model: "claude-haiku-4-5",
792-
max_tokens: 32000,
793-
stream: true,
794-
system: [
795-
{ type: "text", text: "<!-- ocx-route: claude-ocx-mock--test-model -->" },
796-
{ type: "text", text: "<!-- ocx-effort: max -->" },
797-
],
798-
thinking: { type: "enabled", budget_tokens: 31999 },
799-
messages: [{ role: "user", content: "hi" }],
800-
});
801-
expect(response.status).toBe(200);
802-
await response.text();
803-
expect(captured.length).toBe(1);
804-
expect(captured[0]!.model).toBe("test-model");
805-
expect(captured[0]!.reasoning_effort).toBe("max");
790+
for (const effort of ["xhigh", "max"]) {
791+
const response = await postMessages(server.url.toString(), {
792+
model: "claude-haiku-4-5",
793+
max_tokens: 32000,
794+
stream: true,
795+
system: [
796+
{ type: "text", text: "<!-- ocx-route: claude-ocx-mock--test-model -->" },
797+
{ type: "text", text: `<!-- ocx-effort: ${effort} -->` },
798+
],
799+
thinking: { type: "enabled", budget_tokens: 31999 },
800+
messages: [{ role: "user", content: "hi" }],
801+
});
802+
expect(response.status).toBe(200);
803+
await response.text();
804+
}
805+
expect(captured.map(body => ({ model: body.model, effort: body.reasoning_effort }))).toEqual([
806+
{ model: "test-model", effort: "xhigh" },
807+
{ model: "test-model", effort: "max" },
808+
]);
806809
} finally {
807810
server.stop(true);
808811
upstream.stop(true);

0 commit comments

Comments
 (0)