-
-
Notifications
You must be signed in to change notification settings - Fork 339
Response includes raw SSE events (output, rate_limit_event) in Telegram messages #386
Copy link
Copy link
Open
Description
Description
When Claude Code responds via HAPI Telegram bot, the end of each message includes raw JSON from internal SSE stream events that should be filtered out.
Reproduction
- Send a message to the HAPI Telegram bot
- Wait for Claude Code to respond
- The response text is correct, but at the end, raw JSON objects are appended
Expected Behavior
Only the assistant's text content should be forwarded to Telegram. Internal SSE control events should be filtered out.
Actual Behavior
Two types of internal events leak into the visible message:
{"type": "output", "data": {"parentUuid": "...", "isSidechain": false, "userType": "external", "cwd": "...", "sessionId": "...", "version": "0.0.0", "uuid": "...", "timestamp": "..."}}{"type": "rate_limit_event", "rate_limit_info": {"status": "allowed", "resetsAt": ..., "rateLimitType": "five_hour", "overageStatus": "rejected", "overageDisabledReason": "org_level_disabled", "isUsingOverage": false, "session_id": "..."}}Screenshot
(See attached screenshot showing the leaked JSON at the end of a normal response)
Environment
- HAPI version: 0.16.5
- Platform: macOS (darwin-arm64)
- Claude model: Opus 4.6
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels