agent-dashboard: render opencode 2 subagent results as Markdown #4

Merged
muon merged 1 commit from muon/agent-subagent-result-markdown into main 2026-10-15 15:29:01 +00:00 AGit
Owner

Summary

Opencode 2 wraps a subagent's result in <subagent sessionID=… state=…>…</subagent>. The card only removed opencode 1's <task_result> wrapper. Because the opening tag sits on its own line, the Markdown renderer treated the whole result as one raw HTML block and showed it as plain text (bullets and code spans run together on one line).

 <SubagentItem>
-  taskResult()  local, <task_result> only
+  taskResult()  lib/utils.ts: strips <subagent …> (2.x) or task_id + <task_result> (1.x)
   <Markdown text={result} />

Evidence

  • Before: the card's Result showed <subagent sessionID="ses_…" state="completed"> - **Where it's defined:** formatDuration… … as one line of plain text.
    After: new test/task-result.test.ts:
    '<subagent sessionID=… state=completed>\n- **a:** `x`\n- b\n</subagent>' -> '- **a:** `x`\n- b'
    'task_id: …\n<task_result>\n# Done\n</task_result>'                     -> '# Done'
    unclosed wrapper / plain output                                         -> the text
    
    bun test passes 34 tests, 0 failures; tsc --noEmit and bun build.ts succeed.

Merge Danger

Door: two-way

Blast Radius: subagent-card

Only the Result section of the subagent card changes.

## Summary Opencode 2 wraps a subagent's result in `<subagent sessionID=… state=…>…</subagent>`. The card only removed opencode 1's `<task_result>` wrapper. Because the opening tag sits on its own line, the Markdown renderer treated the whole result as one raw HTML block and showed it as plain text (bullets and code spans run together on one line). ```diff <SubagentItem> - taskResult() local, <task_result> only + taskResult() lib/utils.ts: strips <subagent …> (2.x) or task_id + <task_result> (1.x) <Markdown text={result} /> ``` ## Evidence - **Before:** the card's Result showed `<subagent sessionID="ses_…" state="completed"> - **Where it's defined:** `formatDuration…` …` as one line of plain text. **After:** new `test/task-result.test.ts`: ```text '<subagent sessionID=… state=completed>\n- **a:** `x`\n- b\n</subagent>' -> '- **a:** `x`\n- b' 'task_id: …\n<task_result>\n# Done\n</task_result>' -> '# Done' unclosed wrapper / plain output -> the text ``` `bun test` passes 34 tests, 0 failures; `tsc --noEmit` and `bun build.ts` succeed. ## Merge Danger **Door:** two-way **Blast Radius:** subagent-card Only the Result section of the subagent card changes.
muon merged commit 1d0190a4d6 into main 2026-10-15 15:29:01 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
muon/flake!4
No description provided.