fix(chat): make task session rendering authoritative
Use the Task part's state.metadata.sessionId as the only live identity contract for child sessions. Remove timestamp, status, and ordering heuristics that could misassociate concurrent subagents or repeatedly scan directory sessions while parts stream. Extract Task metadata parsing and child-summary projection into a focused model with cached projections for unchanged message records. Preserve output and part-level metadata parsing only for legacy persisted records, and keep standalone Task rows visible when sorted activity groups are rendered. Validated with focused Task and turn projection tests, UI type-check, lint, and dead-code analysis.
This commit is contained in:
@@ -25,6 +25,12 @@ Use this doc when you ask an agent to change tool/header/description behavior.
|
||||
- Controls expandable header title/description/diff stats/timer and expanded output body.
|
||||
- If you want to change expandable tool layout, edit here.
|
||||
|
||||
- `taskToolModel.ts`
|
||||
- Owns Task metadata parsing and child-session summary projection.
|
||||
- `part.state.metadata.sessionId` is the only live identity contract between a Task and its child session.
|
||||
- A running Task may briefly have no `sessionId`; render it as waiting until the authoritative part update arrives. Never match parallel children by order, title, timestamp, or status.
|
||||
- Part-level metadata and output parsing exist only for older persisted records and never override state metadata.
|
||||
|
||||
- `toolPresentation.tsx`
|
||||
- Shared icon mapping for tool names (`getToolIcon`).
|
||||
- Used by both `ProgressiveGroup.tsx` and `ToolPart.tsx`.
|
||||
|
||||
Reference in New Issue
Block a user