Skip to content

Commit f2ac48b

Browse files
committed
fix(sdk): replace deprecated base agent with codebuff/base2@latest
- Use codebuff/base2@latest for integration tests and e2e examples - Keep base2 for unit tests that mock the database (agent string never resolves) - Fixes "Invalid agent ID" errors in tests that hit the production API
1 parent a2a9aec commit f2ac48b

10 files changed

+11
-11
lines changed

sdk/e2e/examples/code-explainer.example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ async function main() {
3939
console.log('Explanation:\n')
4040

4141
const result = await client.run({
42-
agent: 'base',
42+
agent: 'codebuff/base2@latest',
4343
prompt: `Explain what this code does in simple terms:\n\n${SAMPLE_CODE}`,
4444
handleStreamChunk: (chunk) => {
4545
if (typeof chunk === 'string') {

sdk/e2e/examples/code-reviewer.example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async function main() {
2929
console.log('```\n')
3030

3131
const result = await client.run({
32-
agent: 'base',
32+
agent: 'codebuff/base2@latest',
3333
prompt: `Review this code and identify any bugs or issues:\n\n${SAMPLE_CODE}`,
3434
handleStreamChunk: (chunk) => {
3535
if (typeof chunk === 'string') {

sdk/e2e/examples/commit-message-generator.example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async function main() {
3838
console.log('Generated commit message:\n')
3939

4040
const result = await client.run({
41-
agent: 'base',
41+
agent: 'codebuff/base2@latest',
4242
prompt: `Generate a concise git commit message for this diff:\n\n${SAMPLE_DIFF}`,
4343
handleStreamChunk: (chunk) => {
4444
if (typeof chunk === 'string') {

sdk/e2e/examples/sdk-lint.example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ async function main() {
4242
console.log('Lint results:\n')
4343

4444
const result = await client.run({
45-
agent: 'base',
45+
agent: 'codebuff/base2@latest',
4646
prompt: `Act as a linter. Find issues in this code and provide specific feedback:\n\n${CODE_TO_LINT}`,
4747
handleStreamChunk: (chunk) => {
4848
if (typeof chunk === 'string') {

sdk/e2e/examples/sdk-refactor.example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async function main() {
4040
console.log('Refactored version:\n')
4141

4242
const result = await client.run({
43-
agent: 'base',
43+
agent: 'codebuff/base2@latest',
4444
prompt: `Refactor this code to be more readable and use modern JavaScript features:\n\n${CODE_TO_REFACTOR}`,
4545
handleStreamChunk: (chunk) => {
4646
if (typeof chunk === 'string') {

sdk/e2e/examples/sdk-test-gen.example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ async function main() {
3939
console.log('Generated tests:\n')
4040

4141
const result = await client.run({
42-
agent: 'base',
42+
agent: 'codebuff/base2@latest',
4343
prompt: `Generate unit tests for these functions using Jest:\n\n${CODE_TO_TEST}`,
4444
handleStreamChunk: (chunk) => {
4545
if (typeof chunk === 'string') {

sdk/src/__tests__/run-handle-event.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ describe('CodebuffClient handleEvent / handleStreamChunk', () => {
114114
})
115115

116116
const result = await client.run({
117-
agent: 'base',
117+
agent: 'base2',
118118
prompt: 'hello world',
119119
handleEvent: (event) => {
120120
events.push(event)

sdk/src/__tests__/run-with-retry.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type { SessionState } from '@codebuff/common/types/session-state'
1111
const baseOptions = {
1212
apiKey: 'test-key',
1313
fingerprintId: 'fp',
14-
agent: 'base',
14+
agent: 'base2',
1515
prompt: 'hi',
1616
} as const
1717

sdk/src/__tests__/run.integration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('Prompt Caching', () => {
1818
let cost1 = -1
1919
const run1 = await client.run({
2020
prompt: `${filler}\n\n${prompt}`,
21-
agent: 'base',
21+
agent: 'codebuff/base2@latest',
2222
handleEvent: (event) => {
2323
if (event.type === 'finish') {
2424
cost1 = event.totalCost
@@ -33,7 +33,7 @@ describe('Prompt Caching', () => {
3333
let cost2 = -1
3434
const run2 = await client.run({
3535
prompt,
36-
agent: 'base',
36+
agent: 'codebuff/base2@latest',
3737
previousRun: run1,
3838
handleEvent: (event) => {
3939
if (event.type === 'finish') {

sdk/test/test-sdk.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export async function testSdk() {
1212
})
1313

1414
const run = await client.run({
15-
agent: 'base',
15+
agent: 'codebuff/base2@latest',
1616
prompt: 'Create a simple calculator class',
1717
handleEvent: (event) => {
1818
console.log(event)

0 commit comments

Comments
 (0)