feat: stream advisor tool output (#25032)

Stream advisor output into the advisor tool card while the nested
advisor call is still running.

This keeps the advisor implementation intentionally advisor-specific:
the parent model still receives the same final structured tool result,
while the frontend receives transient `tool-result.result_delta` parts
to render partial advisor text in the expanded card. The final persisted
chat history remains unchanged.

Refs CODAGT-322.

Generated by Coder Agents.

<details>
<summary>Implementation plan</summary>

- Publish advisor text deltas from the nested `chatloop.Run` via
`RunAdvisorOptions.OnAdviceDelta`.
- Forward those deltas through `chatadvisor.Tool` with the parent
advisor tool call ID.
- Emit transient `ChatMessagePartTypeToolResult` websocket parts with
`ResultDelta` from `chatd`.
- Add `result_delta` to the generated tool-result TypeScript variant.
- Accumulate tool result deltas in frontend stream state and keep the
tool running until the final result arrives.
- Render streamed advisor advice in the existing advisor card using
streaming markdown mode, while retaining the updated advisor UI.

</details>
This commit is contained in:
Thomas Kosiewski
2026-05-11 20:18:49 +02:00
committed by GitHub
parent 6bb88775ab
commit e56381eb61
18 changed files with 619 additions and 23 deletions
+19
View File
@@ -125,6 +125,7 @@ Experimental: this endpoint is subject to change.
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -249,6 +250,7 @@ Status Code **200**
| `»» provider_metadata` | array | false | | Provider metadata holds provider-specific response metadata (e.g. Anthropic cache control hints) as raw JSON. Internal only: stripped by db2sdk before API responses. |
| `»» result` | array | false | | |
| `»» result_delta` | string | false | | |
| `»» result_reset` | boolean | false | | |
| `»» signature` | string | false | | |
| `»» skill_description` | string | false | | Skill description is the short description from the skill's SKILL.md frontmatter. |
| `»» skill_dir` | string | false | | Skill dir is the absolute path to the skill directory inside the workspace filesystem. Internal only: used by read_skill/read_skill_file tools to locate skill files. |
@@ -455,6 +457,7 @@ Experimental: this endpoint is subject to change.
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -579,6 +582,7 @@ Experimental: this endpoint is subject to change.
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -854,6 +858,7 @@ Experimental: this endpoint is subject to change.
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -1032,6 +1037,7 @@ Experimental: this endpoint is subject to change.
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -1156,6 +1162,7 @@ Experimental: this endpoint is subject to change.
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -1415,6 +1422,7 @@ Experimental: this endpoint is subject to change.
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -1539,6 +1547,7 @@ Experimental: this endpoint is subject to change.
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -1659,6 +1668,7 @@ Experimental: this endpoint is subject to change.
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -1735,6 +1745,7 @@ Experimental: this endpoint is subject to change.
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -1863,6 +1874,7 @@ Experimental: this endpoint is subject to change.
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -1938,6 +1950,7 @@ Experimental: this endpoint is subject to change.
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -2063,6 +2076,7 @@ Experimental: this endpoint is subject to change.
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -2196,6 +2210,7 @@ Experimental: this endpoint is subject to change.
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -2268,6 +2283,7 @@ Experimental: this endpoint is subject to change.
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -2329,6 +2345,7 @@ Experimental: this endpoint is subject to change.
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -2577,6 +2594,7 @@ Experimental: this endpoint is subject to change.
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -2701,6 +2719,7 @@ Experimental: this endpoint is subject to change.
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
+16
View File
@@ -2199,6 +2199,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -2323,6 +2324,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -2659,6 +2661,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -2748,6 +2751,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -2791,6 +2795,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
| `provider_metadata` | array of integer | false | | Provider metadata holds provider-specific response metadata (e.g. Anthropic cache control hints) as raw JSON. Internal only: stripped by db2sdk before API responses. |
| `result` | array of integer | false | | |
| `result_delta` | string | false | | |
| `result_reset` | boolean | false | | |
| `signature` | string | false | | |
| `skill_description` | string | false | | Skill description is the short description from the skill's SKILL.md frontmatter. |
| `skill_dir` | string | false | | Skill dir is the absolute path to the skill directory inside the workspace filesystem. Internal only: used by read_skill/read_skill_file tools to locate skill files. |
@@ -2909,6 +2914,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -2985,6 +2991,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -3166,6 +3173,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -3311,6 +3319,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -3383,6 +3392,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -3444,6 +3454,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -3553,6 +3564,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -3736,6 +3748,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -4148,6 +4161,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -4223,6 +4237,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",
@@ -6628,6 +6643,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
0
],
"result_delta": "string",
"result_reset": true,
"signature": "string",
"skill_description": "string",
"skill_dir": "string",