fix(test): detect ignored Anthropic prefix-binding predicates (#158289)

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
This commit is contained in:
Vincent Koc 2026-09-26 03:48:56 +08:00 • committed by GitHub
parent f13c49ca20
commit fe674bbe5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -48,7 +48,7 @@ describe("loadAnthropicTransportStream", () => {
describe("loadAnthropicProviderInternals", () => {
it("uses the candidate prefix-binding capability when exported", async () => {
const stream = vi.fn<AnthropicStreamFn>();
const binds = vi.fn(() => true);
const binds = ({ id }: { id?: string }) => id === "prefix-bound";
const loaded = await loadAnthropicProviderInternals(async () => ({
streamAnthropic: stream,
@ -56,7 +56,8 @@ describe("loadAnthropicProviderInternals", () => {
}));
expect(loaded.streamAnthropic).toBe(stream);
expect(loaded.bindsClaudeThinkingPrefix({ id: "claude-fable-5-1" })).toBe(true);
expect(loaded.bindsClaudeThinkingPrefix({ id: "prefix-bound" })).toBe(true);
expect(loaded.bindsClaudeThinkingPrefix({ id: "ordinary-model" })).toBe(false);
});
it("treats a missing prefix-binding export as an absent frozen capability", async () => {