Commit e802a33
OpenCode Runner
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 #51 parent 3610d0b commit e802a33
8 files changed
Lines changed: 579 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
0 commit comments