Skip to content

Rename idle reaper timeout to minutes#305

Merged
lewtun merged 1 commit into
mainfrom
codex/idle-reaper-minutes
Jun 8, 2026
Merged

Rename idle reaper timeout to minutes#305
lewtun merged 1 commit into
mainfrom
codex/idle-reaper-minutes

Conversation

@lewtun
Copy link
Copy Markdown
Member

@lewtun lewtun commented Jun 8, 2026

Summary

  • replace REAPER_IDLE_HOURS with REAPER_IDLE_MINUTES defaulting to 15
  • update per-user capacity errors to refer to live sessions and idle release timing
  • add tests for the default timeout and capacity message wording

Tests

  • uv run pytest tests/unit/test_session_reaper.py
  • uv run ruff check .
  • uv run ruff format --check .

Co-authored-by: OpenAI Codex <codex@openai.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 8, 2026

Claude finished @lewtun's task in 47s —— View job


Review: PR #305 — Rename idle reaper timeout to minutes

No blocking issues — 2 P2

Clean rename. REAPER_IDLE_HOURSREAPER_IDLE_MINUTES is applied consistently, no stray references remain anywhere in the repo (grep confirms only the new symbol in backend/session_manager.py and tests/), timedelta is already imported in the test, and the new tests correctly cover both the default and the reworded capacity message.


P2 — Stated wait time can understate actual release by up to one reaper interval · backend/session_manager.py:845-849

The message tells the user to "wait {REAPER_IDLE_MINUTES:g} minutes after your last activity for an idle session to be released." But eviction is driven by the periodic reaper loop (REAPER_INTERVAL_S, default 300s — session_manager.py:148), which only sweeps sessions whose idle age has already crossed REAPER_IDLE (cutoff = datetime.utcnow() - REAPER_IDLE, session_manager.py:1083). So worst-case wall-clock is REAPER_IDLE_MINUTES + REAPER_INTERVAL_S ≈ 20 min, not 15. Not worth blocking — the message is directionally correct and "after your last activity" softens it — but if you want it precise, phrase as "within a few minutes after ~15 minutes of inactivity" or similar.

P2 — Default is now 8× more aggressive (2h → 15m) · backend/session_manager.py:147

Flagging the behavior change for visibility, not as a defect: idle live sessions now leave the live pool after 15 min instead of 2 h. Functionally safe since they stay fully resumable from Mongo (per the comment at session_manager.py:143-146), and it does free per-user/global slots faster, which seems to be the intent. Just confirm prod has REAPER_IDLE_MINUTES set explicitly if 15 min isn't the desired live-pool TTL there.


Tests look good — the per-user-cap test asserts each clause of the new message independently, which will catch future wording drift. LGTM to merge.

@lewtun lewtun merged commit c7f69d4 into main Jun 8, 2026
3 checks passed
@lewtun lewtun deleted the codex/idle-reaper-minutes branch June 8, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant