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
{{ message }}
Repository navigation
[FEATURE]: session.background on the server plugin session API #62362
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
POST /api/session/:id/background moves a session's blocking shell or subagent call to the background, and the TUI binds it to a key. A server plugin can't call it: the plugin SessionDomain is a Pick of the session API that leaves background out, and a server plugin has no HTTP client.
That blocks a plugin from auto-backgrounding long calls, e.g. a wrapper around the built-in shell tool that races a timer and moves the call to the background after N seconds, so the model gets the output so far and a notice when it ends. The background path matters because it keeps the built-in's job notices, wake-ups and permissions; a plugin can't rebuild those.
Proposal: add background to the Pick, on the Effect and Promise faces:
Today background moves every blocking job of the session. If that's too coarse for plugins, an optional type (or a per-shell ctx.shell.background(id) on the domain proposed in #62361) would let a plugin move only its own call; the core BackgroundAllInput already has a type field.
This is a two-line change; I can open a PR once the shape is OK.
Thanks for the detailed proposal! You're asking for background to be exposed on the server plugin ctx.session API, possibly with a type filter or a per-shell variant, so a plugin can move a long blocking shell or subagent call to the background itself and keep the built-in job notices and wake-ups. You're right that SessionDomain currently picks the session API without background, so a server plugin has no way to do this today. Maintainers will consider it.
Activity
opencodejr commentedon Nov 6, 2026
Thanks for the detailed proposal! You're asking for
backgroundto be exposed on the server pluginctx.sessionAPI, possibly with atypefilter or a per-shell variant, so a plugin can move a long blocking shell or subagent call to the background itself and keep the built-in job notices and wake-ups. You're right thatSessionDomaincurrently picks the session API withoutbackground, so a server plugin has no way to do this today. Maintainers will consider it.Related items:
shellgive up the foreground after 10s, returning the output so far and delivering the final notice through the job service.shelldomain (list/get/output/wait/kill), which would allow the per-shell variant.SessionIdle.background.