fix(copilot-cli): accept float timestamps in hook payloads

main

Commit

gtrrz-victor2mo ago

Copilot CLI 1.0.71 emits hook payload timestamps as float epoch-millis (e.g. 1784283185447.0) where earlier versions sent integers. The strict int64 parse in ParseTimestamp rejected the float, so every lifecycle hook (session-start, user-prompt-submitted, agent-stop, session-end) exited 1 before a session could start — no checkpoints were ever created, which is why 46/59 copilot-cli E2E tests time out on "checkpoint state did not advance". Tool hooks kept working because they skip stdin parsing entirely.

Parse the numeric form as float64 (truncating to millis) in both ParseTimestamp and isJSONNumber, so host detection also keeps classifying float-timestamp payloads as copilot-cli.

Co-Authored-By: Claude Fable 5 noreply@anthropic.com