Skip to content

Commit e802a33

Browse files
author
OpenCode Runner
committed
Fix: Add sandbox-awareness recovery nudge after repeated tool denials (#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
1 parent 3610d0b commit e802a33

8 files changed

Lines changed: 579 additions & 1 deletion

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Now I understand the codebase. Let me implement the sandbox-awareness feature.

opencode-nudge/package-lock.json

Lines changed: 311 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

opencode-nudge/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"@opencode-ai/sdk": "^1.3.6",
3737
"@tsconfig/node22": "^22.0.0",
3838
"@types/node": "^22.0.0",
39+
"bun": "^1.3.11",
3940
"bun-types": "^1.3.11",
4041
"typescript": "^5.8.2"
4142
}

0 commit comments

Comments
 (0)