- Add activeRequests counter to track in-flight AI requests
- Limit concurrent requests to 1 (MAX_CONCURRENT_REQUESTS)
- drainQueue now waits if at max concurrency before processing next message
- Prevents overwhelming streaming LLM API with multiple concurrent requests
This resolves:
- AI LLM API overload from concurrent requests
- Streaming response conflicts
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Sync channels in parallel with concurrency limit of 3 instead of sequentially
- Reduces backlog sync time from O(n) to O(n/3) for n channels
- Prevents overwhelming Discord API with too many concurrent requests
- Maintains per-channel message batching for memory efficiency
This resolves:
- Slow backlog sync performance
- Sequential channel processing bottleneck
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Skip attachment download/upload to Picser (was failing with 400 errors)
- Store Discord's original attachment URLs directly as uploaded_url
- Mark attachments as immediately uploaded with Discord URL
- Remove processAttachmentUpload call and unused attachmentUploader import
- Eliminates slow upload cycle and API failures
This resolves:
- Attachment upload 400 errors
- Performance slowdown from failed upload retries
- Unnecessary network overhead
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Fix client startup order: fetch/apply server UI state BEFORE loadGuilds() to prevent overwriting persisted state with default guild
- Remove auto-post of first guild in loadGuilds() — let server state drive selection
- Refactor collectWatchableChannels() to collect text channels fast first, then discover threads in parallel with 5s per-channel timeout and 30s overall timeout to prevent blocking message sync
- Ignore /favicon.ico 404 in error logging to reduce noise
Fixes:
- UI state now persists across restart (was being overwritten by client startup race)
- Backlog sync no longer hangs on thread discovery (was blocking before message sync)
- Cleaner logs without favicon 404 errors
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Remove ES module import statement from dashboard.js
- Use global Tone object loaded via CDN
- Remove type=module from script tag
- Fixes module resolution error
- Replace AudioWorkletNode with Tone.UserMedia for microphone capture
- Use Tone.Analyser for waveform analysis and Tone.Meter for level detection
- Implement proper stereo audio capture with real-time PCM transmission
- Use Tone.context for audio playback with proper buffer handling
- Add Tone.js CDN to HTML template
- Convert dashboard.js to ES module for Tone.js import
- Improve audio quality and reliability with battle-tested library
- Remove broadcastOpusToWeb from types and webserver
- Revert recorder to PCM-only broadcast path
- Remove WebCodecs AudioDecoder from dashboard.js
- Simplify WebSocket handler to just play PCM frames
- Remove Howler.js and Tone.js dependencies
- Keep simple AudioContext playback that works reliably
- Add broadcastOpusToWeb to PcmBroadcaster interface for raw Opus packets
- Server broadcasts Opus frames with mode byte (1) + user hash + packet data
- Browser detects packet mode: mode=1 for Opus, mode=0 for legacy PCM
- Implement WebCodecs AudioDecoder for Opus decoding in browser
- Keep existing PCM playback as fallback for compatibility
- Show error if WebCodecs unsupported
- Fixes listen feature under Bun where native Opus decode unavailable
- Added functions to retrieve message location, sticker metadata, and display content in messageCapture.ts.
- Updated captureMessage function to store thread information and sticker metadata in the database.
- Modified messageStore.ts to support querying messages and attachments by thread ID.
- Updated types.ts to include thread_id in AttachmentRecord.
- Altered database schema in muxer-queue.ts to add thread_id column to attachments.
- Introduced ChannelSummary interface and listWatchableChannels method in voiceController.ts to fetch watchable channels.
- Added API endpoint in webserver.ts to retrieve channels for a given guild.
- Add /api/messages endpoint for querying text and image data
- Add WebSocket broadcast functions for real-time updates
- Support message_created, message_updated, message_deleted events
- Support attachment_uploaded event for real-time image updates
- Register message capture handlers on bot ready
- Export getDatabase function from muxer-queue
- Initialize database schema for messages and attachments
- Add message store with database operations (insert, update, query)
- Implement attachment uploader with picser integration
- Add Discord event listeners for message create/update/delete
- Support attachment upload with retry logic and error handling
- Add comprehensive unit tests for message store and uploader
- Added graceful shutdown functionality to handle SIGINT, SIGTERM, uncaught exceptions, and unhandled promise rejections.
- Integrated stopRecording and pause functionality during shutdown.
- Enhanced logging for shutdown steps and error handling.
- Updated package.json to include pino-pretty for improved logging output.