Skip to content

🔄 fix: Update Agent Versioning to Include agent_ids #7762

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

Merged
merged 1 commit into from
Jun 6, 2025

Conversation

mawburn
Copy link
Contributor

@mawburn mawburn commented Jun 6, 2025

Summary

This PR updates the Agent model to properly track changes to the agent_ids field in the versioning system. Previously, changes to agent_ids were ignored when determining if a new version should be created, which could lead to lost history when agents were added or removed from the chain.

It was falsely identifying a new agent chain as a duplicate version.

Change Type

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes

Copilot Summary

This pull request introduces changes to the Agent model and its associated tests, focusing on the inclusion of the agent_ids field in version detection and handling. The updates ensure that changes to the agent_ids field are properly tracked, creating new versions when necessary, and include comprehensive test cases to validate this behavior.

Changes to Agent model:

  • Removed exclusion of the agent_ids field from version comparison, allowing updates to this field to trigger new versions. (api/models/Agent.js)

Updates to Agent tests:

  • Added initialization of the Agent model within multiple test suites to ensure proper setup. (api/models/Agent.spec.js) [1] [2] [3] [4]
  • Introduced a new test suite, "Agent IDs Field in Version Detection," which includes:
    • Validation that changes to agent_ids create new versions.
    • Detection of duplicate versions when agent_ids remains unchanged.
    • Handling of agent_ids updates alongside other fields.
    • Preservation of agent_ids in version history.
    • Support for empty agent_ids arrays and agents without the agent_ids field.

* Removed agent_ids exclusion from version comparison in the Agent model.
* Added tests to ensure agent_ids changes trigger new version creation and handle duplicates correctly.
* Enhanced existing tests to validate agent_ids alongside other fields and preserve history.
@danny-avila danny-avila changed the base branch from main to dev June 6, 2025 20:38
@danny-avila danny-avila changed the title fix: Update Agent Model to Include agent_ids in Versioning Logic 🔄 fix: Update Agent Versioning to Include agent_ids Jun 6, 2025
@danny-avila danny-avila merged commit 53df6a1 into danny-avila:dev Jun 6, 2025
5 checks passed
@mawburn mawburn deleted the mawburn/agent-chains branch June 6, 2025 20:49
jmaddington pushed a commit to jmaddington/LibreChat that referenced this pull request Jun 17, 2025
* Removed agent_ids exclusion from version comparison in the Agent model.
* Added tests to ensure agent_ids changes trigger new version creation and handle duplicates correctly.
* Enhanced existing tests to validate agent_ids alongside other fields and preserve history.
rhonyabdullah pushed a commit to rhonyabdullah/LibreChat that referenced this pull request Jun 27, 2025
* Removed agent_ids exclusion from version comparison in the Agent model.
* Added tests to ensure agent_ids changes trigger new version creation and handle duplicates correctly.
* Enhanced existing tests to validate agent_ids alongside other fields and preserve history.
kenshinsamue pushed a commit to intelequia/LibreChat that referenced this pull request Aug 4, 2025
* Removed agent_ids exclusion from version comparison in the Agent model.
* Added tests to ensure agent_ids changes trigger new version creation and handle duplicates correctly.
* Enhanced existing tests to validate agent_ids alongside other fields and preserve history.
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