fix: subagent unique ID matching + AgentState serialization + pre-existing TS errors
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

- S-3: Thread task_id (UUID) through all 6 layers (LoopEvent → StreamChatEvent → kernel-types → gateway-client → streamStore) so subtasks are matched by ID, not description string
- AgentState: Add #[serde(rename_all = "lowercase")] to fix PascalCase serialization ("Running" → "running"), update frontend matcher
- S-1: Remove unused onClose prop from ArtifactPanel + ChatArea call site
- Fix hooks/index.ts: remove orphaned useAutomationEvents re-exports (module deleted)
- Fix types/index.ts: remove orphaned automation type/value re-exports (module deleted)
- Fix ChatArea.tsx: framer-motion 12 + React 19 type compat — use createElement + explicit any return type to avoid unknown-in-JSX-child error

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
iven
2026-04-06 22:30:16 +08:00
parent bbbcd7725b
commit 02c69bb3cf
13 changed files with 37 additions and 66 deletions

View File

@@ -382,7 +382,7 @@ export const useStreamStore = create<StreamState>()(
}
}
},
onSubtaskStatus: (description: string, status: string, detail?: string) => {
onSubtaskStatus: (taskId: string, description: string, status: string, detail?: string) => {
// Map backend status to frontend Subtask status
const statusMap: Record<string, Subtask['status']> = {
started: 'pending',
@@ -396,12 +396,12 @@ export const useStreamStore = create<StreamState>()(
msgs.map(m => {
if (m.id !== assistantId) return m;
const subtasks = [...(m.subtasks || [])];
const existingIdx = subtasks.findIndex(st => st.description === description);
const existingIdx = subtasks.findIndex(st => st.id === taskId);
if (existingIdx >= 0) {
subtasks[existingIdx] = { ...subtasks[existingIdx], status: mappedStatus, result: detail };
} else {
subtasks.push({
id: `subtask_${Date.now()}_${generateRandomString(4)}`,
id: taskId,
description,
status: mappedStatus,
result: detail,