Free-tier LLM dev-mode fixes + re-enable e2e product-flow specs#4
Merged
Conversation
- freeTierGuard: skip allowlist check when no documents are attached — document-free calls (e.g. column prompt generation) carry no customer-data risk so blocking them on a missing allowlist was wrong - tabular route: surface the real exception message in the 502 response instead of swallowing it in a bare catch, making LLM failures debuggable - documents/projects upload routes: expand AggregateError to show all sub-errors and log the full exception server-side Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The early return for no-document calls must come after the allowlist presence check, not before. Missing FREE_TIER_FIXTURE_ALLOWLIST should still throw even when no documents are attached (config validation), but once the allowlist is confirmed present, doc-free calls can pass through. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The four product-flow Playwright specs were wrapped in test.describe.skip()
because their selectors had drifted from the current UI. This commit adds
data-testid attributes to the load-bearing controls in each flow and rewrites
the specs against the current architecture.
Frontend changes are testid-only (no behavior changes) on:
- ProjectsOverview, RowActions, NewProjectModal — projects table
- ProjectPage, AddDocumentsModal — document upload and row actions
- ChatInput, AssistantMessage, ProjectAssistantTab — chat flow
- AddNewTRModal, AddColumnModal, TabularReviewView, TRTable, TabularCell,
ProjectReviewsTab — tabular review flow
Spec rewrites:
- projects: rename now uses the row's kebab menu (clicking the row navigates
into the project); create waits for /projects/{id} redirect.
- documents: upload now goes through AddDocumentsModal (file input is hidden
inside the modal, only mounted when open).
- chat: navigates through the project's assistant tab and clicks the
empty-state to create a chat, which redirects to the chat detail page
where ChatInput lives. Citation chips render as numeric buttons (not [1]).
- tabular: when invoked in project mode, AddNewTRModal auto-selects ready
docs; uses the toolbar Add Columns button since the empty-state only
shows with zero docs.
Setup gaps surfaced during this work, documented in e2e/README.md:
- Test Supabase project needs backend/schema.sql applied.
- backend/.env.test needs real R2 credentials (R2_ENDPOINT_URL,
R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY, R2_BUCKET_NAME) — README
previously only documented Supabase + Gemini.
Full suite: 13/13 green locally in ~1.4 min.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The e2e job built backend/.env.test from secrets but didn't include any R2 vars, so document uploads in the documents/chat/tabular specs hit "Resolved credential object is not valid" inside the AWS SDK. Add four new required secrets and wire them through the heredoc. Local runs were green because the developer's hand-maintained backend/.env.test already had them. Co-Authored-By: Claude Opus 4.7 <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
npm run dev(previously the guard rejected beforeassertFreeTierAllowedcould even check the allowlist) and surface clearer errors when it refuses.projects,documents,chat,tabular) that had been wrapped intest.describe.skip()because selectors drifted from the current UI.The e2e work is testid-only on the frontend (no behavior changes) — each load-bearing control in the four flows got a
data-testid, and the specs were rewritten against the current architecture. Full suite is 13/13 green locally in ~1.4 min.What changed in the e2e re-enablement
/projects/{id}redirect before asserting.AddDocumentsModal(file input is hidden inside the modal, only mounted when open); spec opens the modal, sets files, waits for Confirm to re-enable, clicks Confirm.ChatInputactually lives. Citation chips render as numeric<button>s (not literal[1]), so acitation-markertestid replaces the old regex.AddNewTRModalauto-selects ready docs; uses the toolbar "Add Columns" button since the empty-state only renders with zero docs.Setup gaps surfaced during this work
Documented in
e2e/README.md:backend/schema.sqlapplied (existing step, but its absence was the first wall I hit).backend/.env.testneeds real Cloudflare R2 credentials (R2_ENDPOINT_URL,R2_ACCESS_KEY_ID,R2_SECRET_ACCESS_KEY,R2_BUCKET_NAME) — the README previously only documented Supabase + Gemini. Free-tier R2 is sufficient for e2e usage..env.testmay expire — rotate via https://aistudio.google.com/app/apikey when chat/tabular start failing withAPI_KEY_INVALID.TECHDEBT.mdis updated: the high-priority "Re-enable skipped Playwright specs" item is fully closed, with each spec moved to the Done section.Test plan
npm run test:e2e— 13/13 green locallydata-testidoraria-label)🤖 Generated with Claude Code