mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-25 17:18:11 +00:00
fix(cli): show 'grew by' when optimize-storage DB size increases
Closes #70146 When hermes sessions optimize-storage runs and the database grows (rather than shrinks), the old code always printed '(reclaimed X MB)' with a negative value. Fix by using a conditional label: - positive delta → 'reclaimed X MB' - negative delta → 'grew by X MB'
This commit is contained in:
parent
4aab4c28d7
commit
58b2a8c192
1 changed files with 2 additions and 1 deletions
|
|
@ -16762,10 +16762,11 @@ def main():
|
|||
os.path.getsize(db_path) / (1024 * 1024) if db_path.exists() else 0.0
|
||||
)
|
||||
saved = before_mb - after_mb
|
||||
saved_label = f"reclaimed {saved:.1f} MB" if saved >= 0 else f"grew by {-saved:.1f} MB"
|
||||
print(f"\n✓ Search index optimized.")
|
||||
print(
|
||||
f" Database size: {before_mb:.1f} MB -> {after_mb:.1f} MB "
|
||||
f"(reclaimed {saved:.1f} MB)"
|
||||
f"({saved_label})"
|
||||
)
|
||||
if result.get("vacuumed") is False:
|
||||
print(" (VACUUM was skipped or failed — run "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue