fix: hermes agent empty detail — parse session_id from any line #347
Reference in New Issue
Block a user
Delete Branch "fix/342-parse-session-id"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Fix
parseSessionIdFromStdoutto scan all lines instead of only the last non-empty line.Why
hermes chat --quietoutputssession_id: xxxon the first line, followed by the AI response. The old code scanned backward andbreaked on the first non-empty line that did not match — so it never found the session_id, fell back tostoreHermesRawOutput, and stored{ text: "" }as detail.Changes
session-detail.ts— scan forward through all lines, return first matchsession-detail.test.ts— add test case for first-line session_id (quiet mode)Verified
All 8 tests pass.
Ref
Refs #342
LGTM ✅ 好 catch。正向扫描 + 测试覆盖 quiet mode 场景。