Add self-improving retries for effect generation with versioned prompt templates#359
Open
Add self-improving retries for effect generation with versioned prompt templates#359
Conversation
|
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.
Motivation
Description
effects:generate:prompt-templateand a failure log streameffects:generate:failure-logs, with sanitization and seeding logic (new types and helpers inapi/effects.ts).POST /api/effects?action=generate) to run a bounded self-improvement loop (configurable constantMAX_SELF_IMPROVEMENT_ATTEMPTS = 5) that: logs failures, requests a prompt-template tweak from the model, appends the new template as a version, and retries generation; includes a leak-guard to prevent copying user idea text into templates.effects:generate:failure-logsand surface self-improvement metadata in API JSON responses underselfImprovement.requestResponsesApi/requestPromptTemplateImprovementhelpers to centralize calls to the Responses API and to request prompt-template improvements.src/effectIdeas.ts) and UI (src/main.ts) to propagate and displayselfImprovementmetadata, remove the manual retry dependence, show clearer busy/error copy, and display attempt counters in the busy/error modal; removed retry-button click wiring.api/effects.test.ts,src/effectIdeas.test.ts), and updatedREADME.mdto document the prompt-template KV key and failure-log stream.Testing
npm test -- api/effects.test.ts src/effectIdeas.test.ts src/style.test.tsand all tests passed (42 tests, all green).effects:generate:prompt-template), failure logs are appended (effects:generate:failure-logs), and the client surfaces attempt info; these tests passed as part of the run.Codex Task