bobbai00 opened a new pull request, #9495:
URL: https://github.com/apache/texera/pull/9495

   ### What changes were proposed in this PR?
   
   The agent's tests use a mock model, so nothing showed whether a change makes 
the agent better or worse. This PR adds `bun run eval` in `agent-service`: it 
starts the agent service of the checkout against a running Texera and a real 
model, runs six cases a few times each, and prints how many runs passed and 
what they cost.
   
   | Case | What the user does | The run passes when |
   | --- | --- | --- |
   | `build-workflow` | Asks for the three categories with the highest total 
sales | The answer names them, in order |
   | `fix-failing-operator` | Asks to fix a filter on a misspelled column | The 
saved filter uses `amount`, and the answer gives the right count |
   | `explain-execution-error` | Asks why a Python operator fails | The answer 
names the order the error names |
   | `docs-question` | Asks which output port modes an operator can have | The 
answer names the three modes in the docs |
   | `user-edit-between-prompts` | Asks for two changes, and adds a Limit in 
between | The user's Limit is still in the saved workflow |
   | `user-execution-failed` | Runs the workflow, then asks why it failed, 
without running anything | The answer names the order the error names, and the 
agent ran nothing |
   
   - The cases work on 240 orders made by a seeded generator, and every 
expected answer is computed from them. The failing Python operator names the 
order it stops at, an id that only the execution's error holds, so guessing 
from the workflow does not pass.
   - A recorder in front of `LLM_ENDPOINT` counts every model call: its size in 
bytes and the tokens the provider reports.
   - It reuses the agent service's own code: the WebSocket command classes to 
prompt, the workflow client, the operator builder and the execution client.
   - Each run's workflow and agent are deleted when it ends. The orders stay in 
one dataset, `agent-eval-orders`, which later runs reuse.
   
   Today's score, on `main` with Claude Haiku 5.5:
   
   ```
   Case                       Passed  Model calls  Input tokens  Output tokens  
KB per call  Max KB
   -------------------------  ------  -----------  ------------  -------------  
-----------  ------
   build-workflow                3/3          4.3        56,984          1,402  
       37.9    39.8
   fix-failing-operator          3/3          2.7        34,732            914  
       37.7    39.3
   explain-execution-error       3/3          2.0        26,013            854  
       37.8    38.6
   docs-question                 0/3          1.0        12,205            839  
       35.8    35.8
   user-edit-between-prompts     0/3          4.0        52,409          1,037  
       37.8    39.8
   user-execution-failed         0/3          1.0        12,693            739  
       37.0    37.0
   -------------------------  ------  -----------  ------------  -------------  
-----------  ------
   total                        9/18          2.5        32,506            964  
       37.6    39.8
   
   Score: 9 of 18 runs passed (50%). Costs are per run, averaged.
   ```
   
   The three failing cases are the gaps the other sub-issues of #9453 close: 
the docs (#9456), the user's edits between prompts and the user's own 
executions (#9464).
   
   ### Any related issues, documentation, discussions?
   
   Closes #9454
   Part of #9453
   
   ### How was this PR tested?
   
   - `cd agent-service && bun test` (384 pass, 42 of them new: the checks, the 
data and its expected answers, the report, the recorder against a stand-in 
endpoint, and the settings), `bun run typecheck` and `bun run format:check`, 
which now cover `eval/`.
   - `bun run eval` with `EVAL_REPEAT=3` on a single-node stack of today's 
images with Claude Haiku 5.5, which printed the table above. Each case was also 
checked to fail for the right reason: `user-execution-failed` passed while its 
error was guessable from the workflow (a cast of a text column), so both 
execution cases now use the Python operator whose error names an order.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Opus 5.5
   


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