feat(mini): migrate mini to v2 (#34895)

feat(run): migrate non-interactive prompts to V2
feat(run): route mini prompts through V2
fix(run): use current session contracts
fix(run): fix V2 prompt turns
feat(cli): add mini subcommand
feat(run): use settled execution events
fix(run): handle remote prompt file attachments
feat(run): send prompt files as attachments
feat(run): use current APIs for run state
fix(run): adopt app-node runtime deps
feat(run): track subagent sessions
feat(run): move catalogs and default model onto current APIs
This commit is contained in:
Simon Klee
2026-07-02 12:06:49 +02:00
committed by GitHub
parent 7ac6e9dc79
commit 3e36163298
61 changed files with 5203 additions and 7105 deletions
@@ -34,6 +34,8 @@ type OpenApiSchema = {
additionalProperties?: OpenApiSchema | boolean
allOf?: OpenApiSchema[]
anyOf?: OpenApiSchema[]
contentMediaType?: string
contentSchema?: OpenApiSchema
description?: string
enum?: Array<string | boolean>
items?: OpenApiSchema
@@ -97,6 +99,7 @@ function matchLegacyOpenApi(input: Record<string, unknown>) {
}
normalizeComponentNames(spec)
collapseDuplicateComponents(spec)
normalizeV2EventSchemas(spec)
applyLegacySchemaOverrides(spec)
normalizeComponentDescriptions(spec)
addLegacyErrorSchemas(spec)
@@ -229,6 +232,16 @@ function collapseDuplicateComponents(spec: OpenApiSpec) {
}
}
function normalizeV2EventSchemas(spec: OpenApiSpec) {
const schemas = spec.components?.schemas
if (!schemas?.V2Event1?.anyOf || schemas.V2Event?.type !== "string") return
schemas.V2EventStream = schemas.V2Event
rewriteRefs(spec, "V2Event", "V2EventStream")
schemas.V2Event = schemas.V2Event1
delete schemas.V2Event1
rewriteRefs(spec, "V2Event1", "V2Event")
}
function normalizeComponentNames(spec: OpenApiSpec) {
const schemas = spec.components?.schemas
if (!schemas) return
@@ -66,6 +66,7 @@ import { SessionProjector } from "@opencode-ai/core/session/projector"
import { SessionV2 } from "@opencode-ai/core/session"
import { SessionExecution } from "@opencode-ai/core/session/execution"
import * as SessionExecutionLocal from "@opencode-ai/core/session/execution/local"
import { PluginRuntime } from "@opencode-ai/core/plugin/runtime"
import { lazy } from "@/util/lazy"
import { CorsConfig, isAllowedCorsOrigin, type CorsOptions } from "@opencode-ai/server/cors"
import { serveUIEffect } from "@/server/shared/ui"
@@ -297,8 +298,11 @@ export function createRoutes(
Layer.provide(sessionLocationLayer),
Layer.provide(locationLayer),
Layer.provide(PtyEnvironment.layer),
// PluginRuntime.providerNode shares this build so plugin tools (subagent,
// shell jobs) capture the same SessionV2/Job instances the handlers use.
// Without it the plugin runtime cell stays empty and subagents cannot spawn.
Layer.provide(
AppNodeBuilderV1.build(SessionV2.node, [
AppNodeBuilderV1.build(LayerNode.group([SessionV2.node, PluginRuntime.providerNode]), [
[LocationServiceMap.node, locationServiceMapV2],
[SessionExecution.node, SessionExecutionLocal.node],
]),