shekohex / shekohex/opencode-pty
Tool descriptions are too verbose — agent needs decision-focused descriptions to autonomously prefer pty_spawn over bash
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 582
- Forks
- 59
- Avg merge
- 13h 20m
- Merged PRs (30d)
- 2
Description
Problem
Currently, the 5 tool description files (spawn.txt, read.txt, write.txt, list.txt, kill.txt) read like tutorial/reference docs. They explain how to use each tool in detail, but give the AI agent almost no guidance on when to choose pty_spawn over the built-in bash tool.
The agent defaults to the built-in bash for everything unless the user explicitly says the magic word "session". This defeats the purpose of the plugin — users expect that installing opencode-pty automatically makes the agent smarter about background/long-running tasks.
Root Cause
The tool() function in the plugin SDK only has a single description: string field — there is no separate instructions or notes field for agent guidance. All communication about the tool goes through this one string.
Proposed Solution
Rewrite the .txt files to be short, decision-focused descriptions (2-5 lines each) instead of verbose usage docs. The critical one is spawn.txt — it should lead with explicit criteria for when to use pty_spawn vs the built-in bash tool.
Something like:
When to use this tool INSTEAD of the built-in bash tool:
Usepty_spawnfor any task that needs to run in the background, is long-running, requires interactive input later, or should persist beyond the current response. Examples: dev servers, watch modes, REPLs, builds, database servers.
Use the built-inbashtool ONLY for quick synchronous commands that complete immediately (ls, git status, cat, echo, etc.).
The verbose usage/example text currently in the descriptions is redundant — the parameter schemas (Zod) already describe each parameter, and examples are rarely useful for LLMs.
Files to Change
src/plugin/pty/tools/spawn.txt— add decision criteria + shorten significantlysrc/plugin/pty/tools/read.txt— shortensrc/plugin/pty/tools/write.txt— shortensrc/plugin/pty/tools/list.txt— shortensrc/plugin/pty/tools/kill.txt— shorten
Verification
Checked the plugin SDK docs (@opencode-ai/plugin) — there is no hook for injecting separate agent instructions beyond the description field on tool(). Modifying the descriptions is the only viable approach within the current SDK constraints.
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start with the five files in src/plugin/pty/tools/: spawn.txt, read.txt, write.txt, list.txt, and kill.txt, and review how their text is passed through the SDK tool() description field. Shorten each to 2–5 decision-focused lines, with spawn.txt explaining when to use pty_spawn instead of bash. Done means all five descriptions are concise and the SDK limitation is respected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100