bobbai00 commented on code in PR #9432:
URL: https://github.com/apache/texera/pull/9432#discussion_r4663606689


##########
frontend/src/app/workspace/component/agent/agent-panel/react-step-detail-modal/react-step-detail-modal.component.spec.ts:
##########
@@ -225,38 +232,39 @@ describe("ReActStepDetailModalComponent", () => {
   describe("getToolResultFullItems / getToolResultItems", () => {
     function toolMessage(): any {
       return {
+        role: "tool",
         content: [
-          { type: "tool-result", toolCallId: "tc1", result: "short result" },
-          { type: "tool-result", toolCallId: "tc2", output: { rows: 3 } },
-          { type: "tool-result", toolCallId: "tc3", content: "after context 
compaction" },
-        ],
-      };
-    }
-
-    beforeEach(() => {
-      // inputMessages provides the toolCallId -> toolName map.
-      component.step = {
-        inputMessages: [
           {
-            role: "assistant",
-            content: [
-              { type: "tool-call", toolCallId: "tc1", toolName: "addOperator" 
},
-              { type: "tool-call", toolCallId: "tc2", toolName: 
"executeOperator" },
-            ],
+            type: "tool-result",
+            toolCallId: "tc1",
+            toolName: "addOperator",
+            output: { type: "text", value: "short result" },
+          },
+          {
+            type: "tool-result",
+            toolCallId: "tc2",
+            toolName: "executeOperator",
+            output: { type: "json", value: { rows: 3 } },
+          },
+          {
+            type: "tool-result",
+            toolCallId: "tc3",
+            toolName: "",
+            output: { type: "text", value: "after context compaction" },
           },
         ],
-      } as any;
-    });
+      };
+    }
 
     it("returns [] for non-array content", () => {
-      expect(component.getToolResultFullItems({ content: "x" })).toEqual([]);
-      expect(component.getToolResultItems({ content: "x" })).toEqual([]);
+      expect(component.getToolResultFullItems({ role: "tool", content: "x" } 
as any)).toEqual([]);
+      expect(component.getToolResultItems({ role: "tool", content: "x" } as 
any)).toEqual([]);
     });
 
     it("resolves tool names, content, token count and the trimmed flag", () => 
{
       const items = component.getToolResultFullItems(toolMessage());
 
-      // tc1: mapped name, raw string content, ~len/4 tokens, not trimmed
+      // tc1: name from the part, raw string output, ~len/4 tokens, not trimmed

Review Comment:
   **Polish:**
   
   This fixture's `output` ([line 
241](https://github.com/apache/texera/blob/4828fc6a6a11cf2d09949626cd5e786ee616a89d/frontend/src/app/workspace/component/agent/agent-panel/react-step-detail-modal/react-step-detail-modal.component.spec.ts#L241))
 is now a `{ type: "text", value }` envelope, so "raw string output" describes 
a shape it no longer has.
   
   ```suggestion
         // tc1: name from the part, text output shown as-is, ~len/4 tokens, 
not trimmed
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to