fix(daemon): promote every error field alias so control-listener failures are diagnosable - #63
Draft
posthog[bot] wants to merge 1 commit into
Conversation
The SentryLayer only promoted a structured field named literally `error` into the exception value. The ~dozen `tracing::error!(%e, ...)` call sites in the daemon name the field `e`, so their underlying `AutterError` stayed in the context map and the captured event had no cause. Those issues grouped and titled by the static log string alone, which made them undiagnosable from error tracking. Promote the first non-empty of `error`, `err`, `e`, or `source`, so all alias spellings reach the exception value and distinct causes fingerprint separately. Also name the two control-socket setup failures that previously propagated bare io errors (stale socket removal and owner-only permissions), so each setup step is self-describing alongside the already named bind failure. Generated-By: PostHog Desktop Task-Id: 12288664-6d02-4945-8e0d-5064adfcdea4
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.
Problem
control_listener_loop_actorreturns an error and its wrapper callsrequest_shutdown(), so the whole daemon stops and the user loses all tracking. Whoever hits it gets no tracking at all.$exceptionis undiagnosable: it arrives as a bare static string, with no cause and no stack trace. You cannot tell whether the bind failed on a stale socket, a permissions problem, or something else.message_with_promoted_errorinsentry_layer.rsappended the underlying cause to the exception value only when the tracing field was named literallyerror. The%ecall sites name the fielde, so theAutterErrortext stayed in the context map and never reached the exception value.tracing::error!(%e, ...)sites insrc/daemon.rs, including the sibling trace listener. Every one lands as an undiagnosable bare message.Changes
message_with_promoted_errornow promotes the first non-empty oferror,err,e, orsource, so all spellings reach the exception value and distinct causes fingerprint separately in error tracking.IO error: <os error>failed removing stale socket <path>: <os error>failed binding control socket: ...IO error: <os error>failed setting owner-only permissions on socket <path>: <os error>Expected impact
Tests
cargo test --lib sentry_layer— 8 pass, including new cases for thee,err, andsourcealiases and for skipping an empty earlier alias.cargo check --locked,cargo fmt --check, andcargo clippy --liball clean.Agent context
autter-dev/autter-runtime, but that is the TypeScript/Node SDK monorepo. The Rust CLI and daemon live inautter-dev/autter-cli, so this fix targetsautter-cli.Created with PostHog Desktop from this inbox report.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.