After , persistent session log can contain a valid JSON object without a trailing newline (e.g. initial custom agent_start). prints because log reader drops trailing partial line unconditionally. This makes resets look broken and hides recent activity. Repro: reset with --clear-log, inspect session file contains JSON but no newline count, run logs returns no entries.
Fixed in commit 70daf843.
Changes:
splitCompleteJsonlLines now keeps a trailing line when it is valid JSON even if file lacks final newline.agentd logs --last ... from hiding freshest valid event at EOF.hFlush) after each JSON trace event and JSON result line.Verification:
Runtime smoke on omni-coder:
echo after-flush-fix via agentd send ...agentd logs omni-coder --mode persistent --last 10 now immediately showed infer/tool/result events and completion.
Correction: Repro is: (1) run 'agentd reset omni-coder --mode persistent --clear-log'; (2) check ~/.local/state/agentd-agents/sessions/omni-coder.jsonl contains a JSON event without trailing newline; (3) run 'agentd logs omni-coder --mode persistent --last 5' and it prints '-- No entries --'. Reader currently drops trailing non-newline JSONL chunk even when it is valid JSON.