Skip to content

fix(desktop): submit first message after session creation - #63045

Closed
sidharthgehlot wants to merge 1 commit into
NousResearch:mainfrom
sidharthgehlot:fix/desktop-first-message-submit
Closed

fix(desktop): submit first message after session creation#63045
sidharthgehlot wants to merge 1 commit into
NousResearch:mainfrom
sidharthgehlot:fix/desktop-first-message-submit

Conversation

@sidharthgehlot

Copy link
Copy Markdown

Summary

  • allow the intentional new-chat draft promotion onto its newly created stored-session route
  • keep session-isolation protection by validating the returned runtime ID and canonical route before continuing
  • abort if the user genuinely switches chats during post-create async work
  • add regression coverage for both the successful first-message flow and the late-switch race

Root cause

The submit pipeline pinned the new-chat route before session.create. Creation then correctly navigated to the new stored session, but the pipeline interpreted that expected route change as user-driven context drift, cancelled the first submission, and restored the text to the composer.

Test plan

  • npx vitest run --environment jsdom src/app/session/hooks/use-prompt-actions/index.test.tsx (44 passed)
  • npm run typecheck
  • ESLint on the changed files (0 errors; one pre-existing padding warning in the test file)
  • git diff --cached --check
  • independent review of the final diff

Allow the intentional new-chat route promotion without weakening session-switch isolation. Validate the created runtime and canonical stored-session route before continuing, and cover both successful promotion and a late user switch with regression tests.
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused reproducer and race coverage. Current main already implements this first-message/new-chat drift fix, so this PR is redundant.

  • Automated hermes-sweeper review verified 8c288760d0b50107e608ed42df81f48c7ccedde5 (fix(desktop): stop the submit drift guard from aborting every new chat) is on main.
  • apps/desktop/src/app/session/hooks/use-prompt-actions/submit.ts:301 now validates the created runtime session via activeSessionIdRef, then re-pins the stored-session and route baselines at lines 313–316 before submission continues.
  • apps/desktop/src/app/session/hooks/use-prompt-actions/index.test.tsx:1527–1557 covers the promoted new-chat route and asserts prompt.submit uses the created runtime session; the adjacent test covers the late-switch abort.
  • The timeline's bug(desktop): first message in a new session leaves a blank session — no messages, no error, no response #63078 cross-reference also describes broader backend and churn scenarios; those are separate from the exact first-message guarantee implemented here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sweeper:implemented-on-main Sweeper: behavior already present on current main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants