opencode.tools adds the execute / session_move hint even when Code Mode is denied
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 67/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
組み込みの opencode.tools プラグインは context、compaction、generate のリクエストにヒントを追加し、Tool.snapshot は execute が利用可能かどうかを判定します。これらのエントリーポイントを読み、セッションエージェントの権限ルールがプラグインに届く経路をたどってください。ツールスナップショットまたはシステムプロンプトの一部に関する既存のテストを確認してください。execute が完全に拒否されているセッションではヒントが省かれ、それ以外では引き続き利用できる状態になれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Description
When Code Mode is turned off with a permission rule ({ "action": "execute", "resource": "*", "effect": "deny" }), Tool.snapshot doesn't build the execute tool (codeModeEnabled = !whollyDisabled("execute", rules)), but the built-in opencode.tools plugin still adds this system part to every context, compaction and generate request:
When you create a worktree outside the current working directory and intend to use it as your primary working directory, consider using
executeto calltools.opencode.session_moveand make the worktree the session's working directory.
The model is told to use a tool it isn't offered (and tools.opencode.* are Code Mode only, so they aren't reachable either).
Expected: skip the hint when execute is wholly denied for the session's agent.
Related: #48749 (the hint now also reaches compaction and generate requests).
Plugins
Own plugins via the SDK (embedded host); the hint comes from the built-in opencode.tools.
OpenCode version
@opencode/core 2.0.32
Steps to reproduce
- Config with
"permissions": [{ "action": "*", "resource": "*", "effect": "allow" }, { "action": "execute", "resource": "*", "effect": "deny" }]. - Send a prompt.
- The request has no
executetool, but its system prompt still contains theexecute/tools.opencode.session_movehint.
- 主要言語
- TypeScript
- スター
- 215k
- フォーク
- 28.9k
- 平均マージ
- 8時間 11分
- マージ済み PR(30日)
- 365
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
anomalyco/opencode のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
anomalyco/opencode#57698 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
pending close triaging
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
anomalyco/opencode#57664 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
anomalyco/opencode#57579 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
anomalyco/opencode#57536 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
fs: /cd and file pickers fail on FreeBSD/ZFS — `stat` throws "dev exceeds the safe integer range" (fixed in @effect/platform-node-shared 4.0.5)対応中かも @argszero が今日担当しました。 オープンreproduced
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
anomalyco/opencode#57518 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
anomalyco/opencode の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
endora-commerce/endora-commerce#397 ·
メンテナーはふだん 1 日以内に返信
-
level/task
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
wazuh/wazuh-dashboard-plugins#9472 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
メンテナーはふだん 1 日以内に返信
-
ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
xavxyz/bei-shan-lin-shui#57 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
opennextjs/opennextjs-cloudflare#1461 ·
メンテナーはふだん 1 日以内に返信