-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
featuregood first issueGood for newcomersGood for newcomersuiThe Command Center of Skyflo.aiThe Command Center of Skyflo.ai
Description
The ChatInterface.tsx component uses any type casts extensively (~30+ instances), which bypasses TypeScript's type safety and can hide bugs. Examples include:
const mapTokenUsage = (raw: any): TokenUsage | undefined => { ... }
(lastMessage as any).segments?.length
(s as any).toolExecution
msgs.map((m: any) => { ... })Scope
UI (ui/src/components/chat/ChatInterface.tsx):
- Audit all
anytype usages and replace with proper types. - Create or extend interfaces in
ui/src/types/chat.tsas needed. - For truly dynamic data (e.g., SSE event payloads), use type guards or runtime validation instead of
anycasts. - Focus on the most impactful areas first: message segment handling, tool execution state, and SSE event mapping.
UI (ui/src/types/chat.ts, ui/src/types/events.ts):
- Define proper interfaces for message segments, tool executions, and event payloads.
- Replace
annotations?: anywith a proper interface.
Acceptance criteria
- Reduce
anyusage inChatInterface.tsxcompletely. - No TypeScript errors introduced.
- Type guards are used for runtime validation.
- Chat functionality remains unchanged.
How to test manually
- Run
yarn buildin the UI directory. There should be no type errors. - Run the UI locally (see
ui/README.md) and test all chat flows:- Sending messages
- Tool execution and approval
- Streaming responses
- Loading chat history
- Verify no runtime errors in the browser console.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featuregood first issueGood for newcomersGood for newcomersuiThe Command Center of Skyflo.aiThe Command Center of Skyflo.ai