Repository navigation
fix(channels): deliver long Telegram and Discord replies - #117
Closed
cursor[bot] wants to merge 1 commit into
Closed
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
Telegram treated a finished sendMessage as success, so an HTTP 400 for a reply over 4096 characters still acked cron and the user never saw the text. Discord refused the whole reply above 2000 characters, so the send failed and a due cron job re-ran the agent on every poll. Co-authored-by: esadrianno <esadrianno@gmail.com>
Collaborator
|
Superseded by #123: consolidated into the operator-authored branch fix/channels-telegram-discord (same fixes, re-validated with make test_telegram, make test_channel, CI=true make test, make static). Closing in favor of the consolidation. |
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.
Bug and impact
Agent replies longer than the chat platform limit were not delivered.
sendMessageaccepts at most 4096 characters.tg_sendtreated any completed curl transfer as success, including HTTP 400message is too longand HTTP 200 bodies with"ok": false.handle_messagethen acked the cron job, so a one-shot job was deleted and a recurring job advanced even though the user never received the text.discord_sendreturned an error before posting when the reply was longer. The cron job was not acked, so the agent ran the same job again on every poll and the Discord user still saw nothing.A normal agent answer is allowed to be up to 32 KiB (
RESPONSE_BUF_SIZE), so both paths are hit by ordinary long answers.Root cause
Outbound send did not split text to the platform limit. Telegram also ignored the Bot API
okfield and HTTP status.Fix
"ok": true.Validation
make test_channel test_telegram18 channel tests and 41 telegram tests passed.
src/channels/discord.ccompiles withSHELLCLAW_GATEWAY.