Skip to content

Commit 6bd0508

Browse files
authored
fix(anthropic): use beta models list method in beta runner
1 parent 76136a0 commit 6bd0508

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

‎js/plugins/anthropic/src/list.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ import { claudeModelReference } from './models.js';
3333
export async function listActions(
3434
client: Anthropic
3535
): Promise<ActionMetadata[]> {
36-
const clientModels = (await client.models.list()).data;
36+
// Use beta.models.list to get the list of ALL (stable and beta) models
37+
const clientModels = (await client.beta.models.list()).data;
3738
const seenNames = new Set<string>();
3839

3940
return clientModels

‎js/plugins/anthropic/tests/index_test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,11 @@ describe('Anthropic Plugin', () => {
190190
assert.ok(experimentalMetadata, 'Experimental model metadata should exist');
191191

192192
// Verify mock was called
193-
const listStub = mockClient.models.list as any;
193+
const listStub = mockClient.beta.models.list as any;
194194
assert.strictEqual(
195195
listStub.mock.calls.length,
196196
1,
197-
'models.list should be called once'
197+
'beta.models.list should be called once'
198198
);
199199
});
200200

@@ -224,11 +224,11 @@ describe('Anthropic Plugin', () => {
224224
);
225225

226226
// Verify models.list was only called once due to caching
227-
const listStub = mockClient.models.list as any;
227+
const listStub = mockClient.beta.models.list as any;
228228
assert.strictEqual(
229229
listStub.mock.calls.length,
230230
1,
231-
'models.list should only be called once due to caching'
231+
'beta.models.list should only be called once due to caching'
232232
);
233233
});
234234
});

‎js/plugins/anthropic/tests/mocks/anthropic-client.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ export function createMockAnthropicClient(
134134
create: createStub,
135135
stream: streamStub,
136136
},
137-
models: {
138-
list: listStub,
139-
},
140137
beta: {
138+
models: {
139+
list: listStub,
140+
},
141141
messages: {
142142
create: betaCreateStub,
143143
stream: betaStreamStub,

0 commit comments

Comments
 (0)