Skip to content

feat: allow planning CLI tools (gh, glab) in plan mode#23985

Closed
MattPark wants to merge 1 commit into
anomalyco:devfrom
MattPark:feat/plan-mode-allow-planning-cli-tools
Closed

feat: allow planning CLI tools (gh, glab) in plan mode#23985
MattPark wants to merge 1 commit into
anomalyco:devfrom
MattPark:feat/plan-mode-allow-planning-cli-tools

Conversation

@MattPark
Copy link
Copy Markdown

@MattPark MattPark commented Apr 23, 2026

Issue for this PR

Closes #23984

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Plan mode's system prompt blocks all bash commands with absolutist language ("ZERO exceptions", "commands may ONLY read/inspect"). This prevents legitimate planning activities like creating GitHub/GitLab issues via gh and glab CLI tools, forcing users into build mode prematurely.

The bash tool isn't hard-denied in plan mode's permission config — it inherits "allow" from defaults. The refusal is caused entirely by the system prompt.

This PR makes three changes:

  1. plan.txt — Scopes restrictions to "source code modifications" instead of "all commands." Adds an "Allowed planning activities" section listing issue/ticket management, PR/MR creation, documentation artifacts, and project queries.

  2. prompt.ts — Same scoping for the experimental plan prompt.

  3. agent.ts — Adds bash: { "gh *": "allow", "glab *": "allow" } to the plan agent permission config so the intent is explicit at the permission layer too.

Source code edit restrictions remain unchanged (edit: { "*": "deny" } in permissions + prompt language).

How did you verify your code works?

Reviewed the three changed files for correctness. The prompt changes only affect planning-related tool usage — source code protections (hard edit: { "*": "deny" } permission + prompt restrictions on sed/tee/echo/cat) are preserved. The gh * / glab * bash rules use the existing granular permission pattern matching system documented in the permissions docs.

Screenshots / recordings

N/A — prompt and permission config changes, no UI.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Reframe plan mode restrictions from 'all commands' to 'source code
modifications' so planning activities (issue tracking, ticket management,
PR/MR creation, documentation) work without forcing users into build mode.

- Update plan.txt system prompt with explicit allowed planning activities
- Update experimental plan prompt in prompt.ts with same scoping
- Add bash permission rules for gh and glab in plan agent config

Fixes anomalyco#23984
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Apr 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@github-actions
Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Plan mode should allow planning-related CLI tools (gh, glab, ticket management, diagrams)

1 participant