Yicong-Huang commented on code in PR #6009:
URL: https://github.com/apache/texera/pull/6009#discussion_r4333581743


##########
frontend/src/app/workspace/service/agent/agent.service.ts:
##########
@@ -97,21 +99,45 @@ export interface ModelType {
 /**
  * API response types
  */
-/**
- * Summary of operator execution results for annotation display.
- */
+export interface Schema {
+  readonly attributes: ReadonlyArray<SchemaAttribute>;
+}
+
+// A normalized result tuple from agent-service (schema + positional fields).
+// Sampled tuples are truncated, so each Tuple carries a synthetic all-STRING 
schema.
+export interface Tuple {
+  readonly schema: Schema;
+  readonly fields: ReadonlyArray<unknown>;
+}
+
+export type IndexedTuple = readonly [rowIndex: number, tuple: Tuple];
+
+// The column names of a tuple, in schema order.
+export function tupleColumns(tuple: Tuple): string[] {

Review Comment:
   **Advisory:**
   
   `Tuple`, `Schema`, `IndexedTuple`, `tupleColumns` and `tupleToRecord` here 
are identical to the copies in agent-service's `tools-utility.ts:27-44`, but 
neither site's comments point at its sibling. The language boundary (Angular 
frontend vs Bun service) makes sharing genuinely hard, so the fix is a one-line 
comment at each site naming the other. Otherwise the next edit to the 
projection logic lands on one copy and the popover table and the agent TSV 
silently disagree.



##########
agent-service/src/agent/tools/workflow-execution-tools.ts:
##########
@@ -377,50 +340,23 @@ function formatExecutionError(
   if (generalErrors && generalErrors.length > 0) {
     lines.push("Error:");
     for (const error of generalErrors) {
-      lines.push(`  ${error}`);
+      lines.push(`  ${error.message}`);

Review Comment:
   **Advisory:**
   
   Compilation errors used to render under their own "Compilation error:" 
heading; now `formatExecutionError` prints every general error under "Error:", 
including the ones the adapter typed `COMPILATION_ERROR`. The message text is 
preserved, but the agent loses the compile-vs-execution categorization that was 
free. Grouping the general errors by `error.type.name` before rendering would 
restore it.



-- 
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