feat(feishu): add armv7 architecture support#1719
Open
darrenzeng2025 wants to merge 2 commits intosipeed:mainfrom
Open
feat(feishu): add armv7 architecture support#1719darrenzeng2025 wants to merge 2 commits intosipeed:mainfrom
darrenzeng2025 wants to merge 2 commits intosipeed:mainfrom
Conversation
…d URL sanitization (sipeed#1208) * feat(channels): enhance QQ channel with group support, typing, media, and URL sanitization Add group message routing alongside existing C2C (direct) support using chatType sync.Map to track whether a chatID is group or direct. Implement passive reply with msg_id/msg_seq tracking for multi-part responses. Add StartTyping (InputNotify msg_type=6 with periodic resend), SendMedia (RichMediaMessage for HTTP/HTTPS URLs), and configurable Markdown message support. Replace unbounded dedup map with TTL-based expiry and janitor goroutine. Sanitize URLs in group messages by replacing dots in domains with fullwidth period to avoid QQ's URL blacklist rejection (error 40054010). Add rate limit config (5 msg/s) and MaxMessageLength/SendMarkdown config fields. * fix(channels): address review feedback on QQ channel implementation - Fix goroutine leak: reinitialize done channel and sync.Once in Start() to prevent multiple janitor goroutines on restart - Fix double-close panic: guard close(done) with sync.Once in Stop() - Fix StartTyping context: use c.ctx (channel lifecycle) instead of caller's ctx (request lifecycle) for typing goroutine - Refactor: extract getChatKind() helper to deduplicate chatType lookup across Send(), StartTyping(), and SendMedia() - Fix: use new(atomic.Uint64) instead of taking address of local var - Fix: require explicit http(s):// scheme in URL regex to avoid false positives on version strings like "1.2.3" - Optimize: collect expired keys before deleting in dedupJanitor to reduce lock hold time - Fix: remove MaxMessageLength zero-value override in NewQQChannel since defaults.go already sets 2000 * fix(channels): address second round of review feedback on QQ channel - Fix SendMedia: bypass media store for direct http(s) URLs in part.Ref; only fall back to store.Resolve for media:// refs; log clear warning for local-only paths instead of silently skipping - Fix chatType routing: default unknown chatIDs to "group" (safer for QQ since outbound-only destinations like reasoning_channel_id are groups); pre-register reasoning_channel_id as group at Start() time; add debug log for untracked chatIDs - Add dedup hard cap (10000 entries): evict oldest entry when map exceeds capacity to prevent unbounded memory growth under high traffic
Enable Feishu channel support on ARMv7 (32-bit) architecture by: 1. Update build constraints in feishu_64.go to include 'arm' architecture 2. Update build constraints in feishu_32.go to exclude 'arm' architecture 3. Add ARMV7_SUPPORT.md documentation explaining: - The issue with Lark SDK's math.MaxInt64 on 32-bit architectures - How to patch the SDK for ARMv7 support - Build instructions for ARMv7 4. Add build-feishu-armv7.sh script to automate the build process The Feishu SDK has a known issue where math.MaxInt64 overflows on 32-bit architectures. This change allows users to build PicoClaw for ARMv7 by patching the SDK before building. Closes sipeed#1675
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.
Summary
This PR enables Feishu channel support on ARMv7 (32-bit) architecture, fixing Issue #1675.
Changes
feishu_64.go- Addedarmto the build tags to enable ARMv7 supportfeishu_32.go- Added!armto exclude ARMv7 from the stub implementationdocs/channels/feishu/ARMV7_SUPPORT.mdexplaining:math.MaxInt64overflows on 32-bit architecturesscripts/build-feishu-armv7.shto automate the build processTechnical Details
The Feishu SDK (
github.com/larksuite/oapi-sdk-go/v3) has a known issue wheremath.MaxInt64inservice/drive/v1/api_ext.gocauses a compile error on 32-bit architectures:This PR allows users to build PicoClaw for ARMv7 by:
math.MaxInt64withint(^uint(0) >> 1)Testing
Related Issues
Closes #1675