Skip to content

Show the real reason when a generation is refused in production - #5

Merged
biluses merged 1 commit into
masterfrom
claude/clone-build-autonomous-repo-lou6ef
Sep 19, 2026
Merged

biluses merged 1 commit into
masterfrom
claude/clone-build-autonomous-repo-lou6ef

Conversation

@biluses

@biluses biluses commented Sep 19, 2026

Copy link
Copy Markdown
Owner

Why

The first real generation on production failed with 403 not_enough_credits from the platform, but the studio showed "Minified React error #441". Next.js replaces the message of an error thrown from a server action with a generic one in production, so nothing the server threw for the person ever reached them.

What

  • submitGeneration, savePlatformCredentials and clearPlatformCredentials now return a Failure { error, kind } instead of throwing (src/generation/outcome.ts).
  • failureOf sorts the thrown reason: session, missing key, workspace credits, platform out of credits (403 mentioning credits), other platform refusals, input guards, unknown.
  • The studio hook, the key modal and the settings panel read the failure and show the message; a platform account without credits gets its own line pointing at Higgsfield or BYOK.
  • Dropped the InsufficientCreditsError re-export from the "use server" file and the unused CreditsNeededError.

Checks

  • pnpm typecheck, pnpm lint, pnpm test (38) green.
  • pnpm test:e2e (5) green against a fresh standalone build and the mock platform.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QktEqYfYA1H2gQRbvG88pU


Generated by Claude Code

Next.js replaces the message of an error thrown from a server action with
a generic one in production, so a refused generation surfaced to the person
as "Minified React error #441" instead of the platform's answer. submit,
save-key and clear-key now return a Failure {error, kind}; the studio and
settings panels turn it into the message they already knew how to show,
with a dedicated line for a platform account that ran out of credits.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QktEqYfYA1H2gQRbvG88pU
@vercel

vercel Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
vitrina Ready Ready Preview Sep 19, 2026 4:18am UTC

@biluses
biluses merged commit e999c7e into master Sep 19, 2026
3 of 4 checks passed

This branch was successfully deployed

1 active deployment
Preview — 6c2662a3 Deployed Sep 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants