Skip to content

hooks@0.3.39

Choose a tag to compare

@gram-bot gram-bot released this 27 Oct 10:34
· 198 commits to main since this release
49f3605
feat: records device-side hook failures to AICP (DNO-1234) (#7865)

<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Reports device-side hook delivery failures that previously vanished:
when a hook send fails, the device now spools a failure record next to
the event and drains it once connectivity returns, so the server sees
why events failed, how long delivery took, and which devices were
affected. The report is telemetry only and never counts as agent
activity.

**Changes**
- Adds a `client.delivery_failed` event type carrying a
`delivery_failure` payload (cause, phase, status code, elapsed ms,
attempts, binary version, OS/arch, harness, and the failed event's type
and session); the payload is required on that event type and rejected on
every other, and a report must not carry a session or any other data
block.
- Bounds the failed event's type to the hook event vocabulary enum
(`failed_event_type` on the wire) and enforces it in Go for in-process
callers.
- Records a `hooks.delivery_failure` counter broken down by cause,
phase, event type, harness, OS, and binary version, plus a diagnostic
telemetry row stamped with the device-side attempt time and carrying no
tool name so tool-trace queries never count it.
- Device attributes on the row come from the report body, not the
draining request's headers.
- Deduplicates replayed reports by idempotency key so a redeliver
doesn't count twice.

<sup>Written for commit b0d756f05c7eeb1e61b4415eee9ad87cb57e4d1b.
Summary will update on new commits.</sup>

<a
href="https://cubic.dev/pr/speakeasy-api/gram/pull/7865?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<a
href="https://www.cubic.dev/action/auto-fix/pr/speakeasy-api/gram/7865?returnTo=https%3A%2F%2Fgithub.com%2Fspeakeasy-api%2Fgram%2Fpull%2F7865&source=description"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
alt="Turn on auto-fix"
src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>

<!-- End of auto-generated description by cubic. -->

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>