Files
hapi/shared
df958ae349 fix(shared): parse AGENT_NOTIFY_SUMMARY with glued last-line prose (#1426)
* fix(shared): parse AGENT_NOTIFY_SUMMARY with glued last-line prose

Agents sometimes omit the newline before the footer. Accept an optional
prefix on the last non-empty line when it still ends with a well-formed
AGENT_NOTIFY_SUMMARY JSON payload. Mid-body quotes stay ignored.

Fixes #1425

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(shared): prefer first valid AGENT_NOTIFY_SUMMARY JSON match

lastIndexOf broke footers whose string values mentioned the token.
Scan left-to-right and accept the first occurrence with parseable JSON.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-09 04:46:55 +01:00
..
2026-01-03 14:43:59 +08:00