Skip to content

Refactor: extract shared adapter helpers (attachments, channel-log, serial-queue)#10

Draft
geminixiang wants to merge 2 commits into
mainfrom
codex/shared-adapter-helpers
Draft

Refactor: extract shared adapter helpers (attachments, channel-log, serial-queue)#10
geminixiang wants to merge 2 commits into
mainfrom
codex/shared-adapter-helpers

Conversation

@geminixiang

@geminixiang geminixiang commented Apr 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Extract duplicated helper logic from Discord, Slack, and Telegram adapters into src/adapters/shared/:
    • attachments.tscreateAttachmentTarget and downloadAttachmentToFile for unified attachment handling
    • channel-log.tsappendChannelLog and createBotLogEntry for consistent JSONL logging
    • serial-queue.tsSerialWorkQueue for sequential event processing
  • Refactor all three adapter bots to use the shared modules, removing ~200 lines of duplicated code
  • Add dedicated unit tests for each shared module

Test plan

  • test/shared-attachments.test.ts — attachment target creation and file download
  • test/shared-channel-log.test.ts — log directory creation and entry formatting
  • test/shared-serial-queue.test.ts — queue ordering, error handling, and concurrency

🤖 Generated with Claude Code

@geminixiang geminixiang changed the title Fix Telegram attachment downloads and add coverage Refactor: extract shared adapter helpers (attachments, channel-log, serial-queue) Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant