gepa: copilot gate and warning fix#1013
Conversation
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 significantly improves the user experience around Kiln Copilot integration, particularly for prompt optimization and spec creation. It introduces a proactive check for Copilot connectivity, guiding users to establish the connection before they can access Copilot-dependent features. By centralizing the authentication flow into a reusable component, it ensures consistency and simplifies future maintenance. Additionally, it refines error reporting, offering clearer, context-specific messages to users when issues arise during prechecks. 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
|
WalkthroughAdds Kiln Copilot UI and utilities: new CopilotAuthPage and CopilotRequiredCard components, a shared Changes
Sequence DiagramsequenceDiagram
participant Page as GEPA Create Page
participant CopilotUtil as Copilot Utility
participant API as API Server
participant Card as CopilotRequiredCard
participant TaskLoader as Task Loader
Page->>CopilotUtil: checkKilnCopilotAvailable()
activate CopilotUtil
CopilotUtil->>API: GET /api/settings
activate API
API-->>CopilotUtil: { kiln_copilot_api_key: ? }
deactivate API
CopilotUtil-->>Page: boolean result
deactivate CopilotUtil
alt Copilot Available
Page->>TaskLoader: load task, prompts, run configs, evals
TaskLoader-->>Page: data loaded
Page->>Page: render task UI
else Copilot Unavailable or Error
Page->>Card: render CopilotRequiredCard (auth_url, description, error?)
Card-->>Page: user clicks connect -> goto auth_url
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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 |
📊 Coverage ReportOverall Coverage: 91% Diff: origin/sfierro/optimizers-gepa...HEADNo lines with coverage information in this diff.
|
There was a problem hiding this comment.
Code Review
This pull request introduces several improvements for the GEPA optimizer, primarily by adding a gate to ensure Kiln Copilot is connected before allowing users to create an optimized prompt. The changes include refactoring the Copilot authentication flow into a reusable component and moving utility functions to a shared location, which improves code structure and reusability.
I've identified a critical issue where a duplicate onMount hook could bypass the new Copilot connection check. Additionally, there are a few issues with URL construction for navigation that could lead to broken links or a poor user experience. I've provided suggestions to fix these. Overall, the changes are well-structured and address the intended goals.
app/web_ui/src/routes/(app)/gepa/[project_id]/[task_id]/create_gepa/+page.svelte
Show resolved
Hide resolved
app/web_ui/src/routes/(app)/gepa/[project_id]/[task_id]/create_gepa/+page.svelte
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@app/web_ui/src/routes/`(app)/gepa/[project_id]/[task_id]/create_gepa/+page.svelte:
- Around line 216-234: There are two onMount callbacks causing duplicate loads
and bypassing the Copilot gate; remove the redundant second onMount (the one
that unconditionally calls load_task, load_task_prompts, load_task_run_configs,
load_evals_and_configs) so that only the guarded onMount remains, or merge its
logic into the first onMount while preserving the kiln_copilot_connected check
and the copilot error handling in createKilnError; locate the duplicate by the
onMount identifier and the functions load_task, load_task_prompts,
load_task_run_configs, and load_evals_and_configs to ensure you delete/merge the
correct block.
🧹 Nitpick comments (1)
app/web_ui/src/lib/ui/kiln_copilot/copilot_auth_page.svelte (1)
4-4: Inverted dependency:$libcomponent imports fromroutes/.
copilot_auth_page.sveltelives in$lib/ui/but importsAppPagefrom the routes directory. This inverts the conventional dependency direction (routes/ → $lib/, not the reverse) and could complicate future refactors ifAppPagemoves. Consider either movingAppPageinto$libor keepingCopilotAuthPagein the routes layer.
What does this PR do?
PR going into: #1012
GEPA-related UI tweaks:
User gets this if they do not have Copilot when clicking Create Optimized Prompt:

Arbitrary errors show this warning - the Copilot API key missing should no longer show up since we now have the gate upstream:

Checklists
Summary by CodeRabbit