Commit f412754
Pass structured tool results via RPC instead of stringifying
In both the Node and Go SDKs, _executeToolAndRespond / executeToolAndRespond
was converting structured ToolResultObject values into plain JSON strings
before sending them over RPC. This destroyed the object shape, causing
toolTelemetry (and other structured fields like resultType) to be silently
lost on the server side.
Node SDK: detect ToolResultObject by checking for textResultForLlm +
resultType properties and pass it directly to handlePendingToolCall, which
already accepts the union type (string | object) in its RPC schema.
Go SDK: send a ResultUnion with ResultResult populated (preserving
TextResultForLlm, ResultType, Error, and ToolTelemetry) instead of
extracting only the text and sending ResultUnion with String.
Fixes the SDK side of github/copilot-agent-runtime#5574.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 4d26e30 commit f412754
2 files changed
Lines changed: 32 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
620 | 620 | | |
621 | 621 | | |
622 | 622 | | |
623 | | - | |
624 | | - | |
625 | | - | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
626 | 634 | | |
627 | 635 | | |
628 | 636 | | |
629 | | - | |
| 637 | + | |
630 | 638 | | |
631 | 639 | | |
632 | 640 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
459 | 461 | | |
460 | 462 | | |
461 | 463 | | |
462 | | - | |
| 464 | + | |
463 | 465 | | |
464 | 466 | | |
465 | 467 | | |
466 | 468 | | |
| 469 | + | |
| 470 | + | |
467 | 471 | | |
468 | 472 | | |
469 | 473 | | |
| |||
1043 | 1047 | | |
1044 | 1048 | | |
1045 | 1049 | | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
0 commit comments