Skip to content

fix(gateway): compare session suspension timestamps correctly - #8012

Closed
Orinks wants to merge 1 commit into
NousResearch:mainfrom
Orinks:fix/gateway-session-suspension-datetime
Closed

fix(gateway): compare session suspension timestamps correctly#8012
Orinks wants to merge 1 commit into
NousResearch:mainfrom
Orinks:fix/gateway-session-suspension-datetime

Conversation

@Orinks

@Orinks Orinks commented Apr 12, 2026

Copy link
Copy Markdown

Summary

  • fix gateway startup session suspension to compare datetime values consistently
  • add a regression test covering recent session entries with datetime updated_at values

Verification

  • pytest tests/gateway/test_session.py::TestSuspendRecentlyActive::test_suspends_recent_datetime_entries -v
  • pytest tests/gateway/test_session.py -q

Issue

  • fixes the startup warning: Session suspension on startup failed: '>=' not supported between instances of 'datetime.datetime' and 'float'

@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround comp/gateway Gateway runner, session dispatch, delivery labels Apr 28, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #8129 — same datetime-vs-float comparison bug in suspend_recently_active(). #8129 is the surviving fix attempt per prior triage.

@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #8129

@teknium1

Copy link
Copy Markdown
Contributor

Automated hermes-sweeper review: this fix is already present on current main.

Evidence:

  • gateway/session.py:1450 now computes cutoff = _now() - timedelta(seconds=max_age_seconds), so the cutoff is a datetime, not a float timestamp.
  • gateway/session.py:1457 compares entry.updated_at >= cutoff, meaning both sides of the comparison are datetime values.
  • git log -S 'cutoff = _now() - timedelta(seconds=max_age_seconds)' -- gateway/session.py points to 413990c94537e9c9da973bb21a6afcd332400b91 as the commit that introduced the current implementation in this main history.
  • The discussion correctly noted this as a duplicate of the same suspend_recently_active() datetime-vs-float bug, but the current HEAD code is what makes this PR redundant now.

Thanks for the fix attempt — the behavioral issue it targeted is already covered on main.

@teknium1 teknium1 closed this Jun 29, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jun 29, 2026
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 P1 High — major feature broken, no workaround sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants