The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
fix(workflow): Neustart-Fix erreicht jetzt den Renderpfad, echte Obergrenze ohne Rateflag
purpleba0864fc2f41
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 5b6c62ab..838d6cf7 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -202,12 +202,11 @@ installs stop losing environment variables to it.listed as waiting, running, done or failed, each finished step's result, andthe currently running step's answer streaming in live. Before this it showedno more than three static dots for the whole run, sometimes several minutes,- with no way to tell it was still working. A model step also now carries a- real upper bound on how long it may reason before it must answer, the same- way a normal chat turn already does, instead of only being able to lean on a- thinking-off preference that some models ignore; Stop now always leaves the- block honestly marked "Stopped" instead of stuck on a spinner forever, and- the same fix applies if the app was closed mid-run.+ with no way to tell it was still working. A model step also now has an+ upper bound on how long it may reason before it must answer. Stop ends the+ progress block visibly instead of leaving it looking like it is still+ running, whether Stop was pressed mid-run or the app was closed and+ reopened partway through.## [3.0.0] - 2026-09-13diff --git a/src/api/providers/__tests__/openai-probe-guards.test.ts b/src/api/providers/__tests__/openai-probe-guards.test.tsindex 43650e4b..482f3fdb 100644--- a/src/api/providers/__tests__/openai-probe-guards.test.ts+++ b/src/api/providers/__tests__/openai-probe-guards.test.ts@@ -106,6 +106,50 @@ describe('the side probes on the send path are bounded and cancellable', () => {expect(body).not.toHaveProperty('max_tokens')})+ it('a caller-side maxTokens DEFAULT stays off the wire when the window is not derivable (Runde 3 klein 1)', async () => {+ // bau/wfprogress.md Runde 3, klein 1 (review-wfprogress.md): a workflow+ // prompt step's own fallback (DEFAULT_PROMPT_STEP_MAX_TOKENS = 8192) is+ // not "ein ausdruecklicher Wunsch des Nutzers": sending it here would be+ // exactly the GH #129 failure again, an unmeasured number presented to+ // the server as a real budget. `maxTokensIsDefault: true` is how a+ // caller says "this is only MY fallback, not the user's own value".+ const provider = new OpenAIProvider(lanConfig(1304))+ localFetch.mockRejectedValue(Object.assign(new Error('Aborted'), { name: 'AbortError' }))+ localFetchStream.mockResolvedValue(new Response(+ 'data: {"choices":[{"delta":{"content":"Hi"}}]}\n\ndata: [DONE]\n\n',+ { status: 200 },+ ))++ await drain(provider.chatStream(+ 'some-unknown-local-model-d',+ [{ role: 'user', content: 'hi' }],+ { maxTokens: 8192, maxTokensIsDefault: true },+ ))++ const body = JSON.parse(String(localFetchStream.mock.calls[0][1].body))+ expect(body).not.toHaveProperty('max_tokens')+ })++ it('NEGATIVKONTROLLE: without maxTokensIsDefault, that same fallback value WOULD have gone out unclamped', async () => {+ // Same setup as the test above, but omitting the new flag reproduces the+ // exact regression it fixes: an unmeasured number reaching the wire.+ const provider = new OpenAIProvider(lanConfig(1305))+ localFetch.mockRejectedValue(Object.assign(new Error('Aborted'), { name: 'AbortError' }))+ localFetchStream.mockResolvedValue(new Response(+ 'data: {"choices":[{"delta":{"content":"Hi"}}]}\n\ndata: [DONE]\n\n',+ { status: 200 },+ ))++ await drain(provider.chatStream(+ 'some-unknown-local-model-e',+ [{ role: 'user', content: 'hi' }],+ { maxTokens: 8192 },+ ))++ const body = JSON.parse(String(localFetchStream.mock.calls[0][1].body))+ expect(body.max_tokens).toBe(8192)+ })+it('a probed window still wins over the name heuristic', async () => {const provider = new OpenAIProvider(lanConfig(1303))localFetch.mockResolvedValue(diff --git a/src/api/providers/openai-provider.ts b/src/api/providers/openai-provider.tsindex f31d2506..7b07d700 100644--- a/src/api/providers/openai-provider.ts+++ b/src/api/providers/openai-provider.ts@@ -749,7 +749,12 @@ export class OpenAIProvider implements ProviderClient {* Fenster ist gemessen, also bleibt die Rechnung unten.*/if (!derivable || ctxLen <= 0) {- if (requested > 0) body.max_tokens = requested+ // Runde 3 klein 1 (bau/wfprogress.md): a caller's own FALLBACK default+ // (workflow-engine.ts's DEFAULT_PROMPT_STEP_MAX_TOKENS, sent when the+ // user set nothing) is not the "ausdruecklicher Wunsch des Nutzers"+ // this branch exists to trust; only a real one still passes through+ // unclamped here, same as before this field existed.+ if (requested > 0 && !options?.maxTokensIsDefault) body.max_tokens = requestedelse delete body.max_tokensreturn}diff --git a/src/api/providers/types.ts b/src/api/providers/types.tsindex 99e83f31..712e28db 100644--- a/src/api/providers/types.ts+++ b/src/api/providers/types.ts@@ -175,6 +175,20 @@ export interface ChatOptions {// an extension field, the same way it already sends top_p.topK?: numbermaxTokens?: number+ /**+ * True when `maxTokens` above is THIS caller's own fallback default, not a+ * value the user actually typed into a slider (bau/wfprogress.md Runde 3,+ * klein 1: `workflow-engine.ts`'s `DEFAULT_PROMPT_STEP_MAX_TOKENS` sets+ * this). `openai-provider.ts`'s `applyMaxTokens` reserves its unmeasured-+ * context branch (GH #129: "ein ausdruecklicher Wunsch des Nutzers geht+ * weiterhin raus... ohne einen solchen bleibt das Feld WEG") for a real+ * user wish only; without this flag a caller's own default would look+ * exactly like one and could get sent uncapped to a server whose real+ * window nobody measured. Every existing caller leaves this unset, so+ * `requested > 0` alone keeps meaning "the user asked for this" for them,+ * same as before this field existed.+ */+ maxTokensIsDefault?: booleanthinking?: boolean // Enable model thinking/reasoning mode/*** Which rung of the reasoning ladder to ask for while thinking is ondiff --git a/src/lib/release-notes.ts b/src/lib/release-notes.tsindex c98a26e1..0735cac1 100644--- a/src/lib/release-notes.ts+++ b/src/lib/release-notes.ts@@ -289,7 +289,7 @@ export const RELEASE_NOTES: ReleaseNote[] = [},{title: 'Running a workflow from chat now shows its progress, step by step.',- detail: 'Running a workflow from chat ("run workflow ...") now shows its own progress, clickable and expandable exactly like a tool call: every step listed as waiting, running, done or failed, each finished step\'s result, and the currently running step\'s answer streaming in live. Before this it showed no more than three static dots for the whole run, sometimes several minutes, with no way to tell it was still working. A model step also now carries a real upper bound on how long it may reason before it must answer, the same way a normal chat turn already does, instead of only being able to lean on a thinking-off preference that some models ignore; Stop now always leaves the block honestly marked "Stopped" instead of stuck on a spinner forever, and the same fix applies if the app was closed mid-run.',+ detail: 'Running a workflow from chat ("run workflow ...") now shows its own progress, clickable and expandable exactly like a tool call: every step listed as waiting, running, done or failed, each finished step\'s result, and the currently running step\'s answer streaming in live. Before this it showed no more than three static dots for the whole run, sometimes several minutes, with no way to tell it was still working. A model step also now has an upper bound on how long it may reason before it must answer. Stop ends the progress block visibly instead of leaving it looking like it is still running, whether Stop was pressed mid-run or the app was closed and reopened partway through.',},],},diff --git a/src/lib/workflow-engine.ts b/src/lib/workflow-engine.tsindex 1cc16dd8..687bd685 100644--- a/src/lib/workflow-engine.ts+++ b/src/lib/workflow-engine.ts@@ -737,12 +737,18 @@ export class WorkflowEngine {const canThinkStep = stepThinkMode ? stepThinkMode === 'toggle' : isThinkingCompatible(activeModel)const effortLevels = modelMeta && 'effortLevels' in modelMeta ? modelMeta.effortLevels : undefinedconst effortDefault = modelMeta && 'effortDefault' in modelMeta ? modelMeta.effortDefault : undefined+ const userSetMaxTokens = sampling.maxTokens && sampling.maxTokens > 0const reasoningOptions = {thinking: canThinkStep ? false : undefined,reasoningEffort: settings.reasoningEffort,effortLevels,effortDefault,- maxTokens: sampling.maxTokens && sampling.maxTokens > 0 ? sampling.maxTokens : DEFAULT_PROMPT_STEP_MAX_TOKENS,+ maxTokens: userSetMaxTokens ? sampling.maxTokens : DEFAULT_PROMPT_STEP_MAX_TOKENS,+ // Runde 3 klein 1 (bau/wfprogress.md): tells openai-provider.ts's+ // unmeasured-context branch this is OUR fallback, not something the+ // user typed, so it stays off the wire there instead of being sent+ // uncapped to a server whose real window was never measured.+ maxTokensIsDefault: !userSetMaxTokens,}let output = ''diff --git a/src/lib/workflow-progress-view.ts b/src/lib/workflow-progress-view.tsindex fdff581f..8b787772 100644--- a/src/lib/workflow-progress-view.ts+++ b/src/lib/workflow-progress-view.ts@@ -114,14 +114,70 @@ export function isWorkflowProgressToolName(name: string): boolean {* again on an already-fixed block is harmless: it only touches blocks that* are BOTH a workflow-progress block AND still 'running'.*+ * `workflowName`, when known (Runde 3 klein 2, review-wfprogress.md: the+ * generic "Workflow stopped before finishing" this used to write lost which+ * workflow it even was), is folded into the new label. Never available from+ * `call` itself: while a step is running, `toolName` is only ever "Step N of+ * M: <step label>" (`workflowProgressHeader`), the workflow's own NAME lives+ * on the parent chat message instead (`extractWorkflowNameFromProgressMessage`+ * below) - callers pass it through when they have it, and this still degrades+ * to the generic label when they do not.+ ** Mutates `call` in place (matching `migrateBlockInPlace`'s own style) and* returns whether it changed anything, mainly so callers/tests can assert* on it directly.*/-export function markStaleWorkflowProgressStopped(call: { toolName: string; status: string }): boolean {+export function markStaleWorkflowProgressStopped(call: { toolName: string; status: string }, workflowName?: string): boolean {if (call.status !== 'running') return falseif (!isWorkflowProgressToolName(call.toolName)) return falsecall.status = 'stopped'- call.toolName = 'Workflow stopped before finishing'+ call.toolName = workflowName ? `Workflow: ${workflowName} (stopped before finishing)` : 'Workflow stopped before finishing'return true}++/**+ * Pulls the workflow's name back out of the chat trigger's own leading+ * message ("Running workflow: **<name>**", `useAgentChat.ts`), the only+ * place that name is written down anywhere near this block. Returns+ * undefined for anything else (a normal chat message, a missing/blank+ * content), which is exactly when `markStaleWorkflowProgressStopped` above+ * falls back to its generic label.+ */+export function extractWorkflowNameFromProgressMessage(content: unknown): string | undefined {+ if (typeof content !== 'string') return undefined+ const match = content.match(/^Running workflow: \*\*(.+?)\*\*/)+ return match?.[1]+}++/**+ * bau/wfprogress.md Runde 3, B2 (review-wfprogress.md): the chat surface+ * (`MessageBubble.tsx` -> `groupAgentBlocks`, `tool-call-groups.ts` lines+ * 59-68) reads ONLY the legacy singular `block.toolCall`, never `toolCalls`.+ * A workflow-progress block writes both fields to the SAME object while the+ * run is live (`useAgentChat.ts`'s `pushProgressBlock`), but a JSON persist+ * round-trip (save, then a later load) turns them into two SEPARATE objects+ * with the same starting content. `migratePersistedChat` used to call+ * `markStaleWorkflowProgressStopped` only through `getBlockToolCalls(block)`,+ * which returns `toolCalls` whenever it is populated and never `toolCall` in+ * that case - so the fix landed on the one field nothing renders, and the+ * spinner it was meant to kill stayed on screen after every restart (Opus's+ * own measurement: `toolCalls[0].status = stopped` right next to+ * `toolCall.status = running`, and the chat rendered `running`).+ *+ * Rewrites BOTH slots directly instead of going through `getBlockToolCalls`,+ * so whichever one (or both) a persisted block happens to carry gets fixed.+ * Idempotent and safe on a normal tool-call block for the same reason+ * `markStaleWorkflowProgressStopped` is: it is a no-op unless BOTH the name+ * looks like a workflow-progress block AND the status is still 'running'.+ */+export function markStaleWorkflowProgressStoppedOnBlock(+ block: { toolCall?: { toolName: string; status: string }; toolCalls?: Array<{ toolName: string; status: string }> },+ workflowName?: string,+): boolean {+ let changed = false+ if (block.toolCall && markStaleWorkflowProgressStopped(block.toolCall, workflowName)) changed = true+ for (const tc of block.toolCalls ?? []) {+ if (markStaleWorkflowProgressStopped(tc, workflowName)) changed = true+ }+ return changed+}diff --git a/src/stores/__tests__/chatStore-migration.test.ts b/src/stores/__tests__/chatStore-migration.test.tsindex 27a597e5..7868d68f 100644--- a/src/stores/__tests__/chatStore-migration.test.ts+++ b/src/stores/__tests__/chatStore-migration.test.ts@@ -1,5 +1,7 @@import { describe, it, expect } from 'vitest'import { migratePersistedChat } from '../chatStore'+import { groupAgentBlocks } from '../../lib/tool-call-groups'+import { markStaleWorkflowProgressStoppedOnBlock } from '../../lib/workflow-progress-view'import type { AgentBlock, AgentToolCall } from '../../types/agent-mode'const legacyCall: AgentToolCall = {@@ -186,21 +188,35 @@ describe('chatStore — migratePersistedChat', () => {expect(result.conversations[0].messages[0].content).toBe('hi')})- // review-wfprogress.md, BLOCKER (Runde 2), app-restart case: the app can- // be closed mid-workflow-run, which persists a progress block whose- // `status` is still 'running': no process survives a restart to ever- // move it out of that state, so on the NEXT load (this migration, which- // runs on every load) it must be rewritten as honestly 'stopped' instead- // of showing a spinner for a run that provably is not happening.- describe('markiert einen ueber den Neustart hinweg "running" gebliebenen Workflow-Block als "stopped"', () => {- it('bei einem einzelnen Fortschrittsblock', () => {- const staleProgressCall: AgentToolCall = {- id: 'p1',- toolName: 'Step 2 of 3: Summarize',- args: {},- status: 'running',- timestamp: 1,- }+ // review-wfprogress.md, BLOCKER (Runde 2 -> B2 in Runde 3), app-restart+ // case: the app can be closed mid-workflow-run, which persists a progress+ // block whose `status` is still 'running': no process survives a restart+ // to ever move it out of that state, so on the NEXT load (this migration,+ // which runs on every load) it must be rewritten as honestly 'stopped'+ // instead of showing a spinner for a run that provably is not happening.+ //+ // B2 (Runde 3): `MessageBubble.tsx` -> `groupAgentBlocks`+ // (tool-call-groups.ts) reads ONLY the legacy singular `block.toolCall`,+ // never `toolCalls`. A live progress block writes both fields to the SAME+ // object, but a JSON persist round-trip (save, then a later load) turns+ // them into two SEPARATE objects with equal starting content, so a fix+ // that only rewrote `toolCalls` (Runde 2) never reached the screen. Every+ // test below therefore constructs `toolCall` and `toolCalls[0]` as two+ // DISTINCT objects, exactly what `coalescedJSONStorage` produces, and+ // asserts through `groupAgentBlocks` itself, the same function+ // `MessageBubble` calls to decide what to render, not through either raw+ // field directly.+ describe('markiert einen ueber den Neustart hinweg "running" gebliebenen Workflow-Block als "stopped" (B2: auch am Renderpfad)', () => {+ /** Builds the block the way a JSON persist round-trip actually leaves+ * it: `toolCall` and `toolCalls[0]` carry the same content but are two+ * separate object instances, never the same reference. */+ function persistedProgressBlock(toolName: string, status: string) {+ const toolCall = { id: 'p1', toolName, args: {}, status, timestamp: 1 }+ const toolCalls = [{ id: 'p1', toolName, args: {}, status, timestamp: 1 }]+ return { id: 'b1', phase: 'tool_call', content: toolName, timestamp: 1, toolCall, toolCalls }+ }++ it('bei einem einzelnen Fortschrittsblock, GEPRUEFT ueber groupAgentBlocks (den echten Renderpfad)', () => {const state = {conversations: [{@@ -208,50 +224,74 @@ describe('chatStore — migratePersistedChat', () => {messages: [{id: 'm1',- agentBlocks: [- { id: 'b1', phase: 'tool_call', content: '', timestamp: 1, toolCalls: [staleProgressCall] },- ],+ content: 'Running workflow: **Research Topic**',+ agentBlocks: [persistedProgressBlock('Step 2 of 3: Summarize', 'running')],},],},],}const result = migrated(state)- const tc = result.conversations[0].messages[0].agentBlocks![0].toolCalls![0]- expect(tc.status).toBe('stopped')- expect(tc.toolName).not.toMatch(/^Step /)+ const block = result.conversations[0].messages[0].agentBlocks![0] as unknown as AgentBlock+ // Both raw fields are fixed...+ expect(block.toolCalls![0].status).toBe('stopped')+ expect(block.toolCall!.status).toBe('stopped')+ // ...and, decisively, so is what the chat surface would actually show.+ const groups = groupAgentBlocks([block])+ expect(groups).toHaveLength(1)+ expect(groups[0].kind).toBe('tools')+ const rendered = groups[0].kind === 'tools' ? groups[0].calls[0] : undefined+ expect(rendered!.status).not.toBe('running')+ expect(rendered!.status).toBe('stopped')+ // klein 2 (Runde 3): the workflow's own name survives, pulled from the+ // trigger message, instead of a fully generic label.+ expect(rendered!.toolName).toContain('Research Topic')+ })++ it('NEGATIVKONTROLLE: eine Migration, die nur toolCalls fixt (der Runde-2-Stand), bleibt am Renderpfad "running"', () => {+ // Reproduces the exact shape Opus measured against the pre-B2-fix+ // migration: `toolCalls[0]` gets rewritten, `toolCall` does not, so+ // groupAgentBlocks (which reads only `toolCall`) still shows 'running'.+ // This is what proves the assertion above is not vacuous.+ const block = persistedProgressBlock('Step 2 of 3: Summarize', 'running')+ block.toolCalls[0].status = 'stopped'+ block.toolCalls[0].toolName = 'Workflow stopped before finishing'+ // block.toolCall left untouched on purpose, matching the Runde-2 bug.+ const groups = groupAgentBlocks([block as unknown as AgentBlock])+ const rendered = groups[0].kind === 'tools' ? groups[0].calls[0] : undefined+ expect(rendered!.status).toBe('running')})it('NEGATIVKONTROLLE: ein echter, noch laufender Werkzeug-Aufruf bleibt "running"', () => {// Without the isWorkflowProgressToolName() guard, this would also get// rewritten to 'stopped', which would be wrong the moment a tool// call is shown mid-flight in the SAME session (no restart happened).- const realRunningCall: AgentToolCall = {- id: 't1', toolName: 'shell_execute', args: { command: 'sleep 5' }, status: 'running', timestamp: 1,- }const state = {conversations: [- { id: 'c1', messages: [{ id: 'm1', agentBlocks: [{ id: 'b1', phase: 'tool_call', content: '', timestamp: 1, toolCalls: [realRunningCall] }] }] },+ { id: 'c1', messages: [{ id: 'm1', agentBlocks: [persistedProgressBlock('shell_execute', 'running')] }] },],}const result = migrated(state)- expect(result.conversations[0].messages[0].agentBlocks![0].toolCalls![0].status).toBe('running')+ const block = result.conversations[0].messages[0].agentBlocks![0] as unknown as AgentBlock+ expect(block.toolCall!.status).toBe('running')+ const groups = groupAgentBlocks([block])+ const rendered = groups[0].kind === 'tools' ? groups[0].calls[0] : undefined+ expect(rendered!.status).toBe('running')})it('bereits abgeschlossene Workflow-Bloecke bleiben unangetastet', () => {- const settledCall: AgentToolCall = {- id: 'p1', toolName: 'Workflow: Research Topic (3/3 steps)', args: {}, status: 'completed', timestamp: 1,- }const state = {conversations: [- { id: 'c1', messages: [{ id: 'm1', agentBlocks: [{ id: 'b1', phase: 'tool_call', content: '', timestamp: 1, toolCalls: [settledCall] }] }] },+ { id: 'c1', messages: [{ id: 'm1', agentBlocks: [persistedProgressBlock('Workflow: Research Topic (3/3 steps)', 'completed')] }] },],}const result = migrated(state)- expect(result.conversations[0].messages[0].agentBlocks![0].toolCalls![0].status).toBe('completed')+ const block = result.conversations[0].messages[0].agentBlocks![0] as unknown as AgentBlock+ expect(block.toolCall!.status).toBe('completed')+ expect(block.toolCalls![0].status).toBe('completed')})- it('ist idempotent ueber die legacy toolCall/toolCalls-Migration hinweg', () => {+ it('ist idempotent ueber die legacy toolCall/toolCalls-Migration hinweg (nur toolCall, kein toolCalls)', () => {const staleLegacyCall: AgentToolCall = {id: 'p1', toolName: 'Workflow: Research Topic (1/3 steps)', args: {}, status: 'running', timestamp: 1,}@@ -264,9 +304,23 @@ describe('chatStore — migratePersistedChat', () => {const twice = migrated(once)const tc = twice.conversations[0].messages[0].agentBlocks![0].toolCalls![0]expect(tc.status).toBe('stopped')- // The legacy singular field points at the SAME object migrateBlockInPlace- // keeps in sync, so it must read the rewritten status too.+ // migrateBlockInPlace synced `toolCalls` from `toolCall` as the SAME+ // object BEFORE the stale-check ran (only `toolCall` existed at that+ // point), so this stays true here; the two-object case above is what+ // covers the "already both present, already diverged" shape.expect(twice.conversations[0].messages[0].agentBlocks![0].toolCall!.status).toBe('stopped')})++ it('erhaelt den Workflow-Namen ueber markStaleWorkflowProgressStoppedOnBlock, faellt sonst auf das generische Label zurueck', () => {+ // Direct unit coverage of the two helpers B2's fix is built from, one+ // level below the full migration.+ const named = { toolCall: { toolName: 'Step 1 of 1: Go', status: 'running' } }+ markStaleWorkflowProgressStoppedOnBlock(named, 'Summarize URL')+ expect(named.toolCall.toolName).toBe('Workflow: Summarize URL (stopped before finishing)')++ const anonymous = { toolCall: { toolName: 'Step 1 of 1: Go', status: 'running' } }+ markStaleWorkflowProgressStoppedOnBlock(anonymous)+ expect(anonymous.toolCall.toolName).toBe('Workflow stopped before finishing')+ })})})diff --git a/src/stores/chatStore.ts b/src/stores/chatStore.tsindex ec6578d2..813a448a 100644--- a/src/stores/chatStore.ts+++ b/src/stores/chatStore.ts@@ -6,8 +6,8 @@ import type { AgentBlock } from '../types/agent-mode'import { clampSampling, type SamplingOverrides } from '../lib/sampling'import { idbStorage } from '../lib/idbStorage'import { coalescedJSONStorage } from '../lib/coalescedStorage'-import { migrateBlockInPlace, getBlockToolCalls } from '../api/agents/block-helpers'-import { markStaleWorkflowProgressStopped } from '../lib/workflow-progress-view'+import { migrateBlockInPlace } from '../api/agents/block-helpers'+import { markStaleWorkflowProgressStoppedOnBlock, extractWorkflowNameFromProgressMessage } from '../lib/workflow-progress-view'import { useGenerationStore } from './generationStore'import { useRemoteStore } from './remoteStore'import { useRAGStore } from './ragStore'@@ -34,6 +34,11 @@ export function migratePersistedChat(state: unknown): unknown {for (const msg of messages) {const blocks = prop(msg, 'agentBlocks')if (!Array.isArray(blocks)) continue+ // Runde 3, B2 (review-wfprogress.md): the workflow's own name lives on+ // the TRIGGER message's content ("Running workflow: **<name>**"), not+ // on the block or the tool call, so it has to be pulled out here, once+ // per message, and threaded into the block-level fix below.+ const workflowName = extractWorkflowNameFromProgressMessage(prop(msg, 'content'))for (const block of blocks) {// migrateBlockInPlace reads `toolCall` and `toolCalls` and writes// `toolCalls`; the cast claims no more than those three, and the@@ -41,14 +46,16 @@ export function migratePersistedChat(state: unknown): unknown {if (!isRecord(block)) continueconst typedBlock = block as unknown as AgentBlockmigrateBlockInPlace(typedBlock)- // Runde 2 Blocker (app-restart case, workflow-progress-view.ts):- // a block still 'running' here means the app closed mid-run, since- // this migration only ever sees what was persisted, never a live- // in-session update (those go through addBlock/updateBlockById on- // the live Zustand state directly). Rewrite it as honestly stopped.- for (const tc of getBlockToolCalls(typedBlock)) {- markStaleWorkflowProgressStopped(tc)- }+ // Runde 2 Blocker (app-restart case, workflow-progress-view.ts),+ // fixed properly in Runde 3 (B2): a block still 'running' here means+ // the app closed mid-run, since this migration only ever sees what+ // was persisted, never a live in-session update (those go through+ // addBlock/updateBlockById on the live Zustand state directly).+ // Rewrite it as honestly stopped - on BOTH the legacy `toolCall` and+ // the `toolCalls` array, since after a JSON persist round-trip they+ // are separate objects and the chat surface (`groupAgentBlocks`,+ // tool-call-groups.ts) renders only the legacy singular field.+ markStaleWorkflowProgressStoppedOnBlock(typedBlock, workflowName)}}}