Skip to content

feat: move AI workflows to Worker with durable bot relay - #68

Draft
Yuna-Celisse wants to merge 13 commits into
mainfrom
codex/flue-queue-bridge
Draft

Yuna-Celisse wants to merge 13 commits into
mainfrom
codex/flue-queue-bridge

Conversation

@Yuna-Celisse

@Yuna-Celisse Yuna-Celisse commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

HuaJiBot hosts platform adapters while the independent Worker now runs chat, vision, MCP search and daily summaries. This adds signed HTTPS forwarding, a durable SQLite ingress outbox, reply-thread mapping, Cloudflare HTTP pull delivery, retries and a persistent delivery ledger. Ordinary group messages archive without invoking a model; image URLs accompany prompted turns. Scheduled summary replies use validated date anchors without a fake platform reply target.

The selected deployment is enabled for robot 3623498320/group 466691612. Local AIChat and DailySummary are disabled. The Worker owns D1 chat retention, a durable summary Workflow, authenticated WebSearch MCP and native image conversations. The separate Worker source is in the local huaji-agent repository and is not yet published on GitHub.

Deployment preserves adapter credentials and other services, backs up original config/data, and provides automatic startup rollback. 494 LiteDB records were exported read-only/imported idempotently; authenticated platform history covered the maintenance window and replayed 50 records with deduplication. Bot image: huajibot-local:worker-features-v4.

Validation:

  • 12 bridge tests pass, including real OneBot event normalization, outbox restart/deduplication and scheduled-summary routing.
  • 23 independent Worker tests and TypeScript/build checks pass.
  • Real isolated Worker/MCP search, image recognition, image follow-up without prior color disclosure, D1 archive/import, Workflow summary and Queue replies pass. Synthetic jobs were acknowledged without production-group sends.
  • Production bot running with zero restarts, correct OneBot identity/membership, local summary disabled, and ongoing D1 message archiving verified.

Real QQ group acceptance and platform failure/restart/DLQ testing remain pending. Adapter acceptance before receipt persistence retains the documented duplicate-delivery crash window. Forwarding cannot recover platform events never delivered while offline; the migration maintenance window was backfilled from authenticated platform history. Old AIChat data is retained but old image threads are not automatically recreated.

Refs #64.

port = endpoint.port or (443 if endpoint.scheme == "wss" else 80)
connection = socket.create_connection((endpoint.hostname, port), timeout=10)
if endpoint.scheme == "wss":
connection = ssl.create_default_context().wrap_socket(connection, server_hostname=endpoint.hostname)
@Yuna-Celisse Yuna-Celisse changed the title feat: add Flue bridge and Cloudflare Queue reply consumer feat: move AI workflows to Worker with durable bot relay Oct 3, 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.

2 participants