Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(config): support workflow merge #478

Merged
merged 7 commits into from
Mar 11, 2025
Merged

feat(config): support workflow merge #478

merged 7 commits into from
Mar 11, 2025

Conversation

tusharmath
Copy link
Collaborator

Description

This PR introduces several important improvements to the configuration system and model handling:

Changes

  • Make agent model field optional with proper Option type handling
  • Refactor merge strategies into dedicated modules (std, vec, bool)
  • Improve configuration merging with specialized strategies for different types
  • Simplify default forge.yaml to minimal required configuration
  • Standardize parameter naming in provider services (id/model_id → model)
  • Add error handling for missing model in agents
  • Apply consistent code formatting

Benefits

  • Enhanced flexibility by making model fields optional
  • More predictable configuration merging behavior
  • Cleaner default configuration
  • Improved error handling for missing models
  • Consistent parameter naming across the codebase

Testing

The changes have been tested by:

  • Running tests to verify the optional model field correctly integrates with existing code
  • Checking configuration merging with different combinations of user and default settings
  • Verifying proper error handling when a model is missing

Related Issues

Resolves issues with configuration merging and agent model handling.

@tusharmath tusharmath added enhancement New feature or request rust Pull requests that update rust code labels Mar 10, 2025
- Add merge crate as a dependency with derive feature
- Create new merge module with custom merge strategies
- Implement Merge trait for Agent and Workflow structs
- Add field-specific merge strategies in Agent struct
- Add custom agent merging function in Workflow
- Remove unused default_max_length function
…ce rules

- Refactor loader.rs with domain-focused structure for better code organization
- Add WorkflowSource enum to represent different configuration sources
- Implement proper configuration merging where project settings override defaults
- Update README with clear documentation on configuration loading precedence
- Add merge and bytes dependencies to forge_api crate

This change improves the configuration loading logic by clearly separating
concerns and making the precedence rules explicit, while ensuring backward
compatibility.
…optional

- Make agent model field optional with proper Option<ModelId> type handling
- Refactor merge strategies into dedicated modules (std, vec, bool)
- Improve configuration merging with specialized strategies for different types
- Simplify default forge.yaml to minimal required configuration
- Standardize parameter naming in provider services (id/model_id → model)
- Add error handling for missing model in agents
- Apply consistent code formatting
- Add Key trait to provide identity-based access to mergeable objects
- Implement Key trait for Agent using AgentId
- Add unify_by_key function for merging collections based on object identity
- Refactor workflow agent merging to use the new generic function
- Improve maintainability by consolidating merging logic in merge module
@tusharmath tusharmath changed the title refactor(config): improve configuration merging and make model field optional feat(config): support workflow merge Mar 11, 2025
@tusharmath tusharmath enabled auto-merge (squash) March 11, 2025 04:16
@tusharmath tusharmath merged commit d1ee066 into main Mar 11, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request rust Pull requests that update rust code type: chore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant