Overview
Hi, first of all I want to thank you for developing this package - I've really enjoyed using it over the terminal based opencode UI. Over time I have added a few changes of my own to my locally forked version, so I figured that I would try to upstream some of them to make my life easier and hopefully bring some improvements to other users.
Changes
This PR adds the following changes:
- A transient based permission prompt that can be used by setting
(setopt opencode-transient-permission t)
- Indicators showing permission requests in the session buffer, alongside the approval or denial decision for each
Here are some additional changes that I could open PRs for, please let me know if any of these are of interest. Thanks!
1. opencode-todo.el — Todo sidebar
- Self-contained new file
- Requires only the
todo.updated SSE event hook wired in opencode.el
- Right-side sidebar, live SSE-driven updates, grouped by status with priority indicators
2. Hooks for external integration
- Small additions to
opencode.el
opencode-permission-asked-functions, opencode-question-asked-functions, opencode-session-idle-functions, opencode-session-retry-functions
- High value for users who want to integrate with notification systems, org-mode, etc.
3. Session header line
opencode--header-line, opencode--header-line-face, opencode--session-waiting-p, related faces
- Color-coded by state: blue=busy, yellow=waiting, red=idle
- Shows title, directory, token count, cost
- Touches
opencode-session--set-status and opencode-open-session to wire up header-line-format
- Medium complexity but visible quality-of-life improvement
4. Tool elapsed timers
opencode--start-tool-timer, opencode--stop-tool-timer
- 1-second overlay timer on tool headers, shown after 5s, uses server timestamps for final display
5. Agent session files
- A buffer local list of files
opencode-session-files that the agent has modified
- External code can read or hook into this variable to integrate with other Emacs libraries (e.g. consult, project.el, embark)
## Overview
Hi, first of all I want to thank you for developing this package - I've really enjoyed using it over the terminal based opencode UI. Over time I have added a few changes of my own to my locally forked version, so I figured that I would try to upstream some of them to make my life easier and hopefully bring some improvements to other users.
## Changes
This PR adds the following changes:
1. A transient based permission prompt that can be used by setting `(setopt opencode-transient-permission t)`
2. Indicators showing permission requests in the session buffer, alongside the approval or denial decision for each
---
Here are some additional changes that I could open PRs for, please let me know if any of these are of interest. Thanks!
**1. `opencode-todo.el` — Todo sidebar**
- Self-contained new file
- Requires only the `todo.updated` SSE event hook wired in `opencode.el`
- Right-side sidebar, live SSE-driven updates, grouped by status with priority indicators
**2. Hooks for external integration**
- Small additions to `opencode.el`
- `opencode-permission-asked-functions`, `opencode-question-asked-functions`, `opencode-session-idle-functions`, `opencode-session-retry-functions`
- High value for users who want to integrate with notification systems, org-mode, etc.
**3. Session header line**
- `opencode--header-line`, `opencode--header-line-face`, `opencode--session-waiting-p`, related faces
- Color-coded by state: blue=busy, yellow=waiting, red=idle
- Shows title, directory, token count, cost
- Touches `opencode-session--set-status` and `opencode-open-session` to wire up `header-line-format`
- Medium complexity but visible quality-of-life improvement
**4. Tool elapsed timers**
- `opencode--start-tool-timer`, `opencode--stop-tool-timer`
- 1-second overlay timer on tool headers, shown after 5s, uses server timestamps for final display
**5. Agent session files**
- A buffer local list of files `opencode-session-files` that the agent has modified
- External code can read or hook into this variable to integrate with other Emacs libraries (e.g. consult, project.el, embark)