Uh oh!
There was an error while loading. Please reload this page.
fix: pass arguments to commands without explicit placeholders - #9606
Conversation
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one potentially related PR: Related PR:
No duplicate/competing fixes for this specific issue were found. The search results show #9606 is the only PR addressing the argument passing fix. |
There was a problem hiding this comment.
Pull request overview
This PR enables custom commands without placeholders to automatically receive user arguments, addressing the feature request in #9587. Previously, arguments were silently discarded if a command template didn't include $1, $2, or $ARGUMENTS placeholders.
Changes:
- Modified TUI to parse commands from the first line only and preserve multi-line content in arguments
- Added backend logic to auto-append arguments to command templates when no placeholders are present
- Removed debug console.log statement
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx | Updated command parsing to extract command from first line only and preserve newlines in subsequent argument lines |
| packages/opencode/src/session/prompt.ts | Added logic to detect commands without placeholders and automatically append user arguments to the template |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Fixes#9587
Arguments passed to custom commands were silently ignored if the command template didn't include
$1,$2, or$ARGUMENTSplaceholders. Also adds support for multi-line input after commands.Context: https://x.com/__morse/status/2003830333205323835
Users coming from other tools expect to pass extra content after a command and have it appended to the prompt, like:
Previously this extra content was silently dropped unless the command explicitly used
$ARGUMENTS. Now commands without placeholders will automatically receive user arguments appended to the template.Changes: