mirror of
https://github.com/wu736139669/hapi.git
synced 2026-10-09 19:29:41 +00:00
* fix(agy): preserve PTY running status * fix(agent): let a trailing idle marker win over a same-chunk busy marker runAgentPty treated any busy marker in a chunk as authoritative, so a chunk carrying both 'Generating' and the idle footer discarded the idle marker. With the silence watchdog disabled (agy), nothing re-armed inputReady and the session stayed 'running' forever. Compare marker positions: the last one in the chunk reflects the final repaint. Adds lastMarkerIndex for string and non-global RegExp markers and a null-watchdog regression with both markers in one ANSI-decorated chunk. * fix(agent): scan the full chunk and keep busy-run completion bookkeeping - Scan promptBuffer + data before truncating to PROMPT_BUFFER_SIZE, so a busy marker followed by more than 4096 bytes in one callback is still seen; otherwise the run never completes and a pending web delivery can block subsequent messages. - When an idle marker wins over a same-chunk busy marker, keep the busy confirmation so completeAgentRun fires for the run that just ended. - lastMarkerIndex now clones non-global RegExps with the g flag and scans the original string, preserving anchors and terminating on zero-width matches (previously /$/ looped forever).