Feature - Code execution Middle ware output streaming to UI - #81
Draft
saharannaveen wants to merge 6 commits into
Draft
Feature - Code execution Middle ware output streaming to UI#81saharannaveen wants to merge 6 commits into
saharannaveen wants to merge 6 commits into
Conversation
- InterruptBanner: parse structured tool_approval payloads, show subagent name and tool name in approval prompt - SubAgentIndicator: show "Tool Approval Required" with tool name and args when per-subagent tool_approval interrupt fires
Feat/rhitaif 221
- Add 'custom' to stream_mode for LangGraph Platform SSE - Handle code_output custom events in BFF proxy (skip all other custom events to prevent partial text state corruption) - Add code_output chunk type to SSEProcessor - Add onCodeOutput callback to StreamingManager - Wire console logging in useStreamingAPI for code execution output
Took deep-agent's InterruptBanner and SubAgentIndicator. Merged proxy.router.ts: kept code_output custom event handler, adopted uiChunks variable rename from deep-agent.
saharannaveen
marked this pull request as draft
July 20, 2026 13:53
Anish701
requested changes
Jul 22, 2026
| branches: | ||
| - main | ||
| - deep-agent | ||
| - feat/rhitaif-221 |
Contributor
There was a problem hiding this comment.
Why is this branch included in the yml?
| setTraceId(data.trace_id); | ||
| }, | ||
| onCodeOutput(content) { | ||
| console.log('[code_execution_output]', content); |
Contributor
There was a problem hiding this comment.
What is the purpose behind logging in console?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
What does this MR do and why?
Adds SSE streaming support for real-time code execution output from the template-agent's CodeExecutionMiddleware. When the agent runs code in an ephemeral K8s pod, stdout chunks now stream through Aegra → BFF → UI in real-time instead of appearing all at once after completion.
Changes
code_output chunks to UI, skips all other custom events with continue to prevent partial text state corruption.
AI Disclosure
AI used: Yes |
Tool(s): None
Scope: BFF proxy handler, SSE processor, streaming manager, hook wiring |
Human verification: Tested with template-agent on Kind cluster — code output events visible in browser console during
execution.
Checklist
Deployment & Security Impact
Deployment: No new env vars. Adding 'custom' to stream_mode is backward-compatible — Aegra ignores unknown modes gracefully.
The BFF continue guard ensures unknown custom events are silently skipped.
Security: No auth changes. Code output content is the same stdout/stderr already visible in the ToolMessage — streaming just
makes it real-time.
Reviewer Notes
line 511 — not just code_output. That function maintains a prevPartial text accumulator for token streaming. A custom event
has a different JSON shape, would return [null, ''], and reset prevPartial to empty — causing duplicate or missing text in
the chat.