Skip to content

Conversation

@dphuang2
Copy link
Collaborator

@dphuang2 dphuang2 commented Jan 8, 2026

Note

Implements versioned evaluator workflow and streamlines platform integration.

  • Switches evaluator upload to version-based APIs: evaluator_versions.create, get_upload_endpoint, validate_upload; create_evaluation now returns (result, version_id)
  • Adds centralized create_fireworks_client() with FIREWORKS_EXTRA_HEADERS support; migrates SDK calls across evaluation, RFT, platform secrets, and dataset upload
  • New ep create evj command to create Evaluation Jobs with auto arg generation and local validation hooks
  • Introduces reusable secrets flow (cli_commands/secrets.py) with selection and double-confirm overrides; integrated into upload, create rft, and create evj
  • Refactors CLI utils: shared evaluator resolution, local pytest validation, upload-and-poll for ACTIVE version
  • Improves SQLite robustness with connect/create-table retry wrappers
  • Updates auth: dotenv discovery/loading helpers and verify base selection
  • Bumps fireworks-ai to 1.0.0a22; adds comprehensive tests for secrets, client factory, evaluator versioning, CLI flows; VS Code launch example added and .gitignore adjusted

Written by Cursor Bugbot for commit 37f4856. This will update automatically on new commits. Configure here.

- Introduced a new `fireworks_client.py` module to centralize Fireworks SDK client creation.
- Updated CLI and evaluation modules to use the new `create_fireworks_client` function instead of direct instantiation of the Fireworks class.
- Enhanced handling of API key, account ID, base URL, and extra headers through environment variables.
- Added tests for the new Fireworks client factory to ensure proper functionality and configuration.
- Added functionality to load environment variables from .env.dev or .env as a fallback when the auth module is imported.
- Updated the API key verification process to allow explicit base URL handling, defaulting to dev.api.fireworks.ai if not provided.
- Removed redundant environment variable loading code from platform_api module.
- Introduced functionality to create evaluator versions using parameters such as commit hash, entry point, and requirements.
- Updated the upload endpoint call to utilize the newly created evaluator version ID instead of a hardcoded test version ID.
- Added error handling for missing evaluator version ID in the response to ensure robustness during code uploads.
update to latest once SDK is published with changes
- Implemented a try-except block to handle APIStatusError during evaluator creation.
- Added logic to check for existing evaluators and retrieve the existing one if a conflict occurs (status code 409).
- Enhanced logging for better traceability of evaluator creation process.
…d signature introspection, avoiding unnecessary API requests during help invocations.
…dating polling functions to target specific evaluator versions. Refactor related CLI commands and tests to accommodate these changes, ensuring clearer status messages and improved error handling.
logger.warning(f"Code upload failed (evaluator created but code not uploaded): {upload_error}")
# Don't fail - evaluator is created, just code upload failed
# Return None for version_id since upload failed
return result, None
Copy link

Choose a reason for hiding this comment

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

Tar file not cleaned up when upload fails

Medium Severity

When the upload process fails after the tar.gz file is created at tar_path, the exception handler returns (result, None) without removing the tar file. The cleanup at lines 347-349 is only reached on the success path. This leaves a {dir_name}.tar.gz file in the user's working directory after every failed upload attempt, which could be large and confusing.

Additional Locations (1)

Fix in Cursor Fix in Web

…iable loading into local test command. Introduced functions to find and retrieve values from .env files, enhancing configuration management for Docker tests.
…iable loading into local test command. Introduced functions to find and retrieve values from .env files, enhancing configuration management for Docker tests.
- improving environment variable management and preventing conflicts with other .env files.
- improving environment variable management and preventing conflicts with other .env files.
- Added `upload_and_ensure_evaluator` function to handle evaluator uploads and ensure the latest version is ACTIVE.
- Updated `create_evj_command` and `create_rft_command` to utilize the new upload function.
- Removed redundant polling logic from `create_rft.py` and `create_evj.py`, centralizing it in the new utility function.
- Adjusted tests to mock the new upload function correctly.
- Implemented functions to check for existing secrets and confirm overrides before uploading to Fireworks.
- Enhanced user interaction with double confirmation for overriding existing secrets, including fallback for non-interactive environments.
- Updated the upload command to handle new and existing secrets separately, ensuring proper management during uploads.
- Added `handle_secrets_upload` function to `create_evj.py`, `create_rft.py`, and `upload.py` for managing secrets with double verification for existing entries.
- Streamlined the upload process by consolidating secret management logic, enhancing user interaction during uploads.
- Removed redundant secret loading functions from `upload.py` to improve code clarity and maintainability.
- Replaced manual parsing of .env files with `dotenv_values()` for improved handling of comments, quotes, and multi-line values.
- Updated `load_secrets_from_env_file` function to return a filtered dictionary of environment variables, enhancing code clarity and maintainability.

rft_parser.add_argument("--yes", "-y", action="store_true", help="Non-interactive mode")
rft_parser.add_argument("--dry-run", action="store_true", help="Print planned SDK call without sending")
rft_parser.add_argument("--force", action="store_true", help="Overwrite existing evaluator with the same ID")
Copy link

Choose a reason for hiding this comment

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

Missing --env-file argument for rft and evj commands

Medium Severity

Both create_rft_command and create_evj_command access env_file via getattr(args, "env_file", None) and pass it to handle_secrets_upload, but neither rft_parser nor evj_parser defines the --env-file CLI argument. Users cannot specify a custom env file path for these commands, and the code always receives None. The upload command correctly defines this argument but it's missing from the create subcommands.

Additional Locations (2)

Fix in Cursor Fix in Web

@dphuang2 dphuang2 closed this Jan 16, 2026
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