Code Mode file APIs (Bun.write / Bun.file / Bun.Glob) should pass through plugin tool hooks
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 58/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- bun, typescript
调研方向
Start with packages/core/src/tool.ts to understand existing tool.execute.before and tool.execute.after behavior, then inspect packages/core/src/codemode/tool.ts for the Code Mode extension path. Trace the permission-service handling of Bun.file, Bun.write, Bun.Glob, and fetch, and identify the corresponding plugin hook entry points. Done means the selected approach consistently exposes these calls to plugin hooks or clearly documents the permission-only behavior, with matching failure handling and relevant tests.
由索引模型根据 Issue 内容生成。
描述
Summary
With experimental.full_codemode on, a Code Mode script can use Bun.file, Bun.write, Bun.Glob and fetch. These calls go through the permission service (read, write and webfetch permissions). They do not go through plugin tool.execute.before and tool.execute.after hooks, because they are not tool calls.
Why it matters
Plugins use tool hooks for more than allow or deny: audit logs, output redaction, path rules that depend on call context, rate limits. A plugin that does this work in tool hooks does not see file reads, file writes, glob scans or HTTP requests that a Code Mode script makes. The same operation through the read, write, glob or webfetch tool is visible to it.
Request
One of these:
- Run the plugin hooks of the matching tool (
read,write,edit,glob,webfetch) for each Code ModeBunfile call and eachfetch, with the tool name and an input that has the path or URL. Atool.execute.beforefailure then stops the call, as it does for a tool call. - Or a separate plugin hook for Code Mode extension calls (name, arguments, result), with the same failure contract as
tool.execute.before. - At minimum, document that Code Mode file and network calls pass the permission service only, so that plugin authors can move such checks to the permission hook.
Version
v2.4.2. On current dev, plugin tool.execute.before is still triggered only for tool calls (packages/core/src/tool.ts); the Code Mode extension hooks drive the progress display only (packages/core/src/codemode/tool.ts).
- 主要语言
- TypeScript
- 星标
- 230k
- 派生
- 31.3k
- 平均合并
- 5 小时 32 分钟
- 30 天内合并 PR
- 453
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
area/desktop platform/macos status/repro-plausible type/bug version/v2
难度 1/5 1-3 小时 新手友好度 88/100
anomalyco/opencode#67064 · 4 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 82/100
anomalyco/opencode#67009 · 2 条评论 ·
维护者通常 1 天内回复
-
area/web type/feature version/v2
难度 2/5 1-3 小时 新手友好度 78/100
anomalyco/opencode#67001 · 3 条评论 ·
维护者通常 1 天内回复
-
skills: a Claude-compatible SKILL.md that fails to parse is dropped without any log可能已有人在做 @liwenjie200543 于 2 天前认领。 未关闭area/plugins platform/linux reproduced type/bug version/v2
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/opencode#66970 · 4 条评论 ·
维护者通常 1 天内回复
-
tui: Mermaid renderer displays <b>/<strong> tags literally and ignores \n line breaks可能已有人在做 @argszero 于 2 天前认领。 未关闭area/tui platform/wsl status/repro-simulated type/bug version/v2
难度 2/5 1-3 小时 新手友好度 82/100
anomalyco/opencode#66773 · 4 条评论 ·
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
ci
难度 2/5 1-3 小时 新手友好度 78/100
ClickHouse/clickhouse-js#1248 ·
维护者通常 1 天内回复
-
E2E: Darlehen-Test wartet auf die gebuchte Auszahlung, bevor er zur Liquiditätsvorschau wechselt未关闭technik
难度 2/5 1-3 小时 新手友好度 78/100
-
bug
难度 2/5 1-3 小时 新手友好度 67/100
SR5-FoundryVTT/SR5-FoundryVTT#2162 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 84/100
AhmedNAgy25/analysor#25 ·
维护者通常 1 天内回复