Skip to content

fix(extension-agent): add background option to e2b command execution#806

Merged
dingyi222666 merged 1 commit intov1-devfrom
fix/e2b-error
Mar 31, 2026
Merged

fix(extension-agent): add background option to e2b command execution#806
dingyi222666 merged 1 commit intov1-devfrom
fix/e2b-error

Conversation

@dingyi222666
Copy link
Copy Markdown
Member

Summary

  • Explicitly pass background: true to E2B command run options instead of relying on spread options
  • Bump extension-agent version to 1.0.15

Why

The previous code spread options which didn't guarantee background: true was included, potentially causing commands to not run in the background as intended.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 31, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f54a1c9f-1327-4967-8bc8-2b3cf039fe16

📥 Commits

Reviewing files that changed from the base of the PR and between fc58b71 and 7021b9a.

⛔ Files ignored due to path filters (1)
  • packages/extension-agent/package.json is excluded by !**/*.json
📒 Files selected for processing (1)
  • packages/extension-agent/src/computer/backends/e2b.ts

概览

packages/extension-agent/src/computer/backends/e2b.ts 中更新了 run 方法对 current.commands.run(...) 的调用方式,将 background: true 从类型断言改为显式在对象字面量中指定。

更改

内聚组 / 文件 摘要
命令运行参数调整
packages/extension-agent/src/computer/backends/e2b.ts
修改了 commands.run() 的调用方式,将 background: true 从先前的类型断言模式改为与其他选项一起直接在对象字面量中指定。

预估代码审查工作量

🎯 1 (微不足道) | ⏱️ ~3 分钟

可能相关的 PR

🐰 背景标志悄然迁,
从类型到对象间,
布局改,逻辑现,
简洁优雅向前看,
小小改动显匠心~

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/e2b-error

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dingyi222666 dingyi222666 merged commit 086a1f7 into v1-dev Mar 31, 2026
2 of 3 checks passed
@dingyi222666 dingyi222666 deleted the fix/e2b-error branch March 31, 2026 05:10
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the version of the koishi-plugin-chatluna-agent package and refactors the command execution logic in the E2B backend to explicitly set the background option. A review comment identifies a redundant type cast that can be removed to simplify the code and leverage TypeScript's type inference.

Comment on lines 655 to +658
handle = (await current.commands.run(command, {
...options
} as CommandStartOpts & { background: true })) as CommandHandle
...options,
background: true
})) as CommandHandle
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
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant