opencode.tools adds the execute / session_move hint even when Code Mode is denied
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 67/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- ai-infra-agents
Research direction
The built-in opencode.tools plugin adds the hint to context, compaction and generate requests, while Tool.snapshot determines whether execute is available. Read those entry points and trace how the session agent’s permission rules reach the plugin; check existing tests for tool snapshots or system prompt parts. Done when the hint is omitted for sessions where execute is wholly denied and remains available otherwise.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- TypeScript
- Stars
- 221k
- Forks
- 29.6k
- Avg merge
- 4h 35m
- Merged PRs (30d)
- 521
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from anomalyco/opencode
-
triaging
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
anomalyco/opencode#58821 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
anomalyco/opencode#58774 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
anomalyco/opencode#58725 · 1 comment ·
Maintainers usually reply within 1 day
-
Snapshot capture failure (EPERM spawning git) fails the whole step despite the best-effort contractPossibly taken @Dopetaiga claimed this 1 day ago. Openreproduced
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
anomalyco/opencode#58685 · 2 comments ·
Maintainers usually reply within 1 day
-
tui: PHP code blocks without `<?php` are not syntax highlightedPossibly taken @SwastikTripathi claimed this 1 day ago. Openreproduced
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
anomalyco/opencode#58664 · 2 comments ·
Maintainers usually reply within 1 day
All issues in anomalyco/opencode
Similar issues
-
freshness freshness:observed-only
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
thoroc/context-radar#282 ·
-
bug P2 rust
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
area: web
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
gabe-santana/arkdraw#25 ·
-
bug require-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
expressjs/expressjs.com#2549 · 1 reaction ·
Maintainers usually reply within 1 day
-
bug good first issue hacktoberfest
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
codercops/discord-bot#101 · 1 comment ·
Maintainers usually reply within 1 day