fix: use Instance.directory instead of process.cwd() in read tool
This commit is contained in:
@@ -3,5 +3,3 @@ preload = ["@opentui/solid/preload"]
|
|||||||
[test]
|
[test]
|
||||||
preload = ["./test/preload.ts"]
|
preload = ["./test/preload.ts"]
|
||||||
timeout = 10000 # 10 seconds (default is 5000ms)
|
timeout = 10000 # 10 seconds (default is 5000ms)
|
||||||
# Enable code coverage
|
|
||||||
coverage = true
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export const ReadTool = Tool.define("read", {
|
|||||||
async execute(params, ctx) {
|
async execute(params, ctx) {
|
||||||
let filepath = params.filePath
|
let filepath = params.filePath
|
||||||
if (!path.isAbsolute(filepath)) {
|
if (!path.isAbsolute(filepath)) {
|
||||||
filepath = path.join(process.cwd(), filepath)
|
filepath = path.join(Instance.directory, filepath)
|
||||||
}
|
}
|
||||||
const title = path.relative(Instance.worktree, filepath)
|
const title = path.relative(Instance.worktree, filepath)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user