Refactor hooks and improve error handling in chat functionality (#962)

* refactor: update useThreadChat and useThreadStream hooks for improved state management

* fix: improve error handling in agent configuration loading and enhance chat page functionality

* fix: enhance error handling in agent configuration loading

* Update frontend/src/app/workspace/agents/[agent_name]/chats/[thread_id]/page.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
JeffJiang
2026-03-04 09:50:45 +08:00
committed by GitHub
parent 7de94394d4
commit 14d1e01149
6 changed files with 46 additions and 37 deletions
@@ -43,6 +43,7 @@ export default function NewAgentPage() {
const threadId = useMemo(() => uuid(), []);
const [thread, sendMessage] = useThreadStream({
threadId: step === "chat" ? threadId : undefined,
context: {
mode: "flash",
is_bootstrap: true,