refactor: rename gepa into prompt optimization#1034
Conversation
|
No actionable comments were generated in the recent review. 🎉 WalkthroughThis PR renames and remaps the GEPA job surface to a Prompt Optimization job surface across backend, frontend, API clients, datamodels, and tests — updating imports, route paths, types, models, and function names accordingly. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @leonardmq, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request implements a significant refactoring to standardize terminology by renaming all instances of 'GEPA' to 'Prompt Optimization'. This change enhances the understandability of the system by replacing an internal acronym with a more explicit and user-friendly term. The refactor touches various layers of the application, from backend API definitions and datamodels to frontend UI components and navigation, ensuring a cohesive and consistent experience for developers and users alike. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
📊 Coverage ReportOverall Coverage: 91% Diff: origin/sfierro/optimize-feature...HEAD
Summary
Line-by-lineView line-by-line diff coverageapp/desktop/studio_server/prompt_optimization_job_api.pyLines 221-229 221 or not parent_project.id
222 or not task.id
223 or not prompt_optimization_job.id
224 ):
! 225 raise ValueError("Cannot reload Prompt Optimization job: missing required IDs")
226
227 # reload the job in case artifacts were created by another request while waiting for the lock
228 reloaded_job = prompt_optimization_job_from_id(
229 parent_project.id,Lines 232-244 232 )
233
234 # check if artifacts already exist
235 if reloaded_job.created_prompt_id:
! 236 prompt_optimization_job.created_prompt_id = reloaded_job.created_prompt_id
! 237 prompt_optimization_job.created_run_config_id = (
238 reloaded_job.created_run_config_id
239 )
! 240 prompt_optimization_job.optimized_prompt = reloaded_job.optimized_prompt
241 return
242
243 result_response = await get_prompt_optimization_job_result_v1_jobs_prompt_optimization_job_job_id_result_get.asyncio(
244 job_id=prompt_optimization_job.job_id,Lines 638-646 638 ],
639 return_exceptions=True,
640 )
641 except Exception as e:
! 642 logger.error(
643 f"Error updating Prompt Optimization job statuses: {e}",
644 exc_info=True,
645 )Lines 674-682 674 prompt_optimization_job, server_client
675 )
676 )
677 except Exception as e:
! 678 logger.error(
679 f"Error updating Prompt Optimization job status: {e}", exc_info=True
680 )
681
682 return prompt_optimization_jobLines 713-721 713
714 except HTTPException:
715 raise
716 except Exception as e:
! 717 logger.error(
718 f"Error getting prompt optimization job status: {e}", exc_info=True
719 )
720 raise HTTPException(
721 status_code=500,libs/core/kiln_ai/datamodel/task.pyLines 188-196 188
189 def prompt_optimization_jobs(
190 self, readonly: bool = False
191 ) -> list[PromptOptimizationJob]:
! 192 return super().prompt_optimization_jobs(readonly=readonly) # type: ignore
193
194 # Workaround to return typed parent without importing Task
195 def parent_project(self) -> Union["Project", None]:
196 if self.parent is None or self.parent.__class__.__name__ != "Project":
|
There was a problem hiding this comment.
Code Review
This pull request is a large refactoring to rename the GEPA feature to Prompt Optimization. The changes are extensive, touching many files across the backend, API client, and frontend. Overall, the renaming seems consistent. However, I've found a critical issue where an old job type enum is still being used, which will likely cause status updates for prompt optimization jobs to fail. I've also noted a change in error handling that seems to be a regression. Please see my detailed comments.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/desktop/studio_server/prompt_optimization_job_api.py (1)
625-639: Comment about exception swallowing is slightly misleading.The comment at line 631 says "this swallows the exceptions from each call", but
asyncio.gatherwithoutreturn_exceptions=Truedoes not swallow exceptions — it propagates the first one. Exceptions are actually swallowed insideupdate_prompt_optimization_job_and_create_artifactsitself (lines 330-333). The comment should either be moved/reworded, orreturn_exceptions=Trueshould be added to match the stated intent.Note that
update_prompt_optimization_job_and_create_artifactscan raiseHTTPExceptionfrom lines 293-295 (before the try block), which would propagate throughgatherand cancel sibling tasks. This is a pre-existing concern, not introduced by this PR.
What does this PR do?
Rename
GEPAintoPrompt Optimizationwhere possible.Checklists
Summary by CodeRabbit