GeezerVison is showing github.com — permissions: add time-limited approvals (30m/1h/3h/5h/1d/1w) between once and always · Issue #61465 · anomalyco/opencode
permissions: add time-limited approvals (30m/1h/3h/5h/1d/1w) between once and always #61465DescriptionSummary
The permission prompt only offers once, always, and reject. always writes a durable project-scoped allow rule, so allowing a temporary directory (or any one-off path) for a short while forces a choice between "once" (re-prompts on every call) and "forever" (a permanent rule the user must remember to clean up). Add time-limited approvals as a middle ground: 30m, 1h, 3h, 5h, 1d, 1w.
Environment
- opencode version: 2.0.23
- OS: Windows 11 (Windows_NT 10.0.26200.9711)
- Terminal: desktop app (GUI); terminal environment not applicable
- Shell: C:\WINDOWS\system32\cmd.exe (PowerShell for tooling)
- Install/channel: release, v2.0.23
- Active plugins: [email protected], pty-plugin (local), @plannotator/[email protected], [email protected], opencode-tavily, @firecrawl/[email protected], @cheesecodestudio/opencode-tokenscope-v2, local timed-permissions plugin
Reproduction
- In a session (or a subagent), read a file outside the project directory, e.g.
C:/Users/me/AppData/Local/Temp/opencode/object-counting-002/count-anything/x.png.
- The permission prompt appears with only 拒絕 / 永遠允許 / 允許一次 (reject / always / once).
Expected Behavior
The prompt offers a duration: once, 30m, 1h, 3h, 5h, 1d, 1w, always. always can remain, optionally behind a secondary confirmation.
Actual Behavior
Only once / always / reject. always saves a permanent project-scoped allow rule with no expiration or in-flow revocation.
Additional Context
- Docs (https://opencode.ai/v2/docs/permissions/): clients reply
once, always, reject; saved approvals from always are durable, project-scoped allow rules. No time-limited option is documented.
- Policies have no expiration either (https://opencode.ai/v2/docs/policies/).
- The GUI plugin API (experimental, https://opencode.ai/v2/docs/build/plugins/gui/) has no permission-dialog extension point, so a plugin cannot add these options to the native prompt; this needs a core UI + permission-store change.
- Implementation sketch: store
expiresAt on saved approvals, filter expired entries before evaluation, and expose them through /api/permission/saved so a future settings UI can list and revoke them. The permission.evaluate plugin hook already allows programmatic relaxation, but there is no way for a user to express the duration in the prompt.
- Screenshot of the current prompt available on request (Windows desktop app, Chinese locale).
Activityopencodejr commented on Nov 3, 2026 Thanks for the detailed write-up, @elviswong1013! You'd like the permission prompt to let you approve something for a limited time (30m, 1h, 3h, 5h, 1d, 1w) as a middle ground between Allow once and Always allow, so short-term access, like a temp directory outside the project, doesn't leave a permanent project-wide rule behind.
Right now v2 offers only once, always and reject, and Always allow saves a permanent rule for the project, so this would be a new feature. As you noted, a plugin can't add options to the built-in prompt, and replies have no way to carry a duration, so this needs a change in OpenCode itself. The maintainers will consider it.
Related issues:
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|