Skip to content

feat(core): add message queue for user input during inference - #224

Merged
bug-ops merged 2 commits into
mainfrom
feat/m18/message-queue
Feb 13, 2026
Merged

feat(core): add message queue for user input during inference#224
bug-ops merged 2 commits into
mainfrom
feat/m18/message-queue

Conversation

@bug-ops

@bug-ops bug-ops commented Feb 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add bounded FIFO message queue (max 10) to agent loop for user input during model inference
  • Extend Channel trait with try_recv() (non-blocking poll) and send_queue_count()
  • Merge consecutive messages within 500ms window
  • TUI: queue badge indicator [+N queued], Ctrl+K to clear queue
  • TelegramChannel: implement try_recv() via mpsc
  • Extract process_user_message() from agent run loop

Closes #221

Test plan

  • 8 new queue unit tests (enqueue, merge, overflow, drain, clear, FIFO order)
  • 3 TUI channel tests (try_recv, send_queue_count)
  • All 1249 existing tests pass, 0 regressions
  • Clippy clean, fmt clean
  • Manual: verify TUI badge appears when typing during inference
  • Manual: verify Ctrl+K clears queued messages

@github-actions github-actions Bot added enhancement New feature or request channels zeph-channels crate (Telegram) rust Rust code changes core zeph-core crate size/L Large PR (201-500 lines) and removed enhancement New feature or request labels Feb 13, 2026
@codecov-commenter

codecov-commenter commented Feb 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.76923% with 60 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/zeph-core/src/agent.rs 85.53% 34 Missing ⚠️
crates/zeph-tui/src/app.rs 10.00% 9 Missing ⚠️
crates/zeph-tui/src/widgets/input.rs 0.00% 9 Missing ⚠️
crates/zeph-channels/src/telegram.rs 0.00% 8 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #224      +/-   ##
==========================================
+ Coverage   81.32%   81.36%   +0.04%     
==========================================
  Files          78       78              
  Lines       22174    22426     +252     
==========================================
+ Hits        18034    18248     +214     
- Misses       4140     4178      +38     
Files with missing lines Coverage Δ
crates/zeph-core/src/channel.rs 78.16% <100.00%> (+2.99%) ⬆️
crates/zeph-tui/src/channel.rs 100.00% <100.00%> (ø)
crates/zeph-tui/src/event.rs 67.30% <ø> (ø)
crates/zeph-channels/src/telegram.rs 34.95% <0.00%> (-1.18%) ⬇️
crates/zeph-tui/src/app.rs 79.57% <10.00%> (-0.89%) ⬇️
crates/zeph-tui/src/widgets/input.rs 0.00% <0.00%> (ø)
crates/zeph-core/src/agent.rs 67.79% <85.53%> (+1.51%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Add bounded FIFO message queue to agent loop so users can submit
messages while the model is busy. Messages are drained from the
channel transport buffer via non-blocking try_recv() and queued
in a VecDeque (max 10 items). Consecutive messages within 500ms
are merged. Queue count is forwarded to TUI as a badge indicator.

- Extend Channel trait with try_recv() and send_queue_count()
- Add QueuedMessage, drain_channel, enqueue_or_merge, clear_queue
- Extract process_user_message() from agent run loop
- TUI: AgentEvent::QueueCount, badge rendering, Ctrl+K to clear
- TelegramChannel: implement try_recv() via mpsc
- Add 8 queue unit tests, all 1249 tests pass
@bug-ops
bug-ops force-pushed the feat/m18/message-queue branch from 55b4b0c to 29ece5f Compare February 13, 2026 22:09
@github-actions github-actions Bot added the enhancement New feature or request label Feb 13, 2026
@bug-ops
bug-ops enabled auto-merge (squash) February 13, 2026 22:10
@bug-ops
bug-ops disabled auto-merge February 13, 2026 22:15
Update mdBook guides (channels, TUI, architecture), README, and
CHANGELOG for the bounded message queue feature (#221).
@github-actions github-actions Bot added documentation Improvements or additions to documentation size/XL Extra large PR (500+ lines) and removed size/L Large PR (201-500 lines) labels Feb 13, 2026
@bug-ops
bug-ops enabled auto-merge (squash) February 13, 2026 22:19
@bug-ops
bug-ops merged commit f40e693 into main Feb 13, 2026
20 checks passed
@bug-ops
bug-ops deleted the feat/m18/message-queue branch February 13, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channels zeph-channels crate (Telegram) core zeph-core crate documentation Improvements or additions to documentation enhancement New feature or request rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(core): message queue for user input while model is busy

2 participants