Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

opencode.tools adds the execute / session_move hint even when Code Mode is denied

オープン 初心者向け
#57,711 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
67/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript

調査の方向性

組み込みの opencode.tools プラグインは context、compaction、generate のリクエストにヒントを追加し、Tool.snapshot は execute が利用可能かどうかを判定します。これらのエントリーポイントを読み、セッションエージェントの権限ルールがプラグインに届く経路をたどってください。ツールスナップショットまたはシステムプロンプトの一部に関する既存のテストを確認してください。execute が完全に拒否されているセッションではヒントが省かれ、それ以外では引き続き利用できる状態になれば完了です。

索引モデルが issue の本文から書いたものです。

説明

reproduced
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 execute to call tools.opencode.session_move and 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
  1. Config with "permissions": [{ "action": "*", "resource": "*", "effect": "allow" }, { "action": "execute", "resource": "*", "effect": "deny" }].
  2. Send a prompt.
  3. The request has no execute tool, but its system prompt still contains the execute / tools.opencode.session_move hint.
主要言語
TypeScript
スター
215k
フォーク
28.9k
平均マージ
8時間 11分
マージ済み PR(30日)
365

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

anomalyco/opencode のほかの issue

anomalyco/opencode の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。