Files
agent-estate-wiki/incidents/2026-08-29-gmail-read-state.md
T
Tony0410 0c4ed3350b wiki audit 2026-10-02: 2 new cron failures, cliprox/terra connection auth incident, delivery-failure semantics corrected, profile rewrite, broken wikilinks repaired
- new: incidents/2026-10-01-cliproxy-connection-auth-expired.md (HTTP 401, credential fault, cannot self-recover)
- systems/scheduled-tasks.md: 30 jobs / 27 enabled; failing 3 -> 6; streaks advanced; wiki-tree drift recorded
- systems/messaging-integrations.md: two distinct thread-failure variants (lost vs thread-less fallback)
- systems/current-profile.md: full rewrite from live config (no profiles/default/, smart-route, OmniRoute)
- current-state.md / index.md / log.md: 2026-10-02 entry
- repair: copied 5 vault-only pages referenced by index.md (ignis, nextcloud, 3 incidents) so wikilinks resolve
- include pending stocktake output: skills-index.md 2026-09-27, raw/stocktake/freshness-2026-09-2{6,7}.txt
2026-10-02 00:17:15 +08:00

3.1 KiB

title, type, status, created, updated, verified_on, confidence, tags, sources
title type status created updated verified_on confidence tags sources
Gmail Read-State Incident (2026-08-29) incident active 2026-08-29 2026-08-29 2026-08-29 high
email
gmail
cron
himalaya
incident
session:default/20260829_204103_9e1087

Gmail Read-State Incident

Date discovered: 2026-08-29 20:41 AWST
Status: Active — mitigation in place, root cause identified but not fully fixed

Summary

Anthony's Gmail inbox messages were being automatically marked as read without his consent. The issue was traced to Hermes cron jobs using Himalaya's message read command, which applies the "seen" flag even with --preview.

Timeline

  • 2026-08-29 20:41 — Anthony reports: "What is marking my Gmail email as read it is not meant to be"
  • Investigation — Loaded skills: gmail-imap-email-monitor, hermes-cron-operations, email-inbox-triage
  • Root cause identified — fetch_newsletters.py (line 49) runs:
    himalaya message read --preview --folder INBOX <message-id>
    
    Himalaya's message read command automatically applies the "seen" flag unless --preview is used for preview-only access. However, even --preview may still mark messages read in some configurations.
  • Other scripts checked — gmail_readonly_imap.py uses SELECT readonly and BODY.PEEK[] (safe, does not mark read)
  • Mitigation applied:
    • Stopped goimapnotify.service (IMAP watcher)
    • Paused "Important-mail monitor" cron job (if present)
    • Newsletter digest already patched to use --preview

Root Cause

The fetch_newsletters.py script at /home/hermes/.hermes/scripts/fetch_newsletters.py line 49:

r2 = subprocess.run(
    ["himalaya", "message", "read", "--preview", "--folder", "INBOX", m["id"]],
    capture_output=True, text=True, timeout=60
)

Despite using --preview, Himalaya may still mark messages as read depending on configuration. The proper fix is to use readonly IMAP with BODY.PEEK[] instead of the himalaya message read command.

Impact

  • Newsletter emails processed by the Tech & AI Newsletter Digest cron job were marked as read
  • Potential for other Gmail automation scripts to have similar behavior
  • User trust issue — unexpected state changes in personal email

Resolution Status

Mitigation: Partially complete

  • goimapnotify stopped
  • Important-mail monitor paused (if it existed)

Fix required:

  • Rewrite fetch_newsletters.py to use readonly IMAP (BODY.PEEK[]) instead of himalaya message read
  • Audit all Gmail-related scripts for similar patterns
  • Verify gmail_action_digest_v3.py and other email scripts use readonly access

Prevention

  • All Gmail IMAP scripts should use SELECT readonly and BODY.PEEK[] patterns
  • Add a pre-commit check or linting rule for himalaya message read usage
  • Document readonly email access pattern in a runbook