This repository was archived by the owner on Sep 30, 2026. It is now read-only.
Repository navigation
Queue skill invocations mid-turn instead of rejecting them - #17
Merged
Merged
Conversation
A `/skill prompt` typed while a turn is running was force-submitted as a new server Message, which the server rejects with "Already processing a message" (client_lifecycle.rs start_processing_message). A skill invocation that carries a trailing prompt is a real model turn, so it should follow queue_mode like ordinary text rather than force-submitting into the busy turn. Because a queued message drains as a plain user turn and the skill prompt reaches the model only through active_skill at turn-build time, a queued `/skill prompt` must activate the skill at enqueue time and queue only the trailing prompt (active_skill persists to the drain). - input.rs: send_action keeps immediate submit for `!` shell and every builtin/local slash command, but routes a registered skill-with-prompt invocation through queue_mode (input_is_queueable_skill_turn). queue_message activates the skill and queues only the trailing prompt (activate_queued_skill_and_extract_prompt). A bare `/skill` with no prompt and an unknown slash keep their immediate behavior. - remote/input_dispatch.rs: submit_remote_slash_input, the remote repro path, queues the trailing prompt (or interleaves it outside queue mode) under the already-active skill instead of always submitting. - tests: add queue-when-processing coverage for a registered skill-with-prompt and confirm a bare activation is not queued. Validated: cargo build/clippy -p jcode-tui clean, targeted tests pass, cargo build -p jcode --bin jcode clean.
# Conflicts: # scripts/code_size_budget.json
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
Typing a
/skill promptwhile a turn is running throws "Already processing a message" instead of queueing. The server busy guard (client_lifecycle.rsstart_processing_message) correctly rejects aRequest::Messagemid-turn, but the TUI force-submits a slash skill invocation as a new turn rather than routing it throughqueue_modelike ordinary text.A skill invocation that carries a trailing prompt (
/foo do the thing) is a real model turn: the skill activates and the prompt is sent. So mid-turn it should queue (or interleave) exactly like a plain message.Fix (enqueue-time skill activation)
A queued message drains as a plain user turn, and the skill prompt reaches the model only through
active_skillat turn-build time. So a queued/skill promptmust activate the skill now (persisting inactive_skilluntil the drain) and queue only the trailing prompt.input.rs:send_actionkeeps immediate submit for!shell and every builtin/local slash command, but routes a registered skill-with-prompt invocation throughqueue_mode(input_is_queueable_skill_turn).queue_messageactivates the skill and queues only the trailing prompt (activate_queued_skill_and_extract_prompt). A bare/skill(no prompt, pure activation) and an unknown slash keep their immediate behavior.remote/input_dispatch.rs:submit_remote_slash_input(the remote repro path) queues the trailing prompt under the already-active skill in queue mode, or interleaves it otherwise, instead of always submitting immediately.Validation
cargo build -p jcode-tuicleancargo clippy -p jcode-tuiclean (only pre-existing warnings)skill_invocation_with_prompt_queues_when_processing_in_queue_mode,bare_skill_activation_is_not_queued_while_processing,test_skill_invocation_not_queued,skill_invocation_with_prompt_activates_and_submits_in_one_turncargo build -p jcode --bin jcodeclean