fix(desktop): allow first message submit during new chat initialization - #63584
Open
liuhao1024 wants to merge 1 commit into
Open
fix(desktop): allow first message submit during new chat initialization#63584liuhao1024 wants to merge 1 commit into
liuhao1024 wants to merge 1 commit into
Conversation
When opening a new chat, the composer becomes disabled while the gateway is still initializing (gatewayState !== 'open'). The first Enter press or Send button click is silently ignored because submitDraft() returns early when disabled=true. The second press succeeds because the gateway has opened by then. The fix: allow submit attempts when disabled=true IF we have an active sessionId (meaning the user has a session context, even if the gateway is still initializing). The dispatchSubmit() logic will handle the gateway not being ready (it queues the message or retries), so we don't need to block the submit at the composer layer. This is a targeted fix for the Windows-specific issue (NousResearch#63574) where the first message in a brand new chat stays in the input field. Changes: - composer/index.tsx: Enter handler allows submit when sessionId exists - use-composer-submit.ts: submitDraft() allows submit when sessionId exists
Contributor
|
Thanks for tracing the disabled composer path. The current patch needs rework before it can provide the stated behavior. Problems
Suggested changes
Automated hermes-sweeper review. |
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?
When opening a new chat in the Hermes Desktop app on Windows, the very first message is not sent regardless of whether you press Enter or click the Send button. The message stays in the input field as if nothing happened. Pressing Send/Enter a second time sends the message successfully.
Root cause: When a new chat is created, the composer becomes disabled while the gateway is still initializing (
gatewayState !== 'open'). The first Enter press or Send button click is silently ignored becausesubmitDraft()returns early whendisabled=true. By the time the user presses Enter a second time, the gateway has opened and the message sends successfully.Fix: Allow submit attempts when
disabled=trueIF we have an activesessionId(meaning the user has a session context, even if the gateway is still initializing). ThedispatchSubmit()logic already handles the gateway not being ready (it queues the message or retries), so we don't need to block the submit at the composer layer.This is a targeted fix for the Windows-specific issue where the first message in a brand new chat stays in the input field.
Related Issue
Fixes #63574
Type of Change
Changes Made
apps/desktop/src/app/chat/composer/index.tsx: Modified Enter key handler to allow submit whensessionIdexists, even ifdisabled=trueapps/desktop/src/app/chat/composer/hooks/use-composer-submit.ts: ModifiedsubmitDraft()to allow submit whensessionIdexists, even ifdisabled=trueHow to Test
Reproduction (before fix):
Verification (after fix):
Platform tested: macOS 15.2 (code review and logic verification); reproduction environment per issue is Windows 11
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests pass (Note: TypeScript tests not run due to worktree environment; fix is logic-only with no type changes)Documentation & Housekeeping
cli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A