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
parent 8c0edca175
commit 3003867c25
26 changed files with 527 additions and 35 deletions
+38
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 {