run: make minimal mode more minimal (#31227)

This commit is contained in:
Simon Klee
2026-06-07 23:26:14 +02:00
committed by GitHub
parent 914a643ab2
commit 07808bea12
39 changed files with 3138 additions and 959 deletions
@@ -31,7 +31,6 @@ import { replayActiveText, replayLocalRows, replaySession } from "./session-repl
import {
bootstrapSubagentCalls,
bootstrapSubagentData,
clearFinishedSubagents,
createSubagentData,
listSubagentPermissions,
listSubagentQuestions,
@@ -57,6 +56,7 @@ import type {
RunInput,
RunPrompt,
RunPromptPart,
RunProvider,
StreamCommit,
} from "./types"
@@ -74,6 +74,7 @@ type StreamInput = {
replay?: boolean
replayLimit?: number
limits: () => Record<string, number>
providers?: () => RunProvider[]
footer: FooterApi
trace?: Trace
signal?: AbortSignal
@@ -712,9 +713,10 @@ function createLayer(input: StreamInput) {
messages: messagesList,
permissions: sessionPermissions,
questions: sessionQuestions,
thinking: input.thinking,
limits: input.limits(),
})
thinking: input.thinking,
limits: input.limits(),
providers: input.providers?.(),
})
: undefined
const replay =
history && input.replayLimit !== undefined && messagesList.length > input.replayLimit
@@ -724,6 +726,7 @@ function createLayer(input: StreamInput) {
questions: sessionQuestions,
thinking: input.thinking,
limits: input.limits(),
providers: input.providers?.(),
})
: history
@@ -751,7 +754,6 @@ function createLayer(input: StreamInput) {
permissions,
questions,
})
clearFinishedSubagents(state.subagent)
for (const request of [
...state.data.permissions,
@@ -1026,6 +1028,7 @@ function createLayer(input: StreamInput) {
questions: sessionQuestions,
thinking: input.thinking,
limits: input.limits(),
providers: input.providers?.(),
})
const activeCommits = replayActiveText(history.data, state.data)
return {
@@ -1043,6 +1046,7 @@ function createLayer(input: StreamInput) {
questions: sessionQuestions,
thinking: input.thinking,
limits: input.limits(),
providers: input.providers?.(),
})
: history,
}
@@ -1195,13 +1199,6 @@ function createLayer(input: StreamInput) {
return
}
const prev = listSubagentTabs(state.subagent)
if (clearFinishedSubagents(state.subagent)) {
const snapshot = currentSubagentState()
traceTabs(input.trace, prev, snapshot.tabs)
syncFooter([], undefined, snapshot)
}
const item: Wait = {
tick: state.tick,
armed: false,