t1085: Fix --format text -> --format default for opencode run in AI reasoning#1642
t1085: Fix --format text -> --format default for opencode run in AI reasoning#1642marcusquinn merged 1 commit intomainfrom
Conversation
opencode run only accepts --format default or --format json. Using --format text caused the CLI to print help and exit with an error, resulting in 0-byte AI responses for every reasoning cycle. The prompt was being sent correctly (15KB+) but the response was always empty because the command never ran.
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug that prevented AI reasoning cycles from completing successfully. By correcting a single command-line argument from Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Wed Feb 18 14:15:18 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
There was a problem hiding this comment.
Code Review
This pull request correctly fixes a bug where an invalid --format argument was passed to the opencode run command, causing AI reasoning cycles to fail. While the fix is correct, the underlying issue of silent error handling remains. I've added a comment to address this by removing the error suppression (2>/dev/null), which will make the script more robust and easier to debug in the future, in alignment with the repository's style guide.
| --format text \ | ||
| --format default \ | ||
| --title "ai-supervisor-${timestamp}" \ | ||
| "$full_prompt" 2>/dev/null || echo "") |
There was a problem hiding this comment.
As you noted in the PR description, 2>/dev/null here silently swallows errors, which was the root cause of this bug going undetected. This also violates the repository style guide which prohibits blanket error suppression.
To make future failures easier to diagnose, please remove the 2>/dev/null redirection. This will allow stderr from the failed command to be printed, while still preserving the behavior of setting ai_result to an empty string on failure.
| "$full_prompt" 2>/dev/null || echo "") | |
| "$full_prompt" || echo "" |
References
- The style guide (line 50) prohibits blanket error suppression with
2>/dev/null. It is only acceptable when redirecting to a log file. (link)



Summary
opencode runonly accepts--format defaultor--format json—--format textis invalid--format text, the CLI prints help text and exits with an error, which2>/dev/null || echo ""silently swallowsEvidence
10 consecutive reasoning cycles all show:
The context was being built correctly (15KB+), the prompt was being logged, but the AI CLI never actually ran.
Fix
One-character change:
--format text→--format defaultVerification
Tested
opencode run --format defaultmanually — returns actual AI response. Testedopencode run --format text— prints help and exits.