Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
f311d2f
refactor(agent-service): redesign sync-execution result and error model
bobbai00 Jun 29, 2026
316f456
refactor(frontend): consume execution summaries directly
bobbai00 Jun 29, 2026
cf39fa3
refactor(agent-service): keep operator result summary name
bobbai00 Jun 29, 2026
782432c
refactor: align execution result summary contract
bobbai00 Jun 29, 2026
c19569f
refactor: remove legacy result marker fields
bobbai00 Jun 29, 2026
1cdcb19
test(agent-service): cover sync-execution result formatting paths
bobbai00 Jul 2, 2026
639152b
style(execution-service): apply scalafmt to SyncExecutionResource
bobbai00 Jul 2, 2026
c7506aa
test(frontend): cover agent-interaction and result-table-frame changes
bobbai00 Jul 2, 2026
f807e67
test(execution-service): unit-test SyncExecutionResource pure logic
bobbai00 Jul 2, 2026
f9a1c51
refactor(execution-service): extract SyncExecutionResource pure helpe…
bobbai00 Jul 2, 2026
a9b9b15
refactor(execution-service): extract assembleExecutionSummary for tes…
bobbai00 Jul 2, 2026
35b5346
test(execution-service): cover remaining SyncExecutionResource branch…
bobbai00 Jul 4, 2026
83b49d4
refactor(execution-service): tidy SyncExecutionResource pure helpers
bobbai00 Jul 5, 2026
a645ef2
fix(agent-service): unify operator-failure semantics across consumers
bobbai00 Jul 5, 2026
392f4de
refactor(frontend): reuse WorkflowFatalError and render agent-interac…
bobbai00 Jul 5, 2026
e2c4475
refactor(agent-service): dedupe result row formatting
bobbai00 Jul 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions agent-service/src/agent/texera-agent.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { describe, expect, test } from "bun:test";
import { TexeraAgent } from "./texera-agent";
import { INITIAL_STEP_ID } from "../types/agent";
import { OperatorResultMode, OperatorState, type OperatorExecutionSummary } from "../types/execution";

function makeAgent(): TexeraAgent {
return new TexeraAgent({
// The model is never invoked in these tests.
model: {} as any,
modelType: "test-model",
agentId: "agent-1",
});
}

function makeSummary(tuplesCount: number): OperatorExecutionSummary {
return {
state: OperatorState.COMPLETED,
errorMessages: [],
resultSummary: { resultMode: OperatorResultMode.TABLE, sampleTuples: [], tuplesCount },
};
}

describe("TexeraAgent.getFormattedResultsForDAG", () => {
test("formats every result visible on the current step branch", () => {
const agent = makeAgent();
// Seed a result on the initial step, which is the head at construction time
// so it sits on the ancestor path getAllVisible() walks.
agent.getWorkflowResultState().set("op-1", INITIAL_STEP_ID, makeSummary(5));

const formatted = (
agent as unknown as { getFormattedResultsForDAG(): Map<string, string> }
).getFormattedResultsForDAG();

expect(formatted.size).toBe(1);
expect(formatted.has("op-1")).toBe(true);
expect(typeof formatted.get("op-1")).toBe("string");
expect(formatted.get("op-1")!.length).toBeGreaterThan(0);
});

test("returns an empty map when no results are visible", () => {
const agent = makeAgent();
const formatted = (
agent as unknown as { getFormattedResultsForDAG(): Map<string, string> }
).getFormattedResultsForDAG();
expect(formatted.size).toBe(0);
});
});
2 changes: 1 addition & 1 deletion agent-service/src/agent/texera-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ export class TexeraAgent {
const result = new Map<string, string>();
const visible = this.workflowResultState.getAllVisible();
for (const [operatorId, entry] of visible) {
result.set(operatorId, formatOperatorResult(operatorId, entry.operatorInfo, this.workflowState));
result.set(operatorId, formatOperatorResult(operatorId, entry.operatorInfo));
}
return result;
}
Expand Down
Loading
Loading