From the gpt-5.6-sol eval (P1). Risk: touches every command's dispatch, so it needs care.
processV2Command unconditionally calls v2MainSync before dispatch (Sources/TerminalController.swift:1494), and that refresh walks every window/workspace/pane/surface (:2161). The individual telemetry handlers correctly parse off-main and use main.async (Sources/TerminalController+Telemetry.swift:9), so this shared prelude undoes the stated socket threading policy under telemetry bursts. Separately, concurrent client threads share one process-global LIFO focus-policy stack (TerminalController.swift:261,305), so interleaved requests can observe another request's focus allowance.
First step: allocate refs on lifecycle changes or only for commands that need them; pass focus intent explicitly instead of through global stack state.
From the gpt-5.6-sol eval (P1). Risk: touches every command's dispatch, so it needs care.
processV2Commandunconditionally callsv2MainSyncbefore dispatch (Sources/TerminalController.swift:1494), and that refresh walks every window/workspace/pane/surface (:2161). The individual telemetry handlers correctly parse off-main and usemain.async(Sources/TerminalController+Telemetry.swift:9), so this shared prelude undoes the stated socket threading policy under telemetry bursts. Separately, concurrent client threads share one process-global LIFO focus-policy stack (TerminalController.swift:261,305), so interleaved requests can observe another request's focus allowance.First step: allocate refs on lifecycle changes or only for commands that need them; pass focus intent explicitly instead of through global stack state.