fix(desktop): slash commands queued when busy and chip |0 suffix leak#39289
Merged
Conversation
…x leak Two fixes for desktop app slash command handling: 1. Slash commands submitted while the agent is busy now execute immediately instead of being queued. Previously submitDraft() unconditionally queued any draft when busy, but slash commands are client-side operations or self-contained gateway RPCs that should run regardless of busy state (matching TUI behavior). executeSlashCommand already has its own per-command busy guard for commands that genuinely need an idle session. 2. Slash command trigger items no longer leak the "|index" suffix from their item.id into the serialized chip text. The toItem callback now sets rawText in metadata so hermesDirectiveFormatter.serialize takes the direct-insertion path instead of the legacy @type:id fallback. This also means slash commands enter the composer as plain text (not chips), matching selectSkinSlashCommand and TUI behavior.
Contributor
🔎 Lint report:
|
13 tasks
davidgut1982
pushed a commit
to davidgut1982/hermes-agent
that referenced
this pull request
Jun 5, 2026
…x leak (NousResearch#39289) Two fixes for desktop app slash command handling: 1. Slash commands submitted while the agent is busy now execute immediately instead of being queued. Previously submitDraft() unconditionally queued any draft when busy, but slash commands are client-side operations or self-contained gateway RPCs that should run regardless of busy state (matching TUI behavior). executeSlashCommand already has its own per-command busy guard for commands that genuinely need an idle session. 2. Slash command trigger items no longer leak the "|index" suffix from their item.id into the serialized chip text. The toItem callback now sets rawText in metadata so hermesDirectiveFormatter.serialize takes the direct-insertion path instead of the legacy @type:id fallback. This also means slash commands enter the composer as plain text (not chips), matching selectSkinSlashCommand and TUI behavior.
changman
pushed a commit
to changman/hermes-agent
that referenced
this pull request
Jun 10, 2026
…x leak (NousResearch#39289) Two fixes for desktop app slash command handling: 1. Slash commands submitted while the agent is busy now execute immediately instead of being queued. Previously submitDraft() unconditionally queued any draft when busy, but slash commands are client-side operations or self-contained gateway RPCs that should run regardless of busy state (matching TUI behavior). executeSlashCommand already has its own per-command busy guard for commands that genuinely need an idle session. 2. Slash command trigger items no longer leak the "|index" suffix from their item.id into the serialized chip text. The toItem callback now sets rawText in metadata so hermesDirectiveFormatter.serialize takes the direct-insertion path instead of the legacy @type:id fallback. This also means slash commands enter the composer as plain text (not chips), matching selectSkinSlashCommand and TUI behavior.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
Fixes two bugs in the desktop app's slash command handling compared to the TUI:
Slash commands get queued instead of running immediately when the agent is busy. In the TUI,
/yolo,/skin,/status, etc. execute instantly regardless of busy state. In the desktop composer,submitDraft()unconditionally queued any draft whenbusy && hasComposerPayload, forcing all slash commands to wait for the current turn to finish. This is wrong — most slash commands are client-side operations or self-contained gateway RPCs that don't need an idle session.Slash command chips show a
|0suffix. When selecting a slash command from the autocomplete popover, the trigger item'sidincludes a|indexsuffix for adapter uniqueness (e.g./status|0). Because slash item metadata didn't includerawText/insertId,hermesDirectiveFormatter.serializefell through to the legacy@${item.type}:${item.id}path, producing@slash:/status|0— the|0leaked into both the chip label and the submitted text.Related Issue
Fixes #
Type of Change
Changes Made
apps/desktop/src/app/chat/composer/index.tsx— AddedSLASH_COMMAND_REcheck insubmitDraft()before the queue branch. Slash commands (no attachments) bypass the queue and go straight toonSubmit()→executeSlashCommand(), which has its own per-command busy guard.apps/desktop/src/app/chat/composer/hooks/use-slash-completions.ts— AddedrawText: commandto slash item metadata sohermesDirectiveFormatter.serializereturns plain command text (e.g./status) instead of@slash:/status|0. Slash commands now enter the composer as plain text, matchingselectSkinSlashCommandand TUI behavior.How to Test
/statusor/yoloand press Enter/and select a slash command from the popover/status|0(or the plain text contains|0)/statusas plain text, no|0suffixChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings)cli-config.yaml.exampleif I added/changed config keysCONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows