Fix: Add sandbox-awareness recovery nudge after repeated tool denials (#5)#6
Conversation
c7f03d0 to
e802a33
Compare
🔍 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
|
|
🕰️ 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. |
🔍 Automated Code ReviewSummaryThe PR cleanly solves the root cause: after repeated permission denials (via Findings✅ Strengths
|
…#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
ffb82b2 to
11bdd31
Compare
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