Skip to content

Conversation

@ulivz
Copy link
Member

@ulivz ulivz commented Sep 17, 2025

Summary

Fixes the issue where users are redirected to the home page when a query stream request returns a 500 error, even after session creation succeeds.

Problem: When creating a session from the home page, if createSession() succeeds but sendMessage() fails with a 500 error, users are incorrectly redirected back to the home page instead of staying on the chat interface.

Solution:

  • Separate error handling for session creation vs message sending in WelcomePage
  • Add messageErrorAtom to track message sending failures
  • Add MessageErrorBanner component to display errors in chat interface
  • Update sendMessageAction to set error state for UI display
  • Ensure users stay on chat page when query stream fails

Changes:

  • Modified handleChatSubmit in WelcomePage.tsx to catch message errors separately
  • Added messageErrorAtom in ui.ts for error state management
  • Updated sendMessageAction in sessionActions.ts to set error state
  • Created MessageErrorBanner.tsx component for error display
  • Updated ChatPanel.tsx to include error banner
  • Updated useSession.ts hook to expose message error state

Checklist

  • Added or updated necessary tests (Optional).
  • Updated documentation to align with changes (Optional).
  • Verified no breaking changes, or prepared solutions for any occurring breaking changes (Optional).
  • My change does not involve the above items.

- Separate session creation errors from message sending errors in WelcomePage
- Add messageErrorAtom to track message sending failures
- Add MessageErrorBanner component to display errors in chat interface
- Update sendMessageAction to set error state instead of just throwing
- Ensure users stay on chat page even when query stream returns 500 error
@netlify
Copy link

netlify bot commented Sep 17, 2025

Deploy Preview for agent-tars-docs ready!

Name Link
🔨 Latest commit 5e1e2c7
🔍 Latest deploy log https://app.netlify.com/projects/agent-tars-docs/deploys/68ca02a3ce58f40008168408
😎 Deploy Preview https://deploy-preview-1547--agent-tars-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

2 participants