mirror of
https://github.com/lobehub/lobehub
synced 2026-04-21 17:47:27 +00:00
fix(local-system): restore loc param when calling readLocalFile IPC (#13748)
🐛 fix(local-system): restore loc param when calling readLocalFile IPC The `denormalizeParams` method in `LocalSystemExecutionRuntime` was missing a case for `readLocalFile`. It fell through to `default`, which passed `{startLine, endLine, path}` as-is to the IPC layer. However, the IPC handler (`LocalFileCtr.readFile`) expects `LocalReadFileParams` with `loc?: [number, number]`, not `startLine`/`endLine`. As a result, `loc` was always `undefined` on the IPC side, causing `readLocalFile` to default to `[0, 200]` and always return content from line 0. Fix: add an explicit `readLocalFile` case that reconstructs the `loc` tuple from `startLine` and `endLine` before forwarding to the IPC layer. Fixes #13735 Co-authored-by: octo-patch <octo-patch@github.com>
This commit is contained in:
parent
e0f97c4920
commit
37bf1bd191
1 changed files with 8 additions and 0 deletions
|
|
@ -120,6 +120,14 @@ export class LocalSystemExecutionRuntime extends ComputerRuntime {
|
|||
return { shell_id: params.commandId };
|
||||
}
|
||||
|
||||
case 'readLocalFile': {
|
||||
const loc: [number, number] | undefined =
|
||||
params.startLine !== undefined || params.endLine !== undefined
|
||||
? [params.startLine ?? 0, params.endLine ?? 200]
|
||||
: undefined;
|
||||
return { fullContent: params.fullContent, loc, path: params.path };
|
||||
}
|
||||
|
||||
default: {
|
||||
return params;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue