Fix: Add sandbox-awareness recovery nudge after repeated tool denials (#5)#6
Open
github-actions[bot] wants to merge 1 commit intomainfrom
Open
Fix: Add sandbox-awareness recovery nudge after repeated tool denials (#5)#6github-actions[bot] wants to merge 1 commit intomainfrom
github-actions[bot] wants to merge 1 commit intomainfrom
Conversation
…#5) When the agent repeatedly hits permission denials or tool errors, it now receives a nudge after 2 consecutive failures to guide it toward finding an alternative approach within the allowed workspace. Changes: - Track permission denials via permission.replied event - Track tool errors via tool.execute.after hook (permission-related errors) - Reset deny counter when session status transitions to busy - Configurable threshold via OPENCODE_DENY_THRESHOLD env var (default: 2) - Added unit tests covering all acceptance criteria - Import getOrCreateState from throttle.ts (avoid duplication) Fixes #5
c7f03d0 to
e802a33
Compare
Author
🔍 Automated Code ReviewSummaryImplementation correctly addresses the root cause: tracking consecutive permission denials and tool errors, then injecting a sandbox-awareness nudge after the configurable threshold is reached. Findings✅ Strengths
|
5 tasks
Author
|
🕰️ This pull request has been inactive for over 3 days. @tbrandenburg - Could you please review this PR or provide an update on its status? If this PR is no longer needed, please consider closing it to keep the repository clean. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When the agent repeatedly hits permission denials or tool errors (e.g., trying to read files outside the workspace), it now receives a nudge after 2 consecutive failures to guide it toward finding an alternative approach within the allowed workspace.
Root Cause
The agent was not adapting when encountering repeated permission denials, continuing to retry the same failing paths instead of looking for alternatives within the sandbox.
Changes
src/deny-handler.tssrc/deny-handler.test.tssrc/types.tssrc/throttle.tssrc/index.tsTesting
Validation
Issue
Fixes #5
Automated implementation from investigation artifact