You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
chore: report skipped Cowork transcript uploads to the server (#9182)
Refs DNO-1598
## Why
Some Claude Cowork sessions show prompts and tool calls in Agent
Sessions but no assistant replies. Replies only reach us through the
transcript the Stop hook uploads. For the affected sessions no upload
ever reaches the server, and the binary skips silently: the reason only
goes to a local debug log inside the Cowork VM, which nobody can read.
We cannot reproduce it in our own org, so we need the binary to tell us.
## What changed
**Before:**
- A Stop that shipped nothing (invalid transcript path, read failure,
empty transcript) left no trace on the server.
**After:**
- On those skips the hooks binary sends a small diagnostic upload to
`/transcript` with a reason and a short detail, and no entries.
- The transcript path is now checked after credentials are resolved, so
a path problem can be reported.
- An empty transcript is reported only on a transcript's first Stop, not
when a replaced file is still being written.
- The server answers a diagnostic upload with `stored: 0`, stores
nothing, and logs `hooks_claude_transcript_client_skip` with the reason,
detail, organization, project and session. Fields are capped at 512
bytes.
- Older servers ignore the field and store nothing, since the upload
carries no entries.
Skips before a credential is resolved (config error, missing key, device
token) still cannot be reported. Per-event hooks fail the same way in
those cases, so they show up elsewhere.
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Reports skipped Claude Cowork transcript uploads to the server so
missing assistant replies can be diagnosed from the server instead of a
local debug log inside the Cowork VM (DNO-1598).
- The Stop hook sends a diagnostic upload (reason plus short detail, no
entries) when it ships nothing: invalid transcript path, read failure,
or empty transcript.
- The transcript path is validated only after credentials resolve, so a
path problem can be reported.
- An empty transcript is reported once per transcript file; a failed
report is retried on the next Stop, and a replaced file still being
written is not reported.
- The server logs `hooks_claude_transcript_client_skip` with reason,
detail, organization, project, and session (capped at 512 bytes), stores
nothing, and replies `stored: 0`; an upload mixing a diagnostic with
entries still stores the entries.
- Older servers ignore the diagnostic field. Skips before a credential
resolves still cannot be reported; those cases surface through per-event
hooks.
<sup>Written for commit 91c0bbd8d6ccad4dd3a2e2ecbae2f7362f97d096.
Summary will update on new commits.</sup>
<a
href="https://cubic.dev/pr/speakeasy-api/gram/pull/9182?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/9182?returnTo=https%3A%2F%2Fgithub.com%2Fspeakeasy-api%2Fgram%2Fpull%2F9182&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. -->