-
Notifications
You must be signed in to change notification settings - Fork 6k
fix(opencode): improve tool robustness and session loop stability #8134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
- Make 'description' optional in BashTool and TaskTool with smart fallbacks to prevent validation errors. - Provide explicit feedback for empty outputs in BashTool and ListTool (e.g., '(No files found)') to prevent model confusion. - Refine session loop exit condition: only stop if the model provides text or makes no tool calls, preventing premature exits on 'stop' finish reasons during tool-only turns. - Add enhanced logging for session lifecycle and tool execution debugging.
|
Hey! Your PR title Please update it to start with one of:
Where 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: PR #1333: fix: make description parameter optional in bash tool This PR is relevant because it addresses the same issue mentioned in the current PR (PR #8134) - making the description field optional in the bash tool. However, PR #1333 appears to be older and may be a partial fix for one of the three issues addressed in the current PR. The current PR #8134 is a more comprehensive fix that builds upon this by also handling:
Conclusion: PR #1333 is related but not a duplicate—it's addressing one component that the current PR (8134) handles more comprehensively as part of a larger robustness improvement initiative. |
|
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. |
d6bdebe to
a3b3de6
Compare
This PR significantly improves the reliability and robustness of the AI agent execution loop by addressing three common failure modes where the agent appears to get "stuck" or "idle" without completing its task:
that halted execution. Added smart fallbacks (using the command string or "Task") and improved error formatting for tool validation.
prevents models from interpreting silence as an environment failure or a signal to stop.
made in the turn. Previously, the loop would exit purely based on the provider's finishReason: "stop", which often occurs after tool-only turns before the model has a chance to summarize or reply.
How did you verify your code works?
(tool-only turns).
Fixes #6244
Fixes #6838