fix(copilot): show helpful error message for third-party cookie blocking#2933
Open
AliSharjeell wants to merge 2 commits into
Open
fix(copilot): show helpful error message for third-party cookie blocking#2933AliSharjeell wants to merge 2 commits into
AliSharjeell wants to merge 2 commits into
Conversation
Add `features.side_panel.default_state` config option that allows users to set the side panel to remain closed by default when display='side' elements are added, restoring v2.10 behavior. Users can now configure in their config.toml: ```toml [features] side_panel.default_state = "closed" ``` When not specified, the panel auto-opens as before (backward compatible). Closes Chainlit#2911 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
When third-party cookies are blocked (Safari, Chrome private mode, etc.), the JWT authentication fails with a cryptic error. This change detects cookie-related errors and shows a user-friendly message explaining the issue and how to fix it. Closes Chainlit#2013
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.
Summary
When third-party cookies are blocked (Safari, Chrome private mode, etc.), the JWT authentication fails with a cryptic error message. This change detects cookie-related errors and shows a user-friendly message explaining the issue and how to fix it.
Changes
Added
isCookieBlockedError()andformatAuthError()helper functions inlibs/copilot/src/app.tsx:isCookieBlockedError()- Detects errors containing cookie-related keywordsformatAuthError()- Converts generic errors to helpful messages for usersWhen the error contains "set-cookie", "cookie", "blocked", "third-party", etc., the error message becomes:
Related Issue
Closes #2013 — Third-Party Cookies Blocked in Safari, Preventing Copilot Usage
Summary by cubic
Shows a clear Copilot auth error when third‑party cookies are blocked and adds a config to keep the chat side panel closed by default.
Bug Fixes
New Features
features.side_panel.default_state(open|closed) to control auto‑open behavior; defaults to auto‑open for backward compatibility.Written for commit f5928c9. Summary will update on new commits. Review in cubic