Skip to content

fix: reset _summary_failure_cooldown_until on session reset (#15547) - #15681

Open
vominh1919 wants to merge 3 commits into
NousResearch:mainfrom
vominh1919:fix/summary-cooldown-reset
Open

fix: reset _summary_failure_cooldown_until on session reset (#15547)#15681
vominh1919 wants to merge 3 commits into
NousResearch:mainfrom
vominh1919:fix/summary-cooldown-reset

Conversation

@vominh1919

Copy link
Copy Markdown
Contributor

Problem

ContextCompressor.on_session_reset() clears all per-session state except _summary_failure_cooldown_until. When a transient summary error (network timeout, rate limit) sets a cooldown, and the user then runs /new or /reset, the cooldown persists into the new session, silently blocking context compression.

Fix

Add self._summary_failure_cooldown_until = 0.0 to on_session_reset(), matching the initialization in __init__.

Before vs After

Scenario Before After
Summary fails, then /new Compression blocked for remaining cooldown Cooldown cleared, compression works immediately

Fixes #15547

The /api/skills endpoint calls _find_all_skills() without a try/except.
If skill discovery raises (e.g. corrupted skills directory, permission
error), the endpoint returns a 500 Internal Server Error.

Wrap the call in try/except and return an empty list on failure,
matching the pattern used by _list_all_skills() in skills_config.py.

Fixes NousResearch#15486
update_job() merges updates directly via {**job, **updates}, which
overwrites the repeat dict structure {"times": N, "completed": 0}
with a raw integer when the API passes repeat as an int.

This causes mark_job_run() to crash with TypeError when it tries
to subscript the integer: job["repeat"]["completed"].

Add the same normalization that create_job() applies, converting
raw integers to the expected dict structure.

Fixes NousResearch#15582
ContextCompressor.on_session_reset() clears all per-session state except
_summary_failure_cooldown_until. When a transient summary error (network
timeout, rate limit) sets a cooldown, and the user then runs /new or /reset,
the cooldown persists into the new session, silently blocking context
compression.

Fixes NousResearch#15547
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint labels Apr 25, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #15548 — same one-line fix: reset _summary_failure_cooldown_until in on_session_reset(). Also note #15549 is a superset fix. This PR also bundles unrelated changes to cron/jobs.py and web_server.py.

@alt-glitch alt-glitch added the duplicate This issue or pull request already exists label Apr 25, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

duplicate comment posted

@nwang783

Copy link
Copy Markdown

I checked #15548 and #15549. The duplicate/superset concern here looks valid, and the scope concern is valid too: the headline fix is the one-line reset in agent/context_compressor.py, while this PR also bundles unrelated cron/jobs.py and hermes_cli/web_server.py changes.

As written, I would prefer to either:

  1. close this in favor of fix(compress): restore summary model override on session reset #15549 / fix(compressor): reset _summary_failure_cooldown_until in on_session_reset() #15548, or
  2. split this so the compressor reset stands on its own.

@alt-glitch alt-glitch added the comp/dashboard Web dashboard / control panel UI (dashboard/, landing) label Jun 27, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the fixes. The named compressor change has already landed on current main, but the branch also includes two independently relevant changes that should be salvaged separately.

Problems

  • agent/context_compressor.py:739 already clears _summary_failure_cooldown_until; commit e2211b268 implemented this exact reset.
  • The cron change remains relevant: gateway/platforms/api_server.py:3527 permits repeat, :3654-3672 forwards it unchanged, cron/jobs.py:1220 merges it directly, and :1410-1413 later assumes a dict.
  • hermes_cli/web_server.py:13170 still calls _find_all_skills() without a guard. The PR diff contains no regression tests for the cron or dashboard changes.

Suggested changes

  • Split out the remaining cron and dashboard fixes, omit the already-landed compressor hunk, and add focused regressions for each path.

Automated hermes-sweeper review.

self._previous_summary = None
self._last_compression_savings_pct = 100.0
self._ineffective_compression_count = 0
self._summary_failure_cooldown_until = 0.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This exact reset is already on current main as agent/context_compressor.py:739, from commit e2211b268; remove this hunk when splitting the remaining fixes.

@teknium1 teknium1 added sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-broad Sweeper blast radius: broad — a core path most sessions hit area/sessions Session lifecycle, resume, persistence, history labels Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/sessions Session lifecycle, resume, persistence, history comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/dashboard Web dashboard / control panel UI (dashboard/, landing) duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists sweeper:blast-broad Sweeper blast radius: broad — a core path most sessions hit sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: _summary_failure_cooldown_until not reset on /new or /reset — compression skipped silently in new session

4 participants