feat(tui): allow backgrounding synchronous subagents (#30488)
This commit is contained in:
@@ -2,6 +2,7 @@ import { AccountID, OrgID } from "@/account/schema"
|
||||
import { MCP } from "@/mcp"
|
||||
|
||||
import { Session } from "@/session/session"
|
||||
import { SessionID } from "@/session/schema"
|
||||
import { Worktree } from "@/worktree"
|
||||
import { NonNegativeInt } from "@opencode-ai/core/schema"
|
||||
import { Schema } from "effect"
|
||||
@@ -91,6 +92,7 @@ export const ExperimentalPaths = {
|
||||
worktree: "/experimental/worktree",
|
||||
worktreeReset: "/experimental/worktree/reset",
|
||||
session: "/experimental/session",
|
||||
sessionBackground: "/experimental/session/:sessionID/background",
|
||||
resource: "/experimental/resource",
|
||||
} as const
|
||||
|
||||
@@ -215,6 +217,19 @@ export const ExperimentalApi = HttpApi.make("experimental")
|
||||
"Get a list of all OpenCode sessions across projects, sorted by most recently updated. Archived sessions are excluded by default.",
|
||||
}),
|
||||
),
|
||||
HttpApiEndpoint.post("sessionBackground", ExperimentalPaths.sessionBackground, {
|
||||
params: { sessionID: SessionID },
|
||||
query: WorkspaceRoutingQuery,
|
||||
success: described(Schema.Boolean, "Backgrounded subagents"),
|
||||
error: HttpApiError.BadRequest,
|
||||
}).annotateMerge(
|
||||
OpenApi.annotations({
|
||||
identifier: "experimental.session.background",
|
||||
summary: "Background subagents",
|
||||
description:
|
||||
"Detach any synchronous subagents currently blocking the session and continue them in the background.",
|
||||
}),
|
||||
),
|
||||
HttpApiEndpoint.get("resource", ExperimentalPaths.resource, {
|
||||
query: WorkspaceRoutingQuery,
|
||||
success: described(Schema.Record(Schema.String, MCP.Resource), "MCP resources"),
|
||||
|
||||
Reference in New Issue
Block a user