Skip to content

feat: add dedicated plan question tool#25375

Closed
viniraioli wants to merge 39 commits intoanomalyco:devfrom
viniraioli:feat/plan-question-tool
Closed

feat: add dedicated plan question tool#25375
viniraioli wants to merge 39 commits intoanomalyco:devfrom
viniraioli:feat/plan-question-tool

Conversation

@viniraioli
Copy link
Copy Markdown

Summary

  • Separate plan-mode clarification from the normal question tool by introducing plan_question with dedicated prompting and permissions.
  • Restrict tool availability by agent so plan mode can only use plan_question, while build/normal agents keep using question.
  • Update TUI/UI handling and tests so both question-like tools render consistently and permission coverage is enforced.

Testing

  • bun typecheck in packages/opencode
  • bun typecheck in packages/ui
  • bun test test/agent/agent.test.ts test/tool/question.test.ts test/tool/registry.test.ts in packages/opencode (fails in 3 existing tool.registry tests due to timeout)

Vinicios Rabaioli and others added 30 commits April 27, 2026 20:18
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
# Conflicts:
#	.github/VOUCHED.td
#	bun.lock
#	packages/opencode/package.json
Copilot AI review requested due to automatic review settings May 2, 2026 03:12
@viniraioli viniraioli requested a review from adamdotdevin as a code owner May 2, 2026 03:12
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@viniraioli
Copy link
Copy Markdown
Author

Opened against the upstream repo by mistake; reopening this change on the fork instead.

@viniraioli viniraioli closed this May 2, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR mixes the advertised plan_question tool split with a much broader repo reshaping: agent/tool permission updates, multiple TUI/theme tweaks, release/packaging changes, documentation rewrites, and large-scale removal of workflows/docs metadata. Within the codebase, the central functional change is adding a plan-only question tool so planning agents cannot use the normal question tool.

Changes:

  • Added plan_question alongside question, updated agent permissions/prompts/registry logic, and added targeted tests for plan-mode behavior.
  • Updated UI/TUI rendering for question-like tools, themes, logo/layout, permissions, and markdown styling.
  • Introduced release/packaging/readme/workflow changes, including new release-please files and broad removal of GitHub automation/docs assets.

Reviewed changes

Copilot reviewed 131 out of 138 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
script/raw-changelog.ts Swaps TEAM_MEMBERS file loading for OPENCODE_TEAM env-based contributor exclusion.
release-please-config.json Adds release-please config for root/package version management.
packages/web/src/content/docs/themes.mdx Documents the graphite theme in English docs.
packages/web/src/content/docs/pt-br/themes.mdx Documents the graphite theme in PT-BR docs.
packages/ui/src/theme/themes/lucent-orng.json Removes the Lucent Orng UI theme asset.
packages/ui/src/theme/index.ts Stops exporting Lucent Orng from UI theme index.
packages/ui/src/theme/default-themes.ts Removes Lucent Orng from default UI theme registry.
packages/ui/src/theme/context.tsx Removes Lucent Orng display-name mapping.
packages/ui/src/context/marked.tsx Retunes markdown syntax colors toward stronger base text styling.
packages/ui/src/components/tool-error-card.tsx Maps plan_question errors to the question tool label.
packages/ui/src/components/session-turn.tsx Treats plan_question like question for hidden/pending rendering.
packages/ui/src/components/message-part.tsx Shares question rendering between question and plan_question.
packages/ui/src/components/logo.css Makes logo mark square via aspect-ratio: 1.
packages/script/src/index.ts Updates version/package lookup and simplifies team exclusion logic.
packages/opencode/test/tool/registry.test.ts Adds registry coverage for plan-vs-build question tool availability.
packages/opencode/test/tool/question.test.ts Adds execution test for plan-specific question output/guidance.
packages/opencode/test/cli/tui/theme-store.test.ts Adds theme assertions for markdown prose colors and graphite theme.
packages/opencode/test/agent/agent.test.ts Verifies agent permissions for question vs plan_question.
packages/opencode/src/tool/registry.ts Registers plan_question and filters question tools by agent type.
packages/opencode/src/tool/question.ts Refactors shared question tool implementation and adds PlanQuestionTool.
packages/opencode/src/tool/plan-question.txt Adds tool prompt/instructions for plan-mode questions.
packages/opencode/src/session/prompt/plan.txt Updates plan prompt to require plan_question instead of prose questions.
packages/opencode/src/session/prompt.ts Updates synthetic planning workflow prompt to use plan_question.
packages/opencode/src/cli/ui.ts Extends CLI logo renderer with accent-row and comma glyph handling.
packages/opencode/src/cli/logo.ts Adds optional accent rows to logo shape definitions.
packages/opencode/src/cli/cmd/tui/routes/session/permission.tsx Tweaks permission diff colors/backgrounds and MCP icon label.
packages/opencode/src/cli/cmd/tui/routes/session/footer.tsx Simplifies MCP footer indicator display.
packages/opencode/src/cli/cmd/tui/routes/home.tsx Reworks home layout/logo highlighting and uses shared prompt placeholders.
packages/opencode/src/cli/cmd/tui/feature-plugins/home/footer.tsx Simplifies plugin footer MCP indicator.
packages/opencode/src/cli/cmd/tui/context/theme/lucent-orng.json Removes Lucent Orng TUI theme asset.
packages/opencode/src/cli/cmd/tui/context/theme.tsx Adds graphite theme, forces markdown prose/base colors, and makes renderer background transparent.
packages/opencode/src/cli/cmd/tui/component/todo-item.tsx Tightens todo item layout/color handling.
packages/opencode/src/cli/cmd/tui/component/logo.tsx Adds accent support and highlight color behavior to TUI logo component.
packages/opencode/src/cli/cmd/tui/component/border.tsx Adds reusable frame border character set.
packages/opencode/src/cli/cmd/tui/app.tsx Removes top-level app background color prop.
packages/opencode/src/cli/cmd/run.ts Uses [mcp] icon text and denies plan_question in run mode.
packages/opencode/src/cli/cmd/github.ts Denies plan_question in GitHub run permissions.
packages/opencode/src/agent/agent.ts Denies normal questions in plan mode and allows plan_question.
packages/opencode/script/release.ts Adds a local npm release pipeline script with auto bump detection.
packages/opencode/script/postinstall.mjs Renames binary/package lookup to scoped @viniraioli/opencode names.
packages/opencode/script/build.ts Renames published package artifacts/binaries and keeps legacy binary aliasing.
packages/opencode/package.json Bumps package version and adds release script.
packages/opencode/bin/opencode Updates binary/package resolution for scoped package names.
package.json Adds root version plus root release helper scripts.
nix/node_modules.nix Stops including .github/TEAM_MEMBERS in nix derivation inputs.
bun.lock Updates locked package version metadata.
README.zh.md Deletes Simplified Chinese README translation.
README.vi.md Deletes Vietnamese README translation.
README.tr.md Deletes Turkish README translation.
README.ru.md Deletes Russian README translation.
README.pl.md Deletes Polish README translation.
README.no.md Deletes Norwegian README translation.
README.md Replaces public README with short repo-local instructions.
README.ko.md Deletes Korean README translation.
README.ja.md Deletes Japanese README translation.
README.it.md Deletes Italian README translation.
README.fr.md Deletes French README translation.
README.es.md Deletes Spanish README translation.
README.de.md Deletes German README translation.
README.da.md Deletes Danish README translation.
README.bs.md Deletes Bosnian README translation.
README.br.md Deletes Brazilian Portuguese README translation.
README.ar.md Deletes Arabic README translation.
.release-please-manifest.json Adds release-please manifest version seed.
.opencode/skills/test-tui/SKILL.md Adds Codex TUI manual testing skill doc.
.opencode/skills/remote-tests/SKILL.md Adds remote-test execution skill doc.
.opencode/skills/codex-pr-body/SKILL.md Adds Codex PR body editing skill doc.
.opencode/skills/codex-issue-digest/agents/openai.yaml Adds issue-digest agent metadata.
.opencode/skills/codex-issue-digest/SKILL.md Adds Codex issue digest workflow doc.
.opencode/skills/codex-bug/SKILL.md Adds Codex bug triage skill doc.
.opencode/skills/code-review/SKILL.md Adds orchestrated code-review skill doc.
.opencode/skills/code-review-testing/SKILL.md Adds testing-focused review guidance.
.opencode/skills/code-review-context/SKILL.md Adds model-context review guidance.
.opencode/skills/code-review-change-size/SKILL.md Adds change-size review guidance.
.opencode/skills/code-review-breaking-changes/SKILL.md Adds breaking-change review guidance.
.opencode/skills/babysit-pr/scripts/test_gh_pr_watch.py Adds tests for PR babysitter watcher script behavior.
.opencode/skills/babysit-pr/agents/openai.yaml Adds PR babysitter agent metadata.
.github/workflows/vouch-manage-by-issue.yml Removes vouch issue-comment management workflow.
.github/workflows/vouch-check-pr.yml Removes vouch check for new PRs.
.github/workflows/vouch-check-issue.yml Removes vouch check for new issues.
.github/workflows/typecheck.yml Moves typecheck job to ubuntu-latest.
.github/workflows/triage.yml Removes automated issue triage workflow.
.github/workflows/test.yml Simplifies concurrency syntax and changes Windows test execution.
.github/workflows/sync-zed-extension.yml Removes Zed extension sync workflow.
.github/workflows/storybook.yml Removes Storybook build workflow.
.github/workflows/stats.yml Removes stats generation workflow.
.github/workflows/review.yml Removes issue-comment-triggered review workflow.
.github/workflows/release-github-action.yml Removes GitHub Action release workflow.
.github/workflows/publish-vscode.yml Removes VS Code publish workflow.
.github/workflows/publish-github-action.yml Removes GitHub Action publish workflow.
.github/workflows/pr-management.yml Removes duplicate-PR/contributor-label management workflow.
.github/workflows/opencode.yml Removes comment-triggered opencode workflow.
.github/workflows/notify-discord.yml Removes release-to-Discord notification workflow.
.github/workflows/nix-hashes.yml Removes nix hash update workflow.
.github/workflows/nix-eval.yml Removes nix eval workflow.
.github/workflows/generate.yml Removes code generation workflow.
.github/workflows/duplicate-issues.yml Removes duplicate/compliance issue automation.
.github/workflows/docs-update.yml Removes scheduled docs update workflow.
.github/workflows/docs-locale-sync.yml Removes locale docs sync workflow.
.github/workflows/deploy.yml Removes deployment workflow.
.github/workflows/daily-pr-recap.yml Removes daily PR recap workflow.
.github/workflows/daily-issues-recap.yml Removes daily issues recap workflow.
.github/workflows/containers.yml Removes container build/publish workflow.
.github/workflows/compliance-close.yml Removes compliance auto-close workflow.
.github/workflows/close-issues.yml Removes stale issue closing workflow.
.github/workflows/beta.yml Removes beta branch sync workflow.
.github/publish-python-sdk.yml Removes placeholder Python SDK publish workflow file.
.github/actions/setup-git-committer/action.yml Removes shared GitHub App/git committer composite action.
.github/VOUCHED.td Removes vouched/denounced contributor list.
.github/TEAM_MEMBERS Removes team-member list consumed by scripts/automation.
.github/ISSUE_TEMPLATE/question.yml Removes question issue template.
.github/ISSUE_TEMPLATE/feature-request.yml Removes feature request issue template.
.github/ISSUE_TEMPLATE/config.yml Removes issue template config/contact links.
.github/ISSUE_TEMPLATE/bug-report.yml Removes bug report issue template.
.github/CODEOWNERS Removes CODEOWNERS mappings.
Comments suppressed due to low confidence (2)

.github/ISSUE_TEMPLATE/config.yml:1

  • Removing this file together with the other files under .github/ISSUE_TEMPLATE/ leaves the repository without any issue forms or contact-link configuration. New issues will no longer be guided into the required bug/feature/question templates, which also breaks the compliance automation assumptions documented elsewhere in this repo.
    .github/workflows/deploy.yml:1
  • Deleting this workflow removes the repository's automated deployments entirely; after this change there is no replacement deployment workflow left under .github/workflows/. That is a production-impacting operational change that is unrelated to the plan-question feature described in this PR.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"packages": {
".": {
"release-type": "node",
"package-name": "@vinirabli/opencode",
@@ -0,0 +1,3 @@
{
".": "1.15.0"
Comment thread script/raw-changelog.ts
Comment on lines +27 to +30
// OPENCODE_TEAM can be set to a comma- or newline-separated list of GitHub logins
// to exclude from the community-contributors section (e.g. human maintainers).
// Falls back to bots-only when not set.
const team = [...bot, ...(process.env.OPENCODE_TEAM ?? "").split(/[\n,]/).map((s) => s.trim()).filter(Boolean)]

createEffect(() => {
renderer.setBackgroundColor(values().background)
renderer.setBackgroundColor(RGBA.fromInts(0, 0, 0, 0))
Comment thread README.md
Comment on lines +1 to +34
## Install

<p align="center">
<a href="README.md">English</a> |
<a href="README.zh.md">简体中文</a> |
<a href="README.zht.md">繁體中文</a> |
<a href="README.ko.md">한국어</a> |
<a href="README.de.md">Deutsch</a> |
<a href="README.es.md">Español</a> |
<a href="README.fr.md">Français</a> |
<a href="README.it.md">Italiano</a> |
<a href="README.da.md">Dansk</a> |
<a href="README.ja.md">日本語</a> |
<a href="README.pl.md">Polski</a> |
<a href="README.ru.md">Русский</a> |
<a href="README.bs.md">Bosanski</a> |
<a href="README.ar.md">العربية</a> |
<a href="README.no.md">Norsk</a> |
<a href="README.br.md">Português (Brasil)</a> |
<a href="README.th.md">ไทย</a> |
<a href="README.tr.md">Türkçe</a> |
<a href="README.uk.md">Українська</a> |
<a href="README.bn.md">বাংলা</a> |
<a href="README.gr.md">Ελληνικά</a> |
<a href="README.vi.md">Tiếng Việt</a>
</p>
- `bun` instalado
- dependencias instaladas com `bun install`

[![OpenCode Terminal UI](packages/web/src/assets/lander/screenshot.png)](https://opencode.ai)

---

### Installation
## Comandos que eu devo usar

```bash
# YOLO
curl -fsSL https://opencode.ai/install | bash

# Package managers
npm i -g opencode-ai@latest # or bun/pnpm/yarn
scoop install opencode # Windows
choco install opencode # Windows
brew install anomalyco/tap/opencode # macOS and Linux (recommended, always up to date)
brew install opencode # macOS and Linux (official brew formula, updated less)
sudo pacman -S opencode # Arch Linux (Stable)
paru -S opencode-bin # Arch Linux (Latest from AUR)
mise use -g opencode # Any OS
nix run nixpkgs#opencode # or github:anomalyco/opencode for latest dev branch
bun install
bun run dev
bun run dev:desktop
bun run dev:web
bun run dev:console
bun run lint
bun run typecheck
```

> [!TIP]
> Remove versions older than 0.1.x before installing.

### Desktop App (BETA)
## Observacoes

OpenCode is also available as a desktop application. Download directly from the [releases page](https://github.com/anomalyco/opencode/releases) or [opencode.ai/download](https://opencode.ai/download).

| Platform | Download |
| --------------------- | ------------------------------------- |
| macOS (Apple Silicon) | `opencode-desktop-darwin-aarch64.dmg` |
| macOS (Intel) | `opencode-desktop-darwin-x64.dmg` |
| Windows | `opencode-desktop-windows-x64.exe` |
| Linux | `.deb`, `.rpm`, or AppImage |
- Nao rodar `test` na raiz do repositorio.
- Para checagem de tipos, usar `bun run typecheck`.
- Para publicar release pela raiz:

```bash
# macOS (Homebrew)
brew install --cask opencode-desktop
# Windows (Scoop)
scoop bucket add extras; scoop install extras/opencode-desktop
bun run release
bun run release:skip-build
```

#### Installation Directory

The install script respects the following priority order for the installation path:

1. `$OPENCODE_INSTALL_DIR` - Custom installation directory
2. `$XDG_BIN_DIR` - XDG Base Directory Specification compliant path
3. `$HOME/bin` - Standard user binary directory (if it exists or can be created)
4. `$HOME/.opencode/bin` - Default fallback

```bash
# Examples
OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
XDG_BIN_DIR=$HOME/.local/bin curl -fsSL https://opencode.ai/install | bash
```

### Agents

OpenCode includes two built-in agents you can switch between with the `Tab` key.

- **build** - Default, full-access agent for development work
- **plan** - Read-only agent for analysis and code exploration
- Denies file edits by default
- Asks permission before running bash commands
- Ideal for exploring unfamiliar codebases or planning changes

Also included is a **general** subagent for complex searches and multistep tasks.
This is used internally and can be invoked using `@general` in messages.

Learn more about [agents](https://opencode.ai/docs/agents).

### Documentation

For more info on how to configure OpenCode, [**head over to our docs**](https://opencode.ai/docs).

### Contributing

If you're interested in contributing to OpenCode, please read our [contributing docs](./CONTRIBUTING.md) before submitting a pull request.

### Building on OpenCode

If you are working on a project that's related to OpenCode and is using "opencode" as part of its name, for example "opencode-dashboard" or "opencode-mobile", please add a note to your README to clarify that it is not built by the OpenCode team and is not affiliated with us in any way.

### FAQ

#### How is this different from Claude Code?

It's very similar to Claude Code in terms of capability. Here are the key differences:

- 100% open source
- Not coupled to any provider. Although we recommend the models we provide through [OpenCode Zen](https://opencode.ai/zen), OpenCode can be used with Claude, OpenAI, Google, or even local models. As models evolve, the gaps between them will close and pricing will drop, so being provider-agnostic is important.
- Out-of-the-box LSP support
- A focus on TUI. OpenCode is built by neovim users and the creators of [terminal.shop](https://terminal.shop); we are going to push the limits of what's possible in the terminal.
- A client/server architecture. This, for example, can allow OpenCode to run on your computer while you drive it remotely from a mobile app, meaning that the TUI frontend is just one of the possible clients.

---
## Estrutura rapida

**Join our community** [Discord](https://discord.gg/opencode) | [X.com](https://x.com/opencode)
- `packages/opencode`: CLI principal
- `packages/app`: app web
- `packages/desktop-electron`: app desktop
- `packages/console/app`: interface de console
Comment on lines +67 to +71
run: |
if [ "$RUNNER_OS" = "Windows" ]; then
bun --cwd packages/app run test:ci
else
bun turbo test:ci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:compliance This means the issue will auto-close after 2 hours.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants