feat: CYPACK→CYHOST error telemetry pipeline for Mixpanel#975
Open
cyrusagent wants to merge 2 commits intomainfrom
Open
feat: CYPACK→CYHOST error telemetry pipeline for Mixpanel#975cyrusagent wants to merge 2 commits intomainfrom
cyrusagent wants to merge 2 commits intomainfrom
Conversation
Extract callback headers (X-Cyrus-Callback-Token, X-Cyrus-Callback-URL, X-Cyrus-Team-Id) from CYHOST-forwarded webhooks in LinearEventTransport. Create TelemetryReporter service that POSTs error events back to CYHOST for Mixpanel tracking. Hook into AgentSessionManager.completeSession() to classify and report session errors (crash, stall, rate_limit, billing, max_turns). Fire-and-forget with graceful degradation when no callback context is available. CYPACK-951 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the CYPACK side of the error telemetry pipeline that reports agent session errors back to CYHOST for Mixpanel tracking. When agents crash, stall, hit rate limits, or exceed turn limits on CYPACK droplets, error events are now POSTed back to CYHOST which has the team/user identity context needed for analytics.
X-Cyrus-Callback-Token,X-Cyrus-Callback-URL, andX-Cyrus-Team-Idheaders from CYHOST-forwarded webhooks inLinearEventTransportTelemetryReporterservice that POSTs error events to CYHOST's callback endpoint with Bearer token authAgentSessionManager.completeSession()classifies session errors into 5 types (crash,stall,rate_limit,billing,max_turns) and reports them via fire-and-forget callbackImplementation
Header extraction (
LinearEventTransport): Callback context is captured once from the first proxy webhook and stored on the transport instance. All three headers must be present; partial headers are ignored.Error classification (
AgentSessionManager): Maps SDK result messages to error types by checkingsubtype(e.g.,error_max_turns) and scanning error text for keywords (rate_limit,billing,timeout, etc.). Falls back tocrashfor unrecognized errors.Reporting (
TelemetryReporter): Fire-and-forget HTTP POST with 10s timeout. Never blocks session completion. Logs warnings on failure but never throws.Wiring (
EdgeWorker): CreatesTelemetryReporterwith null context at startup, lazily forwards callback context from transport on first webhook message.Testing
Linear Issue
CYPACK-951