This repository was archived by the owner on Mar 6, 2024. It is now read-only.
Commit 71f7e6e
Fix tokens calculation & cleanup the file summary prompt logic (#426)
Previously, the `tokens` calculation was incorrect. With this PR, now it
is correctly calculated & reuse the instantiated prompt for readability
and efficiency.
<!-- This is an auto-generated comment: release notes by OSS CodeRabbit
-->
### Summary by CodeRabbit
```
**Bug fix:**
- Fixed the incorrect calculation of `tokens` in `src/review.ts`.
- Improved code readability and efficiency by reusing instantiated prompt.
- Removed diff tokens check, now only checking if token count exceeds limit.
- Files exceeding token limit are now skipped and logged in `summariesFailed`.
> 🎉 Code's been tweaked, bugs have been fixed, 🐛
> Efficiency improved, with no tricks. 🎩✨
> Tokens counted right, no more plight, 🧮
> Celebrate this PR, it's quite a sight! 🥳🎊
```
<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->
Co-authored-by: Harjot Gill <[email protected]>1 parent 4c02adf commit 71f7e6e
1 file changed
+5
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| 323 | + | |
323 | 324 | | |
324 | 325 | | |
325 | | - | |
326 | | - | |
327 | | - | |
| 326 | + | |
| 327 | + | |
328 | 328 | | |
329 | | - | |
330 | | - | |
| 329 | + | |
331 | 330 | | |
332 | 331 | | |
333 | 332 | | |
334 | 333 | | |
335 | 334 | | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | 335 | | |
340 | 336 | | |
341 | 337 | | |
342 | | - | |
| 338 | + | |
343 | 339 | | |
344 | 340 | | |
345 | 341 | | |
| |||
0 commit comments