feat(tui): allow backgrounding synchronous subagents (#30488)

This commit is contained in:
Kit Langton 2026-06-04 23:40:52 -04:00 committed by GitHub
commit 3003867c25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 527 additions and 35 deletions

View file

@ -44,6 +44,8 @@ import type {
ExperimentalProjectCopyRemoveResponses,
ExperimentalResourceListErrors,
ExperimentalResourceListResponses,
ExperimentalSessionBackgroundErrors,
ExperimentalSessionBackgroundResponses,
ExperimentalSessionListErrors,
ExperimentalSessionListResponses,
ExperimentalWorkspaceAdapterListErrors,
@ -733,6 +735,42 @@ export class Session extends HeyApiClient {
...params,
})
}
/**
* Background subagents
*
* Detach any synchronous subagents currently blocking the session and continue them in the background.
*/
public background<ThrowOnError extends boolean = false>(
parameters: {
sessionID: string
directory?: string
workspace?: string
},
options?: Options<never, ThrowOnError>,
) {
const params = buildClientParams(
[parameters],
[
{
args: [
{ in: "path", key: "sessionID" },
{ in: "query", key: "directory" },
{ in: "query", key: "workspace" },
],
},
],
)
return (options?.client ?? this.client).post<
ExperimentalSessionBackgroundResponses,
ExperimentalSessionBackgroundErrors,
ThrowOnError
>({
url: "/experimental/session/{sessionID}/background",
...options,
...params,
})
}
}
export class Resource extends HeyApiClient {

View file

@ -5850,6 +5850,38 @@ export type ExperimentalSessionListResponses = {
export type ExperimentalSessionListResponse = ExperimentalSessionListResponses[keyof ExperimentalSessionListResponses]
export type ExperimentalSessionBackgroundData = {
body?: never
path: {
sessionID: string
}
query?: {
directory?: string
workspace?: string
}
url: "/experimental/session/{sessionID}/background"
}
export type ExperimentalSessionBackgroundErrors = {
/**
* BadRequest | InvalidRequestError
*/
400: EffectHttpApiErrorBadRequest | InvalidRequestError
}
export type ExperimentalSessionBackgroundError =
ExperimentalSessionBackgroundErrors[keyof ExperimentalSessionBackgroundErrors]
export type ExperimentalSessionBackgroundResponses = {
/**
* Backgrounded subagents
*/
200: boolean
}
export type ExperimentalSessionBackgroundResponse =
ExperimentalSessionBackgroundResponses[keyof ExperimentalSessionBackgroundResponses]
export type ExperimentalResourceListData = {
body?: never
path?: never