bobbai00 opened a new issue, #5266: URL: https://github.com/apache/texera/issues/5266
### Task Summary The agent service (`agent-service/`) currently has low automated test coverage. A `bun test --coverage` run reports **~51.6% line / 54.2% function** coverage overall, and the gaps are concentrated in the core logic rather than helpers: | Module | % Lines | Role | | --- | --- | --- | | `util/context-utils.ts` | 1% | builds per-step LLM context | | `tools/workflow-execution-tools.ts` | 5% | operator execution tool | | `api/workflow-api.ts` | 8% | workflow CRUD client | | `api/compile-api.ts` | 10% | compile client | | `util/workflow-utils.ts` | 10% | workflow helpers | | `agent/prompts.ts` | 15% | system prompt builder | | `tools/workflow-crud-tools.ts` | 22% | add/modify/delete tools | | `agent/texera-agent.ts` | 32% | **core ReAct loop** (`sendMessage`) | | `server.ts` | 50% | REST routes + websocket | The well-covered files (`result-formatting`, `tools-utility`, `auto-layout`, `workflow-result-state`) are mostly leaf utilities, so the headline number overstates how much of the agent's behavior is actually exercised. Add unit/integration tests for, at minimum: - the `texera-agent.ts` ReAct loop — step-tree construction, HEAD/checkout, stop/abort, error steps, settings effects; - the CRUD and execution tools (positive + error/`[ERROR]` paths); - context assembly in `context-utils.ts`; - the API clients (`workflow-api`, `compile-api`, `backend-api`) against mocked HTTP, including bad/malformed responses. Tests should cover both positive and negative paths (invalid input, missing config, backend errors), per the project testing guidelines. ### Task Type - [ ] Refactor / Cleanup - [ ] DevOps / Deployment / CI - [x] Testing / QA - [ ] Documentation - [ ] Performance - [ ] Other -- 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]
