wangzhigang1999 opened a new pull request, #7431: URL: https://github.com/apache/kyuubi/pull/7431
### Why are the changes needed? Part 4 of 4 for the Data Agent Engine ([umbrella](https://github.com/apache/kyuubi/issues/7379), [KPIP-7373](https://github.com/apache/kyuubi/discussions/7373)). This PR adds the user-facing surface — REST API, SSE streaming, and the Web UI chat interface — completing the Data Agent feature. Builds on the engine runtime from PR 3 (#7415). Changes include: **Server / REST API** - `DataAgentResource` — `POST /sessions/{handle}/chat` (SSE) and `POST /sessions/{handle}/approve` (JSON) - `ChatRequest` / `ApprovalRequest` DTOs in `kyuubi-client-api` - Stream lifecycle: bounded op-submit pool, preflight validation before engine launch, deadline-bounded poll loop, terminal-state-aware error surfacing, named `ping` keepalive - Request validation: model-name pattern, approval-mode whitelist, requestId charset (prevents engine command injection) - Bundles SQLite and PostgreSQL JDBC drivers in the engine package (Apache-compatible); MySQL stays test-scope **Engine streaming** - `ReasoningDelta` event for streaming chain-of-thought (qwen3, DeepSeek-R1) via the OpenAI-compatible `reasoning_content` delta field - `AgentRunContext` token accounting split into `accumulated*` (billing) and `last*` (current context size for UIs); provider-reported total forwarded verbatim so `CompactionMiddleware` can size the next prompt correctly **Web UI** - New `/data-agent` route with chat view, multi-tab session management, tool-call/approval rendering, reasoning collapse, markdown + sanitized HTML - Pinia store for chat state, persistent across tab switches - `@microsoft/fetch-event-source` based SSE client with watchdog, reconnect on visibility, and inline approval flow ### How was this patch tested? - **Unit tests**: `EventTest` (event-type SSE name parity), web-ui `chat-stream.spec.ts` (SSE parsing, error frame handling) - **Live LLM integration tests** (require `DATA_AGENT_OPENAI_API_KEY`): full ReAct loop, approval gate, denial flow, compaction trigger — all green against dashscope qwen-plus - **Manual E2E**: ran the dev server, exercised chat, model override, approval/deny, and reconnect across tab switches against a live engine ### Was this patch authored or co-authored using generative AI tooling? Partially assisted by Claude Code (Claude Opus 4.7) for code review, test generation, and PR formatting. Core design and implementation are human-authored. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
