Fix web test failures from SSR theme import and Claude auth diagnostics#456
Merged
Fix web test failures from SSR theme import and Claude auth diagnostics#456
Conversation
Agent-Logs-Url: https://github.com/OpenKnots/okcode/sessions/cdf0b3b9-acf6-479d-aeef-64537e9fb78f Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com>
Agent-Logs-Url: https://github.com/OpenKnots/okcode/sessions/cdf0b3b9-acf6-479d-aeef-64537e9fb78f Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
BunsDev
April 14, 2026 11:43
View session
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
What Changed
@okcode/web#testwas failing for two independent reasons:useThemetouchedlocalStorageduring module import in non-browser test/SSR paths, and Claude authentication errors were not recognized bythreadError, so the expected troubleshooting copy was never added.SSR-safe theme initialization
apps/web/src/hooks/useTheme.ts.localStoragereads/writes behind safe accessors.initCustomTheme(), initialapplyTheme(...)) when no DOM is available.Claude auth error detection
AUTH_FAILURE_PATTERNSinapps/web/src/components/chat/threadError.tsto match the Claude failure wording used in the failing tests.Why
The failing import path was executing browser-only theme code in a server/test environment, which caused
ReferenceError: localStorage is not definedbefore the test could render. Separately, the auth matcher only recognizedrun claude auth loginphrasing, but the actual error saidauthenticated with claude auth login, so auth failures were misclassified and the expected diagnostic tip was omitted.UI Changes
None.
Checklist