This repository was archived by the owner on Sep 30, 2026. It is now read-only.
Repository navigation
Add opt-in one-per-turn queue drain - #18
Merged
Merged
Conversation
By default, every queued message is drained together and joined into a single request. Some workflows want each queued message delivered as its own turn instead. Add an opt-in mode that does that, off by default so the existing combine-on-send behavior is unchanged. - config: new `features.queue_drain_one_per_turn` (default false), plumbed into the App session field and documented in the default config template. - input.rs: `process_queued_messages` now takes its per-iteration batch via `take_next_queued_batch`. In combine mode it takes the whole queue (as before); in one-per-turn mode it pops only the first queued message, leaving the rest for later loop iterations so each is sent as its own turn. Pending hidden `[SYSTEM: ...]` reminders ride with the batch either way, since a reminder is not itself a user turn. - toggle: Ctrl+N flips the mode per session, mirroring the Ctrl+T queue-mode toggle, and is registered as a known hotkey. - tests: cover whole-batch drain (default), first-message-only drain (one-per-turn), and the Ctrl+N toggle. Existing combine tests unchanged. Validated: cargo build/clippy -p jcode-config-types -p jcode-base -p jcode-tui clean, targeted tests pass, cargo build -p jcode --bin jcode clean.
# Conflicts: # scripts/code_size_budget.json
# Conflicts: # scripts/code_size_budget.json
# Conflicts: # scripts/code_size_budget.json
This was referenced Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Queued messages are all drained together:
process_queued_messagestakes the wholequeued_messagesvec andjoin("\n\n")s it into a single user turn. Some workflows want each queued message delivered as its own turn instead.Fix (opt-in, default off)
Add a mode that drains one queued message per turn, off by default so the existing combine-on-send behavior is unchanged.
features.queue_drain_one_per_turn(defaultfalse), plumbed into the App session field (seeded in both constructors) and documented in the default config template.input.rs:process_queued_messagesnow gets its per-iteration batch from a newtake_next_queued_batchhelper. In combine mode it takes the whole queue (unchanged); in one-per-turn mode it pops only the first queued message, leaving the rest for laterwhile-loop iterations so each is sent as its own turn. Pending hidden[SYSTEM: ...]reminders ride with the batch either way (a reminder is not itself a user turn).test_queue_message_combines_on_send,test_multiple_queued_messages) unchanged.Validation
cargo build -p jcode-config-types -p jcode-base -p jcode-tuicleancargo clippyon the same crates clean (only pre-existing warnings)test_queue_drain_combine_takes_whole_batch_by_default,test_queue_drain_one_per_turn_pops_first_message_only,test_ctrl_n_toggles_queue_drain_one_per_turn,test_queue_message_combines_on_send,test_multiple_queued_messages, plustest_generated_default_config_*(default template still parses)cargo build -p jcode --bin jcodeclean