Skip to content

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

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

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

Conversation

@A2rjav

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

Copy link
Copy Markdown

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

greptile-apps Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

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
@shadowfax92

Copy link
Copy Markdown
Contributor

Thanks so much for contributing to BrowserOS! 🙏

We're doing some housekeeping on our PR queue and closing out PRs that have been open for more than 7 days. This isn't a reflection on your work — we really appreciate the time and effort you put in.

If this is still relevant, please feel free to reopen it or open a fresh PR and we'll take another look. Thanks again for being part of the project! 🚀

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

2 participants