Skip to content

refactor: remove token budget from app#1032

Merged
leonardmq merged 2 commits into
leonard/kil-403-gepa-exclude-docs-from-zipfrom
leonard/kil-402-gepa-remove-light-medium-high
Feb 14, 2026
Merged

refactor: remove token budget from app#1032
leonardmq merged 2 commits into
leonard/kil-403-gepa-exclude-docs-from-zipfrom
leonard/kil-402-gepa-remove-light-medium-high

Conversation

@leonardmq

@leonardmq leonardmq commented Feb 14, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

PR going into #1031

App does no longer expose token budget - now remote controlled to be able to adjust without needing an app release.

Need a server deploy - corresponding service PR must go first.

Checklists

  • Tests have been run locally and passed
  • New tests have been added to any work in /lib

Summary by CodeRabbit

  • Refactor
    • Removed the token_budget field from GEPA job model, API request/response shapes, and job creation flows.
  • Tests
    • Updated tests to no longer supply or assert token_budget for GEPA jobs.
  • Web UI
    • Creation UI no longer includes token_budget in the job submission payload.

@leonardmq leonardmq requested a review from sfierro February 14, 2026 08:49
@coderabbitai

coderabbitai Bot commented Feb 14, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

This PR removes the token_budget field and its enum from GEPA job handling across API client models, backend request/response types, core datamodels, frontend types and UI, and related tests.

Changes

Cohort / File(s) Summary
API client exports
app/desktop/studio_server/api_client/kiln_ai_server_client/models/__init__.py
Removed export and __all__ entry for BodyStartGepaJobV1JobsGepaJobStartPostTokenBudget.
API client models
app/desktop/studio_server/api_client/kiln_ai_server_client/models/body_start_gepa_job_v1_jobs_gepa_job_start_post.py, app/desktop/studio_server/api_client/kiln_ai_server_client/models/body_start_gepa_job_v1_jobs_gepa_job_start_post_token_budget.py
Deleted token_budget field from BodyStartGepaJobV1JobsGepaJobStartPost model and removed the BodyStartGepaJobV1JobsGepaJobStartPostTokenBudget enum (HEAVY, MEDIUM, LIGHT).
Backend API & tests
app/desktop/studio_server/gepa_job_api.py, app/desktop/studio_server/test_gepa_job_api.py
Removed token_budget from StartGepaJobRequest, from request construction, GepaJob creation paths, and from test payloads/assertions.
Frontend types
app/web_ui/src/lib/api_schema.d.ts
Removed token_budget property from StartGepaJobRequest and GepaJob TypeScript interfaces.
Frontend UI
app/web_ui/src/routes/(app)/gepa/[project_id]/[task_id]/create_gepa/+page.svelte
Removed local token_budget variable and omitted token_budget from the POST payload when creating GEPA jobs.
Core datamodel & tests
libs/core/kiln_ai/datamodel/gepa_job.py, libs/core/kiln_ai/datamodel/test_gepa_job.py, libs/core/kiln_ai/datamodel/test_task.py
Removed token_budget field from GepaJob dataclass/constructor and removed related assertions and constructor arguments in tests.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I nudged a tiny field away,

token_budget hopped off today.
Models, UI, tests unbind—
A lighter stack for coders to find. 🥕

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'refactor: remove token budget from app' is clear, concise, and directly describes the main change—removing the token_budget feature across the entire application.
Description check ✅ Passed The description includes the required 'What does this PR do?' section explaining the goal, notes dependencies, and includes completed checklists for testing—meeting template requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into leonard/kil-403-gepa-exclude-docs-from-zip

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch leonard/kil-402-gepa-remove-light-medium-high

No actionable comments were generated in the recent review. 🎉


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @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 refactors the application by eliminating the client-side management of the token_budget for GEPA jobs. The primary motivation is to centralize control over this setting, enabling dynamic adjustments on the server without necessitating new application deployments. This change streamlines the application's interface by removing an unnecessary configuration point from the user-facing client and internal API definitions.

Highlights

  • Token Budget Removal: The token_budget field has been entirely removed from the application's API client models, request bodies, and data models. This includes its definition, usage in API calls, and storage in the local data model.
  • Remote Control of Token Budget: The application no longer exposes the token budget setting, shifting its control to a remote mechanism. This allows for adjustments without requiring an application release.
  • API Schema Updates: The API client's generated models and the web UI's API schema definitions have been updated to reflect the removal of the token_budget field from GEPA job requests and responses.
  • Test Case Refactoring: All relevant test cases across the API, data models, and UI have been updated to remove references to the token_budget, ensuring tests align with the new application behavior.

🧠 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
  • app/desktop/studio_server/api_client/kiln_ai_server_client/models/init.py
    • Removed import statement for BodyStartGepaJobV1JobsGepaJobStartPostTokenBudget.
    • Removed BodyStartGepaJobV1JobsGepaJobStartPostTokenBudget from the __all__ export list.
  • app/desktop/studio_server/api_client/kiln_ai_server_client/models/body_start_gepa_job_v1_jobs_gepa_job_start_post.py
    • Removed import for BodyStartGepaJobV1JobsGepaJobStartPostTokenBudget.
    • Removed token_budget attribute from BodyStartGepaJobV1JobsGepaJobStartPost class definition.
    • Removed token_budget from the to_dict method's field dictionary construction.
    • Removed token_budget from the to_multipart method's file list.
    • Removed token_budget parsing from the from_dict class method.
  • app/desktop/studio_server/api_client/kiln_ai_server_client/models/body_start_gepa_job_v1_jobs_gepa_job_start_post_token_budget.py
    • Removed the entire file, which defined the BodyStartGepaJobV1JobsGepaJobStartPostTokenBudget enum.
  • app/desktop/studio_server/gepa_job_api.py
    • Removed import of Literal from typing.
    • Removed import of BodyStartGepaJobV1JobsGepaJobStartPostTokenBudget.
    • Removed token_budget attribute from StartGepaJobRequest BaseModel.
    • Removed token_budget parameter from the BodyStartGepaJobV1JobsGepaJobStartPost constructor in start_gepa_job.
    • Removed token_budget assignment when creating a new GepaJob instance.
  • app/desktop/studio_server/test_gepa_job_api.py
    • Removed token_budget from the JSON payload in test_start_gepa_job_creates_datamodel.
    • Removed assertion for token_budget in test_start_gepa_job_creates_datamodel.
    • Removed token_budget from the JSON payload in test_start_gepa_job_calls_package_with_correct_params.
    • Removed token_budget from GepaJob instantiation in test_list_gepa_jobs.
    • Removed token_budget from GepaJob instantiation in test_get_gepa_job_detail.
    • Removed token_budget from GepaJob instantiation in test_gepa_job_creates_prompt_on_success.
    • Removed token_budget from GepaJob instantiation in test_gepa_job_only_creates_prompt_once.
    • Removed token_budget from GepaJob instantiation in test_get_gepa_job_skips_update_when_succeeded.
    • Removed token_budget from GepaJob instantiation in test_get_gepa_job_skips_update_when_failed.
    • Removed token_budget from GepaJob instantiation in test_get_gepa_job_skips_update_when_cancelled.
    • Removed token_budget from GepaJob instantiation in test_list_gepa_jobs_updates_statuses_in_parallel_batches.
    • Removed token_budget from GepaJob instantiation in test_list_gepa_jobs_skips_final_status_updates.
    • Removed token_budget from GepaJob instantiation in test_update_gepa_job_status_no_parent_task.
    • Removed token_budget from GepaJob instantiation in test_update_gepa_job_status_response_none.
    • Removed token_budget from GepaJob instantiation in test_update_gepa_job_status_response_validation_error.
    • Removed token_budget from GepaJob instantiation in test_update_gepa_job_status_exception_during_update.
    • Removed token_budget from GepaJob instantiation in test_list_gepa_jobs_exception_during_update.
    • Removed token_budget from the JSON payload in test_start_gepa_job_no_parent_project.
    • Removed token_budget from the JSON payload in test_start_gepa_job_with_tools_in_run_config.
    • Removed token_budget from the JSON payload in test_start_gepa_job_server_not_authenticated.
    • Removed token_budget from the JSON payload in test_start_gepa_job_server_validation_error.
    • Removed token_budget from the JSON payload in test_start_gepa_job_server_none_response.
    • Removed token_budget from the JSON payload in test_start_gepa_job_read_error.
    • Removed token_budget from the JSON payload in test_start_gepa_job_timeout_error.
    • Removed token_budget from the JSON payload in test_start_gepa_job_general_exception.
    • Removed token_budget from GepaJob instantiation in test_gepa_job_creates_run_config_on_success.
    • Removed token_budget from GepaJob instantiation in test_gepa_job_only_creates_run_config_once.
    • Removed token_budget from GepaJob instantiation in test_gepa_job_run_config_handles_missing_target_config.
    • Removed token_budget from GepaJob instantiation in test_gepa_job_cleanup_prompt_when_prompt_creation_fails.
    • Removed token_budget from GepaJob instantiation in test_gepa_job_cleanup_both_artifacts_when_run_config_fails_after_prompt_creation.
    • Removed token_budget from GepaJob instantiation in test_gepa_job_retry_after_cleanup.
    • Removed token_budget from GepaJob instantiation in test_gepa_job_prevents_race_condition_on_artifact_creation.
    • Removed token_budget from GepaJob instantiation in test_update_gepa_job_status_transitions.
    • Removed token_budget from GepaJob instantiation in test_update_gepa_job_running_to_succeeded_creates_artifacts.
    • Removed token_budget from GepaJob instantiation in test_update_gepa_job_succeeded_to_succeeded_no_artifacts.
    • Removed token_budget from GepaJob instantiation in test_update_gepa_job_pending_to_running_no_artifacts.
  • app/web_ui/src/lib/api_schema.d.ts
    • Removed token_budget property from the GepaJob interface definition.
    • Removed token_budget property from the StartGepaJobRequest interface definition.
  • app/web_ui/src/routes/(app)/gepa/[project_id]/[task_id]/create_gepa/+page.svelte
    • Removed the token_budget variable declaration.
    • Removed token_budget from the request body when calling the start API endpoint.
  • libs/core/kiln_ai/datamodel/gepa_job.py
    • Removed the token_budget field from the GepaJob Pydantic model.
  • libs/core/kiln_ai/datamodel/test_gepa_job.py
    • Removed token_budget from GepaJob instantiation in test_gepa_job_creation.
    • Removed assertion for token_budget in test_gepa_job_creation.
    • Removed token_budget from GepaJob instantiation in test_gepa_job_parent_task.
    • Removed token_budget from GepaJob instantiation in test_gepa_job_parent_task_none.
    • Removed token_budget from GepaJob instantiation in test_gepa_job_with_result.
    • Removed token_budget from GepaJob instantiation in test_gepa_job_with_eval_ids.
    • Removed token_budget from GepaJob instantiation in test_gepa_job_save_and_load.
    • Removed assertion for token_budget in test_gepa_job_save_and_load.
  • libs/core/kiln_ai/datamodel/test_task.py
    • Removed token_budget from GepaJob instantiation in test_task_gepa_jobs_relationship.
    • Removed assertion for token_budget in test_task_gepa_jobs_relationship.
    • Removed token_budget from GepaJob instantiation in test_task_gepa_jobs_readonly.
Activity
  • The pull request was created by leonardmq to remove the token budget from the application, making it remotely controlled.
  • All necessary code changes, including API client updates, data model modifications, and UI adjustments, have been implemented.
  • Comprehensive test updates have been performed to reflect the removal of the token budget field across various scenarios.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@leonardmq

Copy link
Copy Markdown
Collaborator Author

/gemini review

@leonardmq

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Feb 14, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the application to remove the token_budget parameter from the GEPA job creation process. The change is motivated by the desire to control this parameter remotely without requiring an app release. The refactoring is comprehensive, touching on API client models, backend API logic, frontend components, data models, and extensive test suites. The removal of token_budget is consistently applied across all affected files. The code changes are clean and the updated tests ensure that the removal did not introduce any regressions. Overall, this is a well-executed refactoring that achieves its goal effectively.

@github-actions

github-actions Bot commented Feb 14, 2026

Copy link
Copy Markdown

📊 Coverage Report

Overall Coverage: 91%

Diff: origin/leonard/kil-403-gepa-exclude-docs-from-zip...HEAD

No lines with coverage information in this diff.


@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively removes the token_budget parameter from the application, making it remotely controlled by the server. This change simplifies the client and allows for easier adjustments. The refactoring is comprehensive, with consistent updates across the API client, backend, data models, UI, and tests. All changes are correct and the test suite has been properly updated to reflect the removal. I found no issues with this implementation; it's a clean and well-executed refactoring.

…om:Kiln-AI/Kiln into leonard/kil-402-gepa-remove-light-medium-high
@leonardmq leonardmq merged commit c04ad39 into leonard/kil-403-gepa-exclude-docs-from-zip Feb 14, 2026
10 checks passed
@leonardmq leonardmq deleted the leonard/kil-402-gepa-remove-light-medium-high branch February 14, 2026 10:48
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