🔨 chore: add GatewayStreamNotifier for Agent Gateway WebSocket push#13603
🔨 chore: add GatewayStreamNotifier for Agent Gateway WebSocket push#13603
Conversation
Add a decorator that wraps IStreamEventManager to additionally push events to the Agent Gateway via HTTP (fire-and-forget). When AGENT_GATEWAY_SERVICE_TOKEN is configured, the factory automatically wraps the base stream manager with the gateway notifier. Redis SSE remains the primary event channel; the gateway is an additive push layer for WebSocket delivery. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@nekomeowww - This PR adds a GatewayStreamNotifier for Agent Gateway WebSocket push, touching backend server modules in |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## canary #13603 +/- ##
==========================================
+ Coverage 66.58% 66.61% +0.03%
==========================================
Files 1999 2000 +1
Lines 165955 166107 +152
Branches 19193 19215 +22
==========================================
+ Hits 110503 110659 +156
+ Misses 55328 55324 -4
Partials 124 124
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 388fae1ee2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Ensure the decorator always delegates to the inner stream event manager first, gateway failure never drops Redis events, and the factory correctly wraps/skips based on AGENT_GATEWAY_SERVICE_TOKEN. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- 5s AbortSignal timeout on every gateway POST to prevent hanging sockets - Max 20 inflight requests; excess silently dropped with a debug log - Use url-join for URL construction instead of string concatenation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Read AGENT_GATEWAY_SERVICE_TOKEN and AGENT_GATEWAY_URL from the validated appEnv config instead of raw process.env. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
GatewayStreamNotifierdecorator that wrapsIStreamEventManagerto push events to the Agent Gateway via HTTP (fire-and-forget)createStreamEventManagerfactory to auto-wrap with gateway notifier whenAGENT_GATEWAY_SERVICE_TOKENis configuredHow it works
Environment Variables
AGENT_GATEWAY_SERVICE_TOKENAGENT_GATEWAY_URLhttps://agent-gateway.lobehub.com)Test plan
/api/operations/statusreturnscompleted)Fixes LOBE-6723
🤖 Generated with Claude Code