Skip to content

Comments

Fix for dir resolutions#879

Merged
willccbb merged 4 commits intomainfrom
prime-plugin
Feb 9, 2026
Merged

Fix for dir resolutions#879
willccbb merged 4 commits intomainfrom
prime-plugin

Conversation

@willccbb
Copy link
Member

@willccbb willccbb commented Feb 9, 2026

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Test improvement

Testing

  • All existing tests pass when running uv run pytest locally.
  • New tests have been added to cover the changes

Checklist

  • My code follows the style guidelines of this project as outlined in AGENTS.md
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Additional Notes


Note

Medium Risk
Changes command construction and python interpreter selection based on workspace discovery; may affect how prime-cli runs modules in different directory layouts and virtualenv setups.

Overview
Improves workspace detection for the Prime CLI plugin by introducing _find_workspace_root() (requires pyproject.toml, verifiers/, and environments/) and preferring the workspace’s .venv when resolving the Python executable, even when UV_PROJECT_ENVIRONMENT is set.

Updates PrimeCLIPlugin.build_module_command() to normalize/resolve directory arguments and to auto-inject the workspace environments directory for commands that need it (adds --path for install/build/init, and --env-dir-path for eval/gepa), including rewriting relative paths to absolute ones. Adds a new tests/test_prime_plugin.py suite covering workspace root discovery, interpreter preference, and argument normalization/injection.

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

Replace hardcoded index access on marker_paths list with direct
by-name checks for each workspace root marker. This removes the
WORKSPACE_ROOT_MARKERS tuple (only used in _find_workspace_root)
and checks pyproject.toml, verifiers/, and environments/ directly
with their correct is_file()/is_dir() predicates.

The previous approach was tightly coupled to tuple ordering -
reordering or modifying WORKSPACE_ROOT_MARKERS would silently
break the file-vs-directory type checks.

Co-authored-by: will brown <willccbb@users.noreply.github.com>
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ willccbb
❌ cursoragent
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

cursoragent and others added 2 commits February 9, 2026 04:34
…ule_command

The build_module_command method was only normalizing path arguments for
install_module and eval_module. This caused relative paths like
./environments to not be resolved correctly for gepa, build, and init
commands when invoked through the prime CLI.

- gepa_module uses --env-dir-path/-p (same pattern as eval_module)
- build_module uses --path/-p (same pattern as install_module)
- init_module uses --path/-p (same pattern as install_module)

Added tests for all three newly covered modules.

Co-authored-by: will brown <willccbb@users.noreply.github.com>
Co-authored-by: will brown <willccbb@users.noreply.github.com>
@willccbb willccbb merged commit 4cf38a4 into main Feb 9, 2026
6 checks passed
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.

3 participants