Skip to content

Conversation

@DigHuang
Copy link
Contributor

No description provided.

Introduces a TypeScript SSE client using fetch and ReadableStream, supporting custom headers, auto-reconnect, connection state tracking, and type-safe event handling. Includes usage example and comprehensive API for managing SSE connections.
Updated usage of useParams to leverage typed route parameters in agent and stock components. Refactored agentData to use a typed Record for improved type safety. Added .react-router/types to tsconfig.json rootDirs and include for better type resolution. Added redirect in AgentConfig if agentId is missing.
Moved ScrollContainer to a dedicated scroll directory and updated imports across multiple files. Added a new ScrollTextarea component for improved input handling in the chat interface. Enhanced the agent chat UI with a new background effect, updated header, and improved input card styling and logic.
Reworked the agent chat to support real-time streaming via SSE, modularized the chat background into its own component, and added a custom useSSE React hook for managing SSE connections. Updated types and constants for agent events, message, and component handling. Improved chat UI to display streaming, tool calls, reasoning, and error states.
Unified SSE event handling to use a single onData callback with a typed SSEData wrapper. Refactored agent event types for clarity and type safety, updated chat message structure, and simplified component and tool call rendering logic. Improves maintainability and extensibility for agent chat and SSE integration.
Replaces useRef-based client management in useSSE with useMemo and explicit state tracking via useState. Removes unused onReconnect handler from SSEEventHandlers. This improves reliability of state updates and simplifies client lifecycle management.
Refactored SSE client and hook to remove generic event typing and simplify handler signatures. Updated agent types for improved clarity and reduced repetition. Added agent-store.ts to manage agent conversation state and event handling.
Replaces manual immutable update logic in agent-store.ts with mutative for concise state updates. Refactors event handling to a handler map, reducing code complexity and improving maintainability. Updates agent.ts types to split tool call messages and add explicit plan/task failure message types. Adds mutative dependency to package.json.
Replaces local chat message state with a centralized agent conversations store for improved state management and scalability. Updates message rendering logic to handle different message types based on payload structure. Adjusts types to support role in message_chunk events.
Refactored chat message rendering by introducing a memoized MessageItem component for improved performance. Switched agent store state management from useState to useReducer for more efficient updates. Cleaned up message rendering logic and centralized message type handling.
Extracted the chat message rendering logic into a new memoized ChatMessage component for improved modularity and performance. Removed user input required state and related logic from AgentChat, simplifying the message flow. Updated @React-router dependencies to version 7.9.1 in package.json and bun.lock.
Replaces conversation/thread state with refs in AgentChat, updates SSE event handling to support thread_started, and improves rendering for multiple threads. Simplifies useSSE hook API, removes unnecessary memoization, and updates SSEClient to better handle options, headers, and connection lifecycle. Adds thread_started event type to agent types.
@su8su su8su merged commit 39eeea2 into main Sep 24, 2025
2 checks passed
@su8su su8su deleted the feat/agent_page branch September 24, 2025 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants