Skip to content

fix(daemon): promote every error field alias so control-listener failures are diagnosable - #63

Draft
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixdaemon-promote-the-e-tracing-field-b2889b
Draft

posthog[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixdaemon-promote-the-e-tracing-field-b2889b

Conversation

@posthog

@posthog posthog Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Problem

  • When the control socket fails to bind, control_listener_loop_actor returns an error and its wrapper calls request_shutdown(), so the whole daemon stops and the user loses all tracking. Whoever hits it gets no tracking at all.
  • The captured $exception is 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.
  • Root cause: message_with_promoted_error in sentry_layer.rs appended the underlying cause to the exception value only when the tracing field was named literally error. The %e call sites name the field e, so the AutterError text stayed in the context map and never reached the exception value.
  • Blast radius: the field-name gap affects about a dozen tracing::error!(%e, ...) sites in src/daemon.rs, including the sibling trace listener. Every one lands as an undiagnosable bare message.

Changes

  • Promote every alias. message_with_promoted_error now promotes the first non-empty of error, err, e, or source, so all spellings reach the exception value and distinct causes fingerprint separately in error tracking.
  • Name the setup failures. The two control-socket setup steps that propagated bare io errors — stale socket removal and owner-only permissions — now name themselves, matching the already-named bind step. Each real cause becomes its own issue.
Setup step Before After
stale socket removal IO error: <os error> failed removing stale socket <path>: <os error>
bind failed binding control socket: ... unchanged
owner-only permissions IO error: <os error> failed setting owner-only permissions on socket <path>: <os error>

Expected impact

  • Diagnosability only; no behavior change. The failure rate should stay flat.
  • The single bare issue splits into one issue per real cause, which is what tells us whether this is a permissions problem, a stale socket, or something else.

Tests

  • cargo test --lib sentry_layer — 8 pass, including new cases for the e, err, and source aliases and for skipping an empty earlier alias.
  • cargo check --locked, cargo fmt --check, and cargo clippy --lib all clean.

Agent context

  • The inbox report named the repository as autter-dev/autter-runtime, but that is the TypeScript/Node SDK monorepo. The Rust CLI and daemon live in autter-dev/autter-cli, so this fix targets autter-cli.

Created with PostHog Desktop from this inbox report.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants