You're offline — showing cached data

NotebookLM Auth Preflight — keepalive + pre-show recovery

notebooklm-auth-preflight
2026-06-13 06:11:42 SAST
← Back to Tasks

OVERRIDES runtime profile: uses direct_mixed because this task invokes NO Claude CLI — it calls the NotebookLM token API (Google), Playwright/Chromium, and Telegram (scripts/notify.py) directly. No LLM is used, so the wrapper claude provider profile does not apply (rule 8).

Keeps NotebookLM auth durable so radio-daily-brief and social-pulse stop failing with "Authentication expired or invalid".

The scheduler evaluates cron in SAST wall-clock (see scheduler.is_due), and those shows fire at 05:00 / 05:30 SAST. So this runs at 00:30 / 02:30 / 04:30 SAST — the last is ~30 min before the 05:00 radio show. Each cycle:

  1. Probe — authenticated NotebookLMClient.from_storage() + notebooks.list(). This is also the keepalive: a real authenticated request warms Google's server session so the static cookie snapshot does not idle-rot. The happy path launches NO browser (no Chromium thrash / profile contention).
  2. Recover — if the snapshot is dead (or near show time, even on a transient- looking error), re-derive a fresh storage_state.json headed on display :1 from the persistent ~/.notebooklm/browser_profile, then re-probe against the real token API.
  3. Alert (only if still dead)scripts/notify.py Telegram to Elmar to re-auth via VNC. The 05:00/05:30 shows are inside notify.py quiet hours (21:00–06:00 SAST), so the 04:30 pre-show run forces the alert past quiet hours; the 00:30 / 02:30 keepalive runs respect quiet hours (silent) so Elmar is not woken on a transient blip.

notify_on: never because the script owns its own quiet-hours-aware, specific alert — the scheduler's generic failure ping would duplicate it and ignore quiet hours. A non-zero exit (2 = needs human re-auth, 1 = transient) still surfaces on the health dashboard. Survival metric: ~/.notebooklm/preflight.log (one JSON line per cycle). Runbook: runbooks/notebooklm-auth-durability.md.

Daily at 00:30, 02:30, 04:3030 0,2,4 * * *
Yes
shell
300s
No
in 18h (2026-06-14 00:30)

Task Definition

tasks/notebooklm-auth-preflight.md
shell
set
No
No
export HOME=/home/lucienne && export DISPLAY=:1 && cd /home/lucienne/workspace && python3 scripts/nblm_auth.py preflight --json

Edit Schedule

Result:
24
Runs (7d)
24
Completed
0
Failed
0
Timeout
100%
Success (7d)
3s
Avg Duration
notebooklm auth radio social-pulse keepalive

Run History (24)

StartedFinishedStatusDurationOutputLog
2h ago 2h ago completed 2s
{ "before": { "healthy": true, "notebook_count": 330, "reason": "ok", "needs_reauth": false }, "re ...
View log
4h ago 4h ago completed 2s
{ "before": { "healthy": true, "notebook_count": 330, "reason": "ok", "needs_reauth": false }, "re ...
View log
6h ago 6h ago completed 2s
{ "before": { "healthy": true, "notebook_count": 330, "reason": "ok", "needs_reauth": false }, "re ...
View log
1d ago 1d ago completed 8s
{ "before": { "healthy": false, "notebook_count": null, "reason": "Authentication expired or invalid. Redi ...
View log
1d ago 1d ago completed 2s
{ "before": { "healthy": true, "notebook_count": 327, "reason": "ok", "needs_reauth": false }, "re ...
View log
1d ago 1d ago completed 2s
{ "before": { "healthy": true, "notebook_count": 327, "reason": "ok", "needs_reauth": false }, "re ...
View log
2d ago 2d ago completed 7s
{ "before": { "healthy": false, "notebook_count": null, "reason": "Authentication expired or invalid. Redi ...
View log
2d ago 2d ago completed 1s
{ "before": { "healthy": true, "notebook_count": 325, "reason": "ok", "needs_reauth": false }, "re ...
View log
2d ago 2d ago completed 2s
{ "before": { "healthy": true, "notebook_count": 325, "reason": "ok", "needs_reauth": false }, "re ...
View log
3d ago 3d ago completed 2s
{ "before": { "healthy": true, "notebook_count": 322, "reason": "ok", "needs_reauth": false }, "re ...
View log
3d ago 3d ago completed 2s
{ "before": { "healthy": true, "notebook_count": 322, "reason": "ok", "needs_reauth": false }, "re ...
View log
3d ago 3d ago completed 2s
{ "before": { "healthy": true, "notebook_count": 322, "reason": "ok", "needs_reauth": false }, "re ...
View log
4d ago 4d ago completed 10s
{ "before": { "healthy": false, "notebook_count": null, "reason": "Authentication expired or invalid. Redi ...
View log
4d ago 4d ago completed 4s
{ "before": { "healthy": true, "notebook_count": 320, "reason": "ok", "needs_reauth": false }, "re ...
View log
4d ago 4d ago completed 2s
{ "before": { "healthy": true, "notebook_count": 320, "reason": "ok", "needs_reauth": false }, "re ...
View log
5d ago 5d ago completed 8s
{ "before": { "healthy": false, "notebook_count": null, "reason": "Authentication expired or invalid. Redi ...
View log
5d ago 5d ago completed 2s
{ "before": { "healthy": true, "notebook_count": 318, "reason": "ok", "needs_reauth": false }, "re ...
View log
5d ago 5d ago completed 2s
{ "before": { "healthy": true, "notebook_count": 318, "reason": "ok", "needs_reauth": false }, "re ...
View log
6d ago 6d ago completed 10s
{ "before": { "healthy": false, "notebook_count": null, "reason": "Authentication expired or invalid. Redi ...
View log
6d ago 6d ago completed 2s
{ "before": { "healthy": true, "notebook_count": 317, "reason": "ok", "needs_reauth": false }, "re ...
View log
6d ago 6d ago completed 2s
{ "before": { "healthy": true, "notebook_count": 317, "reason": "ok", "needs_reauth": false }, "re ...
View log
7d ago 7d ago completed 2s
{ "before": { "healthy": true, "notebook_count": 313, "reason": "ok", "needs_reauth": false }, "re ...
View log
7d ago 7d ago completed 2s
{ "before": { "healthy": true, "notebook_count": 313, "reason": "ok", "needs_reauth": false }, "re ...
View log
7d ago 7d ago completed 2s
{ "before": { "healthy": true, "notebook_count": 313, "reason": "ok", "needs_reauth": false }, "re ...
View log

Comments (0)

No comments yet — add instructions for Luci
Help