Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/extension-agent/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "koishi-plugin-chatluna-agent",
"description": "Agent framework for ChatLuna",
"version": "1.0.14",
"version": "1.0.15",
"main": "lib/index.cjs",
"module": "lib/index.mjs",
"typings": "lib/index.d.ts",
Expand Down
5 changes: 3 additions & 2 deletions packages/extension-agent/src/computer/backends/e2b.ts
Original file line number Diff line number Diff line change
Expand Up @@ -653,8 +653,9 @@ export class E2BComputerSession implements ComputerSessionApi {

try {
handle = (await current.commands.run(command, {
...options
} as CommandStartOpts & { background: true })) as CommandHandle
...options,
background: true
})) as CommandHandle
Comment on lines 655 to +658
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The explicit type cast as CommandHandle is redundant here. Since background: true is now explicitly included in the object literal passed to current.commands.run, TypeScript's type inference for the E2B SDK will correctly identify the return type as CommandHandle. Removing the cast makes the code cleaner and less prone to hiding type mismatches if the underlying SDK changes.

Suggested change
handle = (await current.commands.run(command, {
...options
} as CommandStartOpts & { background: true })) as CommandHandle
...options,
background: true
})) as CommandHandle
handle = await current.commands.run(command, {
...options,
background: true
})

result = await handle.wait()
} catch (err) {
if (err instanceof CommandExitError) {
Expand Down
Loading