Skip to content

fix(agent): keep ChatSessionProvider mounted across /home/* navigations#943

Open
Aarjav Jain (A2rjav) wants to merge 1 commit into
browseros-ai:devfrom
A2rjav:fix/927-chat-messages-persist-navigation
Open

fix(agent): keep ChatSessionProvider mounted across /home/* navigations#943
Aarjav Jain (A2rjav) wants to merge 1 commit into
browseros-ai:devfrom
A2rjav:fix/927-chat-messages-persist-navigation

Conversation

@A2rjav
Copy link
Copy Markdown

@A2rjav Aarjav Jain (A2rjav) commented May 5, 2026

Summary

Closes #927

ChatSessionProvider was conditionally mounted — only rendered when shouldUseChatSession() returned true (i.e. only on /home/chat). Any navigation away from that route unmounted the provider and destroyed the in-memory useChat message state. Returning to chat started a fresh session with no history.

  • ChatSessionProvider now unconditionally wraps all /home/* routes
  • Removes the dead shouldUseChatSession helper function
  • Removes the useChatSessionOnHome prop from NewTabLayout
  • Removes associated tests for the removed function

Test plan

  • Open the newtab chat at /home/chat, send a message
  • Navigate to another sub-route (e.g. /home/skills, /home/memory)
  • Navigate back to /home/chat — previous messages should still be visible
  • Verify fresh session still starts on first load (no prior messages on new tab open)
  • Confirm no TypeScript errors (bun run typecheck)

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 5, 2026

PR author is not in the allowed authors list.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

All contributors have signed the CLA. Thank you!
Posted by the CLA Assistant Lite bot.

@A2rjav
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

Closes browseros-ai#927

ChatSessionProvider was conditionally rendered only when shouldUseChatSession()
returned true (i.e. only at /home/chat). Any navigation away from that route
unmounted the provider and destroyed the in-memory useChat message state.

Now ChatSessionProvider unconditionally wraps all /home/* routes so messages
survive sub-route changes. Removes the dead shouldUseChatSession helper,
useChatSessionOnHome prop, and associated tests.
@A2rjav Aarjav Jain (A2rjav) force-pushed the fix/927-chat-messages-persist-navigation branch from bfd6df2 to 0ab1089 Compare May 12, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Chat messages in newtab UI disappear after agent performs page navigation

1 participant