Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Dec 9, 2025

Summary

Add the ability to gate model settings behind minimum plugin versions for the Roo provider. Settings from the Roo Code Cloud API can now be either direct values or wrapped with { value: T, minPluginVersion: string } to conditionally apply based on the extension version.

This enables the API to ship new features that only activate on newer plugin versions, providing backward compatibility while allowing gradual feature rollouts.

Changes

  • Add versionedSettings.ts with:
    • isVersionedValue() - Type guard to detect versioned value objects
    • compareSemver() - Compares two semantic version strings
    • meetsMinimumVersion() - Checks if current version meets minimum requirement
    • resolveVersionedSettings() - Resolves versioned settings based on current plugin version
  • Update getRooModels() in roo.ts to resolve versioned settings before applying to model info
  • Add comprehensive test suite with 21 test cases covering all utility functions

Usage Example

Settings from the API can be in either format:

// Direct value (always applied)
settings: {
  supportsReasoningEffort: false,
  includedTools: ['search_replace'],
}

// Versioned value (only applied if plugin version >= minPluginVersion)
settings: {
  supportsReasoningEffort: false,
  includedTools: {
    value: ['search_replace'],
    minPluginVersion: '3.36.4',
  },
  excludedTools: {
    value: ['apply_diff'],
    minPluginVersion: '3.36.4',
  },
}

Important

Adds versioned settings support to Roo provider with minimum plugin version gating, including utility functions and tests.

  • Behavior:
    • Adds versioned settings support in versionedSettings.ts with functions like isVersionedValue(), compareSemver(), meetsMinimumVersion(), and resolveVersionedSettings().
    • Updates getRooModels() in roo.ts to resolve versioned settings before applying to model info.
  • Tests:
    • Adds 21 test cases in versionedSettings.spec.ts to cover utility functions.
    • Adds tests in roo.spec.ts to verify versioned settings application.
  • Misc:
    • Adds semver-compare and @types/semver-compare to package.json dependencies.

This description was created by Ellipsis for 3783869. You can customize this summary. It will automatically update as commits are pushed.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. Enhancement New feature or request labels Dec 9, 2025
@roomote
Copy link
Contributor

roomote bot commented Dec 9, 2025

Oroocle Clock   See task on Roo Cloud

Re-review complete for the latest changes on this pull request. No issues were identified in the new changes, and all related tests are passing.

  • Re-review completed for latest changes
  • No issues found in this pass
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 9, 2025
@mrubens
Copy link
Collaborator

mrubens commented Dec 9, 2025

The old clients are still looking for includedTools: z.array(z.string()).optional(), though. I think we need to use a new key for these versioned settings to avoid breaking old clients.

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Dec 9, 2025
@hannesrudolph
Copy link
Collaborator Author

The old clients are still looking for includedTools: z.array(z.string()).optional(), though. I think we need to use a new key for these versioned settings to avoid breaking old clients.

See if that last commit works.

Add ability to gate model settings behind minimum plugin versions.
Settings from the Roo API can now be either direct values or wrapped
with { value: T, minPluginVersion: string } to conditionally apply
based on the extension version.

- Add versionedSettings.ts with semver comparison utilities
- Add resolveVersionedSettings() to process versioned values
- Update getRooModels() to resolve versioned settings
- Add comprehensive tests for all utility functions
…lity

Address review feedback from @mrubens: Old clients expect plain values
in the settings field (e.g., includedTools as array of strings).

Changes:
- Add new versionedSettings field to RooModelSchema for version-gated values
- Keep settings field for plain values (backward compatible with old clients)
- New clients read from both fields: settings first, then overlay versionedSettings
- Update documentation to clarify the two-field approach
- Add tests for versionedSettings overlay behavior
@hannesrudolph hannesrudolph force-pushed the feat/versioned-settings-roo-provider branch from ceb0be7 to c28d8ea Compare December 9, 2025 05:58
Based on mrubens' review feedback:
- Restructure versionedSettings to use version number as the key instead of
  having minPluginVersion on each setting value
- Use semver-compare library instead of custom compareSemver function
- Add findHighestMatchingVersion() to find the highest version <= current
  extension version
- Make versionedSettings independent - use the highest versioned setting
  that's <= current version, OR fall back to plain settings if none match

New structure:
  versionedSettings: {
    '3.36.4': {
      includedTools: ['search_replace'],
      excludedTools: ['apply_diff'],
    },
    '3.35.0': { ... },
  }

The resolver finds the highest version key <= current plugin version and uses
those settings entirely. If no version matches, falls back to plain settings.
@hannesrudolph
Copy link
Collaborator Author

Changes Made in Response to @mrubens Review

Addressed all review comments:

1. Restructured versionedSettings to use version as the key

The new structure uses the version number as the key instead of having minPluginVersion on each setting:

versionedSettings: {
  '3.36.4': {
    includedTools: ['search_replace'],
    excludedTools: ['apply_diff'],
  },
  '3.35.0': { ... },
}

2. Added semver-compare library

Replaced the custom compareSemver function with the semver-compare npm package for more robust version comparison.

3. Added logic to find highest version <= current

Added findHighestMatchingVersion() function that finds the highest version key that is <= the current extension version.

4. Made versionedSettings independent

The versioned settings are now independent - the resolver finds the highest matching version and uses those settings entirely. If no version matches, falls back to plain settings for backward compatibility.

All local tests pass (4603 tests). CI checks are running.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 9, 2025
@mrubens mrubens merged commit 83787a7 into main Dec 9, 2025
12 checks passed
@mrubens mrubens deleted the feat/versioned-settings-roo-provider branch December 9, 2025 20:54
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Dec 9, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants