You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Output, Edit with agent copies a prompt to the clipboard. Then I switch to my agent, paste it, and type what I want. Hex already talks to the running OpenCode service, so the copy-paste step feels like a detour.
Platform: macOS.
What would help?
Let Edit with agent hand the prompt straight to OpenCode: start a session with the same prompt agent_prompt() builds today (in rune_ui/output.rs), then bring that session to the front so I can type "what I want".
Hex already has most of the pieces:
desktop/opencode_service finds the running service and talks to it over authenticated loopback HTTP.
Annotate already delivers prompts into OpenCode sessions (capture_host/routing.rs, through scrawl_capture::delivery), so there's a precedent for sending to a session.
Some details I'd expect:
Always start a new session. Don't reuse a recent one, so the prompt never lands in the middle of unrelated work.
When OpenCode isn't running, fall back to today's copy behavior. The pane already shows "OpenCode isn't running" in other places.
Keep a plain "Copy prompt" option for people who use another agent.
Behind a Labs toggle, off by default, and macOS first is fine.
Open question for you: which directory should the session start in? settings.json lives in Application Support, while hex.config.ts lives in ~/.config/hex.
makes sense as a labs toggle on macos, and the plumbing to reach a running opencode exists in desktop/opencode_service. today edit with agent only copies a prompt that points the agent at hex settings get/set dictation_processing, and annotate only posts into sessions that already exist through scrawl's router, it never creates one or focuses anything. so the new parts are creating a session and showing it, and hex has neither.
hex can talk to the opencode service but has no way to bring a session to the front in the tui, desktop app or web.
the prompt ends at "what i want: ", so sending it as-is starts the agent on an empty request unless the text can be placed in the input box without sending it.
agents.md lists exactly which features may touch opencode, so this needs to be added to that list, and the session needs a working directory, which hex doesn't have for settings edits.
which opencode client do you use (tui, desktop app or web)? that decides what bringing it to the front can mean.
would it be enough to open a fresh session with the prompt already in the input box, not sent, in your home folder or hex's own opencode workspace?
I use both: the desktop app and the TUI. Opening the new session in whichever one is running would be ideal, desktop app first if both are open. If that's too much for a first version, picking one is fine.
And yes, a fresh session with the prompt already in the input box, not sent, is enough. Hex's own OpenCode workspace sounds like the right working directory, since it keeps settings edits out of my projects.
I dug into what OpenCode already offers for "fresh session with the prompt typed in, not sent". It looks like most of it exists already.
Desktop app. OpenCode's app source parses opencode://new-session?directory=<dir>&prompt=<text> (packages/app/src/pages/layout/deep-links.ts), and the app registers the opencode URL scheme. For Hex on macOS, that would be a single open "opencode://new-session?…", which also covers bringing the session to the front.
I tested it on macOS with OpenCode desktop 2.0.24, running:
open "opencode://new-session?directory=$HOME&prompt=hello%20from%20hex"
The app came to the front, both when it was starting cold and when it was already open. But it stayed on my last-used project with an empty input box: the directory and prompt were ignored, and nothing was sent. The app shows an update available, so the handler in the current source may simply be newer than 2.0.24. I didn't update to check.
TUI.POST /tui/append-prompt inserts text into the prompt box without submitting it. The tui.prompt.append handler calls input.insertText and never submits, so filling the prompt without sending it is already supported through the service Hex talks to. Creating a session in a new terminal window is the part Hex would still have to do itself.
GUI plugins also have ctx.layout.draft({ directory, prompt }) ("prompt filled in for the user to review and send"), which is exactly this behavior, if the deep link were wired to it.
So a macOS-first version could be: Edit with agent opens opencode://new-session in Hex's OpenCode workspace with the prompt as an unsent draft, and falls back to today's copy behavior when that fails. Whether the link drafts or sends the prompt in current builds is worth confirming on your side.
Retested after updating OpenCode desktop to 2.2.5 (macOS). Same result as 2.0.24:
open "opencode://new-session?directory=$HOME&prompt=hello%20from%20hex"
open "opencode://new-session?directory=$HOME/code/hex&prompt=hello%20from%20hex"
Both bring the app to the front and land on an empty new-session view in my last-used project. directory is ignored even when it's a git repo, prompt isn't put in the input box, and nothing is sent.
So the new-session deep link isn't usable for this today. The app source parses directory and prompt in deep-links.ts, so it looks like the handler drops them somewhere after parsing, which is probably worth an OpenCode issue of its own. Until that's fixed, the TUI's /tui/append-prompt is the only working way I found to put a prompt in the box without sending it.
The deep link problem is tracked in OpenCode as anomalyco/opencode#55106: the v2 desktop app only handles opencode://console/authorized and ignores new-session. I added the 2.2.5 repro and this use case there.
Activity
thdxr commentedon Nov 1, 2026
makes sense as a labs toggle on macos, and the plumbing to reach a running opencode exists in desktop/opencode_service. today edit with agent only copies a prompt that points the agent at
hex settings get/set dictation_processing, and annotate only posts into sessions that already exist through scrawl's router, it never creates one or focuses anything. so the new parts are creating a session and showing it, and hex has neither.hex can talk to the opencode service but has no way to bring a session to the front in the tui, desktop app or web.
the prompt ends at "what i want: ", so sending it as-is starts the agent on an empty request unless the text can be placed in the input box without sending it.
agents.md lists exactly which features may touch opencode, so this needs to be added to that list, and the session needs a working directory, which hex doesn't have for settings edits.
which opencode client do you use (tui, desktop app or web)? that decides what bringing it to the front can mean.
would it be enough to open a fresh session with the prompt already in the input box, not sent, in your home folder or hex's own opencode workspace?
— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊
ahatzz11 commentedon Nov 1, 2026
I use both: the desktop app and the TUI. Opening the new session in whichever one is running would be ideal, desktop app first if both are open. If that's too much for a first version, picking one is fine.
And yes, a fresh session with the prompt already in the input box, not sent, is enough. Hex's own OpenCode workspace sounds like the right working directory, since it keeps settings edits out of my projects.
ahatzz11 commentedon Nov 1, 2026
I dug into what OpenCode already offers for "fresh session with the prompt typed in, not sent". It looks like most of it exists already.
Desktop app. OpenCode's app source parses
opencode://new-session?directory=<dir>&prompt=<text>(packages/app/src/pages/layout/deep-links.ts), and the app registers theopencodeURL scheme. For Hex on macOS, that would be a singleopen "opencode://new-session?…", which also covers bringing the session to the front.I tested it on macOS with OpenCode desktop 2.0.24, running:
The app came to the front, both when it was starting cold and when it was already open. But it stayed on my last-used project with an empty input box: the
directoryandpromptwere ignored, and nothing was sent. The app shows an update available, so the handler in the current source may simply be newer than 2.0.24. I didn't update to check.TUI.
POST /tui/append-promptinserts text into the prompt box without submitting it. Thetui.prompt.appendhandler callsinput.insertTextand never submits, so filling the prompt without sending it is already supported through the service Hex talks to. Creating a session in a new terminal window is the part Hex would still have to do itself.GUI plugins also have
ctx.layout.draft({ directory, prompt })("prompt filled in for the user to review and send"), which is exactly this behavior, if the deep link were wired to it.So a macOS-first version could be: Edit with agent opens
opencode://new-sessionin Hex's OpenCode workspace with the prompt as an unsent draft, and falls back to today's copy behavior when that fails. Whether the link drafts or sends the prompt in current builds is worth confirming on your side.ahatzz11 commentedon Nov 1, 2026
Retested after updating OpenCode desktop to 2.2.5 (macOS). Same result as 2.0.24:
Both bring the app to the front and land on an empty new-session view in my last-used project.
directoryis ignored even when it's a git repo,promptisn't put in the input box, and nothing is sent.So the
new-sessiondeep link isn't usable for this today. The app source parsesdirectoryandpromptindeep-links.ts, so it looks like the handler drops them somewhere after parsing, which is probably worth an OpenCode issue of its own. Until that's fixed, the TUI's/tui/append-promptis the only working way I found to put a prompt in the box without sending it.ahatzz11 commentedon Nov 1, 2026
The deep link problem is tracked in OpenCode as anomalyco/opencode#55106: the v2 desktop app only handles
opencode://console/authorizedand ignoresnew-session. I added the 2.2.5 repro and this use case there.