Skip to content

feat(feishu): add armv7 architecture support#1719

Open
darrenzeng2025 wants to merge 2 commits intosipeed:mainfrom
darrenzeng2025:feat/1675-feishu-armv7
Open

feat(feishu): add armv7 architecture support#1719
darrenzeng2025 wants to merge 2 commits intosipeed:mainfrom
darrenzeng2025:feat/1675-feishu-armv7

Conversation

@darrenzeng2025
Copy link
Contributor

Summary

This PR enables Feishu channel support on ARMv7 (32-bit) architecture, fixing Issue #1675.

Changes

  1. Updated build constraints in feishu_64.go - Added arm to the build tags to enable ARMv7 support
  2. Updated build constraints in feishu_32.go - Added !arm to exclude ARMv7 from the stub implementation
  3. Added documentation - Created docs/channels/feishu/ARMV7_SUPPORT.md explaining:
    • The root cause: Lark SDK's use of math.MaxInt64 overflows on 32-bit architectures
    • How to patch the SDK for ARMv7 support
    • Build instructions for ARMv7
  4. Added build script - Created scripts/build-feishu-armv7.sh to automate the build process

Technical Details

The Feishu SDK (github.com/larksuite/oapi-sdk-go/v3) has a known issue where math.MaxInt64 in service/drive/v1/api_ext.go causes a compile error on 32-bit architectures:

constant 9223372036854775807 overflows int

This PR allows users to build PicoClaw for ARMv7 by:

  1. Patching the SDK to replace math.MaxInt64 with int(^uint(0) >> 1)
  2. Building with the patched SDK

Testing

  • Tested building for ARMv7 with patched SDK
  • Tested Feishu channel functionality on ARMv7 device
  • Verified 64-bit builds still work

Related Issues

Closes #1675

alexhoshina and others added 2 commits March 18, 2026 10:57
…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
@sipeed-bot sipeed-bot bot added type: enhancement New feature or request domain: channel domain: build dependencies Pull requests that update a dependency file labels Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file domain: build domain: channel type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 希望飞书插件支持armv7 CPU的安卓设备

2 participants