KEMBAR78
[agents] Make `AIAgentStorageKey` in agent storage actually unique by removing `data` modifier by EugeneTheDev · Pull Request #825 · JetBrains/koog · GitHub
Skip to content

Conversation

@EugeneTheDev
Copy link
Collaborator

There's an issue in AIAgentStorage implementation where AIAgentStorageKey is incorrectly defined as a data class. This causes keys with identical names to be treated as equal due to auto-generated equals/hashCode methods, contradicting the documented behavior that each key instance should be unique regardless of name.
The fix is straightforward - remove the data modifier from the class definition. This ensures storage keys are compared by instance identity rather than content equality.

@EugeneTheDev EugeneTheDev marked this pull request as ready for review September 18, 2025 18:22
@EugeneTheDev EugeneTheDev requested a review from Rizzen September 18, 2025 18:44
@github-actions
Copy link

github-actions bot commented Sep 18, 2025

Qodana for JVM

912 new problems were found

Inspection name Severity Problems
Check Kotlin and Java source code coverage 🔶 Warning 867
Missing KDoc for public API declaration 🔶 Warning 24
Vulnerable imported dependency 🔶 Warning 21
@@ Code coverage @@
+ 68% total lines covered
12105 lines analyzed, 8241 lines covered
# Calculated according to the filters of your coverage tool

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@Ololoshechkin Ololoshechkin self-requested a review September 18, 2025 21:31
Copy link
Collaborator

@Ololoshechkin Ololoshechkin left a comment

Choose a reason for hiding this comment

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

Well done!

@EugeneTheDev EugeneTheDev merged commit 7513cae into develop Sep 18, 2025
8 checks passed
@EugeneTheDev EugeneTheDev deleted the eugenethedev/fix-agent-storage branch September 18, 2025 21:32
karloti pushed a commit to karloti/koog that referenced this pull request Sep 20, 2025
… removing `data` modifier (JetBrains#825)

There's an issue in `AIAgentStorage` implementation where
`AIAgentStorageKey` is incorrectly defined as a data class. This causes
keys with identical names to be treated as equal due to auto-generated
equals/hashCode methods, contradicting the documented behavior that each
key instance should be unique regardless of name.
The fix is straightforward - remove the data modifier from the class
definition. This ensures storage keys are compared by instance identity
rather than content equality.
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