Fix Telegram send failures for oversized messages (#244)#251
Fix Telegram send failures for oversized messages (#244)#251jmahotiedu wants to merge 4 commits intosipeed:mainfrom
Conversation
Phase 1 - Security regression baseline - add blocking tests for loopback and redirect-to-private web_fetch targets - add filesystem symlink escape and prefix-bypass restriction tests - add shell timeout test to verify child-process cleanup behavior Phase 2 - Web fetch egress guard - introduce stdlib-only fetch target validator for host/IP policy checks - enforce target validation before connect, during redirect, and in dial path - keep public constructor API and add internal test-aware constructor path Phase 3 - Canonical filesystem boundary enforcement - replace prefix checks with canonical workspace containment via filepath.Rel - canonicalize workspace and target paths with symlink-aware resolution - protect create/read/write/list/edit/append flows through shared validation Phase 4 - Shell timeout process-tree cleanup - switch command execution to explicit start/wait with timeout select - add OS-specific process tree helpers for unix process groups and taskkill on windows - preserve existing output contract and timeout messaging semantics Phase 5 - Documentation and contributor guidance - document web_fetch network boundary and complementary security model - add tool security checklist for future built-in tool additions Verification - go test ./pkg/tools -run TestWebTool_WebFetch_Blocks (via golang:1.25) - go test ./pkg/tools -run TestFilesystemTool_Restrict (via golang:1.25) - go test ./pkg/tools -run TestShellTool_Timeout_KillsChildProcesses (via golang:1.25) - go test ./pkg/tools -run TestWebTool_WebFetch_ (via golang:1.25) - go test ./pkg/tools -run TestFilesystemTool_ (via golang:1.25) - go test ./pkg/tools -run TestShellTool_ (via golang:1.25) - go test ./pkg/tools (via golang:1.25) - go generate ./... && go test ./... (via golang:1.25)
|
@Zepan Fixes Telegram send failures for oversized messages (#244). At +871 lines, this is larger than expected for a message splitting fix — worth reviewing the scope. Recommendation: Review carefully. The issue is real (Telegram has a 4096 char limit), but #143 (already merged) addressed Discord splitting. Check if this PR overlaps with the existing implementation or adds Telegram-specific handling. |
|
@jmahotiedu take look into the conflict. |
|
@Leeaandrob I resolved the merge conflicts and pushed an update in 02291c7 (Merge origin/main into fix/telegram-message-length-244). Resolved files: telegram.go go test ./pkg/channels -run 'Telegram|Base' |
|
Quick update on #251:
|
|
Hi @jmahotiedu, thanks for the PR! |
|
Hi @mymmrac, thanks for the review. Updated Verified with: |
Hi @jmahotiedu, I don't see the updated commit, can you check if it's been pushed? Also, I noticed the new |
|
Hi @huaaudio, thanks for the catch. You were right, the update hadn’t been pushed yet. I’ve now pushed commit a6c051e to fix/telegram-message-length-244 (telegram now uses the shared pkg/utils splitter from #436). I also updated the PR description per template to document network_guard.go and the related pkg/tools helper/script changes. Verification run: |
|
@huaaudio @nikolasdehor @Andyi955 quick unblock proposal to get this finished and merged ASAP:
Fastest path:
If maintainers prefer keeping |
|
@jmahotiedu Thanks for the tag and for looking into this! To clarify, #527 (this branch) is the one that implements the universal chunking with full In this PR (#527), I have:
Since this branch is clean and all tests are passing, I'd ask the maintainers to review #527 as the canonical solution. |
|
Already fixed in the refactor branch. |
Description
pkg/utils/SplitMessage(aligned with Refactor/base layer message split #436) instead of duplicated local splitting code.pkg/utils/message.goandpkg/utils/message_test.go.pkg/tools/network_guard.goto validate web fetch targets and enforce non-private egress rules.pkg/tools/web.goto apply network guard checks on initial and redirect targets.pkg/tools/filesystem.goand tests.pkg/tools/shell_process_unix.goandpkg/tools/shell_process_windows.go, plus related shell tests.pkg/tools/README.mdand rootREADME.mdwith security/tooling notes.Type of Change
AI Code Generation
Linked Issue
Technical Context
pkg/utils).Test Environment & Hardware
Proof of Work (Optional)
Click to view verification commands
go test ./pkg/channels ./pkg/utilsgo test ./pkg/toolsChecklist