Skip to content

fix(gateway): tolerate unreadable JSONL transcripts (#28288)#28590

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-3ad7d98a
May 19, 2026
Merged

fix(gateway): tolerate unreadable JSONL transcripts (#28288)#28590
teknium1 merged 1 commit into
mainfrom
hermes/hermes-3ad7d98a

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Salvage of #28288 by @MoonJuhan. (Note: the original PR was closed earlier per user request; reopening the fix here because the gateway crash on unreadable JSONL is still real and the SQLite fallback path is sound.)

What: Gateway sessions persist in both SQLite AND legacy JSONL files. load_transcript() reads BOTH and picks whichever has more messages. The JSONL read is guarded for per-line JSONDecodeError (corrupt line → skip), but the open() call itself is unguarded — so disk error / permission flap / NFS hiccup raises OSError and session recovery crashes even though SQLite has the full transcript.

How: Wrap the JSONL open() in try/except OSError. On failure, log at debug and fall through to the SQLite messages. New test monkeypatches open to raise OSError and asserts SQLite history is returned instead.

Original PR: #28288

@teknium1 teknium1 merged commit b8a9cbd into main May 19, 2026
@teknium1 teknium1 deleted the hermes/hermes-3ad7d98a branch May 19, 2026 07:11
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-3ad7d98a vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 8954 on HEAD, 8954 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4702 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery labels May 19, 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 P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants