This is due to knowledge cutoff. Depending if Claude Sonnet 3.5 or 3.7 is in use, it will be April or October 2024 respectively. To certain extent it can be fixed with proper information in system prompt or token window:
1. which time is now (not sure if Junie is adding that, my Claudine is):
https://github.com/xemantic/claudine/blob/main/src/commonMain/kotlin/Environment.kt
2. loading file containing current versions (e.g. libs.versions.toml) into the token window before doing any refactoring (preferred anyway - to load all the source code into the token window first)
3. providing either the newest version specs in system prompt, or adding a tool for the model to check them.
I would say that most of the time 1 + 2 works the best. When I work with my Claludine, I instruct it to load the whole source code of the project into the token window first (and hopefully cache it), and only then continue with changes. I am pretty sure that Junie can be prompted to do the same, however, if it is loading a single file instead of multiple files in a single step via a tool, it will be still quite inefficient.