Skip to content

fix(achievements): persist lifetime counters to prevent regression after prune - #28705

Closed
ygd58 wants to merge 2 commits into
NousResearch:mainfrom
ygd58:fix/achievements-lifetime-counter-persist
Closed

fix(achievements): persist lifetime counters to prevent regression after prune#28705
ygd58 wants to merge 2 commits into
NousResearch:mainfrom
ygd58:fix/achievements-lifetime-counter-persist

Conversation

@ygd58

@ygd58 ygd58 commented May 19, 2026

Copy link
Copy Markdown
Contributor

Problem

When sessions.auto_prune deletes old rows from state.db, achievement lifetime counters regress because they are recomputed only from remaining sessions (issue #28661).

Fix

Merge scanned aggregate counters with persisted lifetime_counters in state.json using max(). Once a counter reaches a value it never goes backward.

Fixes #28661

ygd58 added 2 commits May 18, 2026 09:04
…ttling

Two fixes for issue NousResearch#27804:

1. Subject-based session isolation: chat_id is now sender_addr:normalized_subject
   so each unique email subject gets its own isolated session. Re: prefixes are
   stripped so replies stay in the same thread as the original message.

2. Progress message throttling: intermediate status messages ('still working',
   'looking', 'searching', etc.) are suppressed for email delivery. Unlike chat
   platforms, email cannot be edited in-place, so progress updates create
   separate emails that flood the inbox (100-200 emails per interaction).
   Only final responses are delivered.

Fixes NousResearch#27804
…hrottling

Three improvements for issue NousResearch#27804:

1. RFC 5322 thread isolation: In-Reply-To header used as stable thread
   anchor so replies stay in the same session even if subject changes.
   Falls back to normalized subject for fresh threads.

2. Subject-based isolation fallback: new threads get per-subject sessions
   so different topics don't interrupt each other.

3. Progress throttling: intermediate status messages ('still working',
   'searching', etc.) suppressed — only final responses are emailed,
   preventing 100-200 status emails per interaction.

Supersedes subject-only approach with RFC 5322 standard threading.
@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery platform/email Email (IMAP/SMTP) adapter P3 Low — cosmetic, nice to have needs-triage labels May 19, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #28464. Same root cause: SCHEMA_SQL creates idx_tasks_session_id index before _migrate_add_optional_columns() adds the session_id column on legacy DBs. Fix PRs: #28461 (narrower), #28602 (broader).

@ygd58 ygd58 closed this May 19, 2026

@ygd58 ygd58 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Closing — wrong branch was pushed (email.py instead of plugin_api.py). Correct fix is in #28713.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have platform/email Email (IMAP/SMTP) adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hermes-achievements lifetime counters regress after sessions.auto_prune prunes state.db

2 participants