fix: three functional regressions (SSR crash, /review 404, capture)#11
Merged
Conversation
If /api/chat/summarise returns an error, the capture flow falls back to an empty summary and proceeds to create the GitHub branch + PR. Previously a summarise failure would surface as "Something went wrong" and leave the user with nothing created. Adds a test proving capture navigates to /chat/:id even when summarise returns 500. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…list Three related changes that together fix the broken in-flight PR links: 1. IndexCache.findByBranch — new method to look up a cache entry by branch name, enabling cross-referencing with GitHub's open PR list. 2. GET /api/content/inflight — now calls findByBranch for each PR and includes the cache entry's id when a match exists. Entries created via /api/capture will always match; direct-push PRs will not. 3. /review route — new SvelteKit page that lists open PRs from the inflight endpoint. When an id is present, renders an "Open chat →" link to /chat/:id. Previously the header badge linked to /review which returned a 404. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two changes that together stop the app from crashing on every
server-side render before the user has a session cookie:
1. api.ts req() — guard window.location.href behind
typeof window !== 'undefined'. The 401 handler was crashing the
Node SSR process because window does not exist server-side.
2. +layout.ts load — wrap api.me() in .catch(() => null). The SSR
request to /auth/me carries no session cookie, so it always returns
401. Without the catch, SvelteKit's SSR threw on every cold load;
the layout now renders the sign-in screen instead.
Adds a layout test that asserts a 401 from /auth/me resolves to
{ user: null } rather than throwing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a pull_request trigger so the quality gate (Biome, tsc, svelte-check, tests, build, audit) runs on every PR, not only after merging to main. Docker image builds are gated with `if: github.event_name == 'push'` so they continue to run only on main — GHCR push credentials are not needed on branch runs. Without this, CI could not be read before merge, making it impossible to satisfy the node-establish-gates CI Completion Requirement on a protected branch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
+layout.tsload now catches errors fromapi.me()so a cookie-less SSR request returns{ user: null }instead of crashing.api.tsguardswindow.location.hrefbehindtypeof window !== 'undefined'./reviewpage that lists open PRs.IndexCachegainsfindByBranch; the inflight endpoint cross-references the cache and includesidwhen matched, enabling "Open chat →" links.api.summarise()is now non-fatal via.catch(() => ({ summary: '' })). A LLM failure no longer blocks the GitHub branch + PR creation.Test plan
npm run check— all 7 gates green (Biome, tsc×2, svelte-check, tests×2, build)layout.test.ts— 401 from/auth/meresolves tonullusercapture page— summarise 500 → capture still navigates to/chat/:idreview/page.test.ts— empty state, items without id, items with id (Open chat link)content.test.ts— inflight includesidwhen branch matches cacheindex-cache.test.ts—findByBranchreturns correct entryRoutes/Review— three stories (Empty, Items without chat link, Items with chat links)🤖 Generated with Claude Code