Skip to content

feat(plugin): bash.commands hook for CLI command timeout exemption#21776

Open
micuintus wants to merge 1 commit intoanomalyco:devfrom
micuintus:feat/bash-commands-hook
Open

feat(plugin): bash.commands hook for CLI command timeout exemption#21776
micuintus wants to merge 1 commit intoanomalyco:devfrom
micuintus:feat/bash-commands-hook

Conversation

@micuintus
Copy link
Copy Markdown

@micuintus micuintus commented Apr 9, 2026

Issue for this PR

Closes #21770

Type of change

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

What does this PR do?

Adds a bash.commands plugin hook. Plugins register CLI command names that should skip the bash tool's execution timeout — useful for plugin-provided binaries that call back into the opencode server and can legitimately run longer than the default timeout.

The bash tool collects registered commands at init time and sets timeout: 0 when the executed command matches.

How did you verify your code works?

  • Manual testing with a plugin CLI that exceeds the default timeout
  • bun turbo typecheck passes

Screenshots / recordings

No UI changes.

Checklist

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

Part of the plugin primitives work split from #21687 (tracking issue #20018).

@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 9, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

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

@micuintus micuintus force-pushed the feat/bash-commands-hook branch 2 times, most recently from bbada8e to 68dbf1b Compare April 9, 2026 22:08
Plugins that ship CLI binaries calling back into OpenCode can register their
command names via the bash.commands hook. Matching commands run with timeout=0
(no kill) and skip output truncation so long-running script callbacks aren't
terminated prematurely. The exempt set is cached once at BashTool init.
@micuintus micuintus force-pushed the feat/bash-commands-hook branch from 68dbf1b to ccb6cf2 Compare April 9, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: bash.commands hook for CLI command timeout exemption

1 participant