shaynhornik opened a new pull request, #9244: URL: https://github.com/apache/texera/pull/9244
### What changes were proposed in this PR? `serializeTask` wrote each past tool call as one line, `- <tool> (<status>)`. The system prompt (`prompts.ts`) says each call also has `Summary`, `Output` or `Error` lines under it, but they were never added. When a call failed, the model never saw why, so it made the same call again. Each past call now has, in the prompt's layout: - `Summary:`, the `summary` the model passed in the call, when it gave one - `Output:`, the first line of the tool's result. That line is the tool's one-line summary, for example `Added operator op1, ...` or `Executed operator op1`. Operator data is already in the dataflow section, so it is not repeated. - `Error:`, the full error, indented, when the result is marked as failed A call that has no result yet still shows only its name. This is separate from #9120, which @oliarmak-web is fixing. That one sets `isError` for `[ERROR]` results. Until it lands, a failed call's message still reaches the model through its `Output:` line (for example `Output: [ERROR] Source operator "op7" not found`). After it lands, the same call gets the full `Error:` block. ### Any related issues, documentation, discussions? Closes #9119 ### How was this PR tested? New tests in `context-utils.spec.ts`: - Summary, first-line Output and an indented multi-line Error are written under their calls, a call with no result gets nothing extra, and an operator's table data stays out of the history. - An `[ERROR]` result that isn't flagged as an error still shows its message on the `Output:` line. Both fail without the change. Locally: `bun test` (326 pass), `tsc --noEmit` and `prettier --check` are clean. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5). I reviewed and tested the change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
