fix: parse session_id from stderr — hermes --quiet writes it there #348

Merged
xiaomo merged 1 commits from fix/348-session-id-stderr into main 2026-05-18 17:10:30 +00:00
Owner

What

Parse session_id from stderr in addition to stdout.

Why

Verified on Mac: hermes chat --quiet outputs session_id: xxx to stderr, AI response to stdout. The agent only parsed stdout → session_id never found → detail fell back to raw output (previously empty string, now has content after #347 but still not the full merkle session detail).

Evidence

$ spawn("hermes", ["chat", "-q", "say hi", "--quiet"], { stdio: ["ignore", "pipe", "pipe"] })
stdout: "Hi! How can I help you today?\n"
stderr: "\nsession_id: 20260519_010509_1a6573\n"

Changes

  • hermes.tsspawnHermesChat returns { stdout, stderr } instead of just stdout
  • runHermes — checks stderr first for session_id, falls back to stdout

Ref

Refs #342

## What Parse session_id from stderr in addition to stdout. ## Why Verified on Mac: `hermes chat --quiet` outputs `session_id: xxx` to **stderr**, AI response to **stdout**. The agent only parsed stdout → session_id never found → detail fell back to raw output (previously empty string, now has content after #347 but still not the full merkle session detail). ## Evidence ``` $ spawn("hermes", ["chat", "-q", "say hi", "--quiet"], { stdio: ["ignore", "pipe", "pipe"] }) stdout: "Hi! How can I help you today?\n" stderr: "\nsession_id: 20260519_010509_1a6573\n" ``` ## Changes - `hermes.ts` — `spawnHermesChat` returns `{ stdout, stderr }` instead of just stdout - `runHermes` — checks stderr first for session_id, falls back to stdout ## Ref Refs #342
xiaoju added 1 commit 2026-05-18 17:06:09 +00:00
hermes --quiet outputs session_id to stderr and AI response to stdout.
The agent was only parsing stdout, so session_id was never found and
detail always fell back to raw output.

Now checks stderr first, then stdout as fallback.
xiaomo approved these changes 2026-05-18 17:10:29 +00:00
xiaomo left a comment
Owner

LGTM stderr 优先查找 session_id,stdout fallback,detail 存纯 stdout。治本了。

LGTM ✅ stderr 优先查找 session_id,stdout fallback,detail 存纯 stdout。治本了。
xiaomo merged commit 8b43f7993b into main 2026-05-18 17:10:30 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#348