From 38dde66af14188a97d3eea19e8b29e68579d899d Mon Sep 17 00:00:00 2001
From: James Feng <47167674+GhostDragon124@users.noreply.github.com>
Date: Sun, 7 Jun 2026 11:13:19 +0800
Subject: [PATCH] =?UTF-8?q?fix(tsc):=20Phase=203c=20=E2=80=94=20fix=2033?=
=?UTF-8?q?=20type=20errors=20in=20contextCollapse=20+=20UI=20stubs=20(120?=
=?UTF-8?q?=E2=86=9287)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/BashModeProgress.tsx | 8 ++++----
src/services/api/openai/index.ts | 8 +++++---
src/services/contextCollapse/index.ts | 17 +++++++++++++++++
src/tasks/design-system/Byline.tsx | 2 +-
src/tasks/design-system/Dialog.tsx | 10 +++++++++-
.../design-system/KeyboardShortcutHint.tsx | 2 +-
6 files changed, 37 insertions(+), 10 deletions(-)
diff --git a/src/components/BashModeProgress.tsx b/src/components/BashModeProgress.tsx
index 817320220..bc15acdf3 100644
--- a/src/components/BashModeProgress.tsx
+++ b/src/components/BashModeProgress.tsx
@@ -24,10 +24,10 @@ export function BashModeProgress({
/>
{progress ? (
) : (
diff --git a/src/services/api/openai/index.ts b/src/services/api/openai/index.ts
index 8c5fa7232..23a0ed281 100644
--- a/src/services/api/openai/index.ts
+++ b/src/services/api/openai/index.ts
@@ -1,4 +1,5 @@
import type { BetaToolUnion } from '@anthropic-ai/sdk/resources/beta/messages/messages.mjs'
+import type { ChatCompletionCreateParamsStreaming } from 'openai/resources/chat/completions/completions.mjs'
import type { SystemPrompt } from '../../../utils/systemPromptType.js'
import type {
Message,
@@ -7,6 +8,7 @@ import type {
AssistantMessage,
UserMessage,
} from '../../../types/message.js'
+import type { AgentId } from '../../../types/ids.js'
import type { Tools } from '../../../Tool.js'
import { getOpenAIClient } from './client.js'
import { anthropicMessagesToOpenAI } from './convertMessages.js'
@@ -122,7 +124,7 @@ function assembleFinalAssistantOutputs(params: {
outputs.push({
message: {
...partialMessage,
- content: normalizeContentFromAPI(allBlocks, tools, agentId),
+ content: normalizeContentFromAPI(allBlocks, tools, agentId as AgentId),
usage,
stop_reason: stopReason,
stop_sequence: null,
@@ -222,7 +224,7 @@ export async function* queryModelOpenAI(
// Filter out non-standard tools (server tools like advisor)
const standardTools = toolSchemas.filter(
(t): t is BetaToolUnion & { type: string } => {
- const anyT = t as Record
+ const anyT = t as unknown as Record
return (
anyT.type !== 'advisor_20260301' && anyT.type !== 'computer_20250124'
)
@@ -285,7 +287,7 @@ export async function* queryModelOpenAI(
// 8. Get client and make streaming request
const client = getOpenAIClient({
maxRetries: 0,
- fetchOverride: options.fetchOverride,
+ fetchOverride: options.fetchOverride as unknown as typeof fetch | undefined,
source: options.querySource,
})
diff --git a/src/services/contextCollapse/index.ts b/src/services/contextCollapse/index.ts
index 9ceaa1ad7..8ebe64a54 100644
--- a/src/services/contextCollapse/index.ts
+++ b/src/services/contextCollapse/index.ts
@@ -2,6 +2,15 @@ interface CollapseStats {
totalMessages: number
collapsedMessages: number
emptySpawnWarningEmitted: boolean
+ health: {
+ totalSpawns: number
+ totalErrors: number
+ lastError?: string
+ emptySpawnWarningEmitted: boolean
+ totalEmptySpawns: number
+ }
+ collapsedSpans: number
+ stagedSpans: number
}
export function getStats(): CollapseStats {
@@ -9,6 +18,14 @@ export function getStats(): CollapseStats {
totalMessages: 0,
collapsedMessages: 0,
emptySpawnWarningEmitted: false,
+ health: {
+ totalSpawns: 0,
+ totalErrors: 0,
+ emptySpawnWarningEmitted: false,
+ totalEmptySpawns: 0,
+ },
+ collapsedSpans: 0,
+ stagedSpans: 0,
}
}
diff --git a/src/tasks/design-system/Byline.tsx b/src/tasks/design-system/Byline.tsx
index 092c3a8d4..074cfd357 100644
--- a/src/tasks/design-system/Byline.tsx
+++ b/src/tasks/design-system/Byline.tsx
@@ -5,6 +5,6 @@
import React from 'react'
-export function Byline(): React.ReactNode {
+export function Byline({ children: _children }: { children?: React.ReactNode }): React.ReactNode {
return null
}
diff --git a/src/tasks/design-system/Dialog.tsx b/src/tasks/design-system/Dialog.tsx
index 456025591..5ff927e3d 100644
--- a/src/tasks/design-system/Dialog.tsx
+++ b/src/tasks/design-system/Dialog.tsx
@@ -5,6 +5,14 @@
import React from 'react'
-export function Dialog({ children }: { children?: React.ReactNode }): React.ReactNode {
+type DialogProps = {
+ children?: React.ReactNode
+ title?: string
+ subtitle?: React.ReactNode
+ onCancel?: () => void
+ inputGuide?: () => React.ReactNode
+}
+
+export function Dialog({ children, title: _title, subtitle: _subtitle, onCancel: _onCancel, inputGuide: _inputGuide }: DialogProps): React.ReactNode {
return <>{children}>
}
diff --git a/src/tasks/design-system/KeyboardShortcutHint.tsx b/src/tasks/design-system/KeyboardShortcutHint.tsx
index 6e732a2a6..30e070bb0 100644
--- a/src/tasks/design-system/KeyboardShortcutHint.tsx
+++ b/src/tasks/design-system/KeyboardShortcutHint.tsx
@@ -5,6 +5,6 @@
import React from 'react'
-export function KeyboardShortcutHint(): React.ReactNode {
+export function KeyboardShortcutHint({ shortcut: _shortcut, action: _action }: { shortcut?: string; action?: string }): React.ReactNode {
return null
}