Skip to content

fix(cron): ensure cron session title is never blank on failure - #50827

Closed
allin2 wants to merge 1 commit into
NousResearch:mainfrom
allin2:fix/cron-session-titles-clean
Closed

fix(cron): ensure cron session title is never blank on failure#50827
allin2 wants to merge 1 commit into
NousResearch:mainfrom
allin2:fix/cron-session-titles-clean

Conversation

@allin2

@allin2 allin2 commented Jun 22, 2026

Copy link
Copy Markdown

Summary

When set_session_title raises (e.g. title conflict with another session), the cron session was left with no title. The error was only logged at DEBUG level, making it invisible by default.

Motivation

Fixes #50535

When a cron job runs and the title-setting fails (DB error, title conflict), the cron session ends up with a blank title in the session sidebar/history. This degrades session recall quality and makes it hard to identify sessions.

Changes

  • fix: Retry with a fallback title that includes the session's timestamp suffix (seconds) to guarantee uniqueness
  • logging: Log the initial failure at WARNING level instead of DEBUG so operators can see it

Validation

The fix is defensive — it catches the exception and retries with a unique fallback title:

  1. Primary title: {job_name} · {timestamp} (e.g. "Morning digest · Jun 22 08:00")
  2. Fallback title: {job_name} · {session_suffix} (e.g. "Morning digest · 20260622_080045")

Checklist

  • Code follows the project's style guidelines
  • No unrelated changes included
  • Commit message follows Conventional Commits format

When set_session_title raises (e.g. title conflict with another session),
the cron session was left with no title. The error was only logged at
DEBUG level, making it invisible by default.

Now we retry with a fallback title that includes the session's
timestamp suffix (seconds) to guarantee uniqueness, and log the
initial failure at WARNING level so operators can see it.

Fixes NousResearch#50535
@alt-glitch alt-glitch added type/bug Something isn't working comp/cron Cron scheduler and job management P3 Low — cosmetic, nice to have labels Jun 22, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Resubmission of closed #50817 (same title/scope, same author). Competes with open #50575 and #50538, which target the same cron-title reliability issue (#50535) via different mechanisms — maintainer to choose. Related, not duplicate.

@allin2

allin2 commented Jun 22, 2026

Copy link
Copy Markdown
Author

Closing to resubmit after verification against latest main.

@allin2 allin2 closed this Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cron Cron scheduler and job management P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(cron): cron sessions have blank titles when title generation fails

2 participants