Repository navigation
Ads: instant page-text draft, then AI copy; never dead-end the form - #427
Merged
Merged
Conversation
… form c0mpute's 9B model answered ad copy in the shape of the JSON Schema, so all fields read undefined and, with both paid keys out of credit, the form failed. ai-providers 0.1.1 unwraps that. On top of it: - readC0mputeCopy keeps near misses: long copy is shortened, missing colours and summaries are filled, only headline and body are required. - /dashboard/ads/new draws a page-text draft in seconds and swaps in the model's copy when it arrives, without overwriting edits. The slow call is an /api route because server actions run one at a time and would hold up Save. - If every provider fails (order unchanged: c0mpute, then OpenAI/Anthropic) the draft stays. Regenerate and A/B arms still fail rather than get page copy. - A format with no words is left out instead of shipped blank. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
ThreatCrush Security Scan50 finding(s) HIGH/CRITICAL: 2 | MEDIUM: 30 | LOW: 18
Snippets are redacted; ThreatCrush never prints matched credential material. |
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.
Fixes
Backend AI generation failed (c0mpute: does not match the schema: headline ... undefinedon /dashboard/ads/new, and the multi-minute wait.Cause: the 9B model nested correct copy under
propertiesnext to$schema/type/required. Fixed in ai-providers 0.1.1 (bumped here). Both paid keys are out of credit, so nothing caught it.Here:
readC0mputeCopy: shortens long copy, fills missing colours and summaries, requires only headline and body.bodyran 160 to 180 chars against a 130 cap on live runs.POST /api/ads/preview, not a server action, because actions run one at a time and would hold up Save and uploads.🤖 Generated with Claude Code