feat(discord): add message context for replied messages#1084
Closed
liugangjian wants to merge 5 commits intosipeed:mainfrom
Closed
feat(discord): add message context for replied messages#1084liugangjian wants to merge 5 commits intosipeed:mainfrom
liugangjian wants to merge 5 commits intosipeed:mainfrom
Conversation
… JSON When API endpoint is misconfigured (e.g., wrong api_base URL), the API returns an HTML error page. Previously, the error message was cryptic: "failed to unmarshal response: invalid character '<' looking for beginning of value". Now we detect HTML responses and provide a clear error message guiding users to check their api_base URL configuration. Fixes sipeed#1068 🤖 AI Code Generation: Fully AI generated - AI implemented the fix and I reviewed and tested it
When restrict_to_workspace is true, guardCommand now properly skips URL paths like 'wttr.in/Beijing' in curl commands. Previously, these were incorrectly matched as relative paths and blocked. Issue: sipeed#1042
Add isBinaryFile function to detect binary files (PDF, images, videos, etc.) by checking the ratio of non-printable characters in the first 512 bytes. When a binary file is detected, return an error message instead of returning garbled content. Fixes: sipeed#1049
Previously, the session flag was ignored in the agent command, with custom session keys being replaced by the default routing session. The issue was caused by the code only honoring session keys that started with the prefix 'agent:'. This fix modifies the condition on how the session key is selected to honor any custom session key provided via command line --session flag, regardless of prefix. Now the custom session keys like "foobar" will generate "foobar.json" file instead of "agent_main_main.json". FIXES sipeed#1039 🤖 AI Assisted - Human designed the solution, AI helped implement it
Add test case verifying that read_file tool properly detects and rejects binary files such as PDFs with appropriate error message, preventing the generation of large amounts of garbage characters.
Collaborator
|
Duplicate of #1047 |
Author
|
Closing as duplicate of #1047 |
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
Implements #1048
When Discord users reply to messages, the bot was only forwarding the new message text. The original quoted message content was lost, making it difficult for the LLM to understand context.
Changes
m.ReferencedMessageand add quoted content to the message<#123456789>to#channel-nameTechnical Details
enhanceMessageContent()function to process message contextresolveChannelMentions()to decode channel IDsprocessMessageLinks()to expand message URLsTesting
Type of Change
AI Code Generation