Skip to content

Commit c707191

Browse files
committed
sdk: fix bug with relative path
1 parent 6c99b83 commit c707191

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@codebuff/sdk",
33
"private": false,
44
"access": "public",
5-
"version": "0.1.32",
5+
"version": "0.1.33",
66
"description": "Official SDK for Codebuff — AI coding agent & framework",
77
"license": "Apache-2.0",
88
"type": "commonjs",

sdk/src/client.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import path from 'path'
2+
13
import {
24
initialSessionState,
35
applyOverridesToSessionState,
@@ -15,12 +17,12 @@ import {
1517
import { MAX_AGENT_STEPS_DEFAULT } from '../../common/src/constants/agents'
1618
import { API_KEY_ENV_VAR } from '../../common/src/old-constants'
1719
import { toolNames } from '../../common/src/tools/constants'
18-
import type { PublishedClientToolName } from '../../common/src/tools/list'
1920
import {
2021
clientToolCallSchema,
2122
type ClientToolCall,
2223
type ClientToolName,
2324
type CodebuffToolOutput,
25+
PublishedClientToolName,
2426
} from '../../common/src/tools/list'
2527

2628
import type { CustomToolDefinition } from './custom-tool'
@@ -341,7 +343,7 @@ export class CodebuffClient {
341343
} else if (toolName === 'run_terminal_command') {
342344
result = await runTerminalCommand({
343345
...input,
344-
cwd: input.cwd ?? this.cwd,
346+
cwd: path.resolve(this.cwd, input.cwd ?? '.'),
345347
} as Parameters<typeof runTerminalCommand>[0])
346348
} else if (toolName === 'code_search') {
347349
result = await codeSearch({

0 commit comments

Comments
 (0)