Skip to content

fix(copilot): show helpful error message for third-party cookie blocking#2933

Open
AliSharjeell wants to merge 2 commits into
Chainlit:mainfrom
AliSharjeell:fix/copilot-cookie-error-message
Open

fix(copilot): show helpful error message for third-party cookie blocking#2933
AliSharjeell wants to merge 2 commits into
Chainlit:mainfrom
AliSharjeell:fix/copilot-cookie-error-message

Conversation

@AliSharjeell
Copy link
Copy Markdown

@AliSharjeell AliSharjeell commented May 23, 2026

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() and formatAuthError() helper functions in libs/copilot/src/app.tsx:

  1. isCookieBlockedError() - Detects errors containing cookie-related keywords
  2. formatAuthError() - Converts generic errors to helpful messages for users

When the error contains "set-cookie", "cookie", "blocked", "third-party", etc., the error message becomes:

"Authentication failed due to third-party cookies being blocked. Please allow third-party cookies in your browser settings to use the Copilot."

Related Issue

Closes #2013Third-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

    • Adds 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

AliSharjeell and others added 2 commits May 23, 2026 11:02
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
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. auth Pertaining to authentication. bug Something isn't working frontend Pertains to the frontend. labels May 23, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Re-trigger cubic

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

Labels

auth Pertaining to authentication. bug Something isn't working frontend Pertains to the frontend. size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Third-Party Cookies Blocked in Safari, Preventing Copilot Usage

1 participant