Repository navigation
Send anonymous usage data from the aiden serve process - #733
Conversation
The headless server gets its own consent file and install ID, a one-time notice at service install and the first terminal serve, aiden telemetry status|on|off, server_started, shared events through the reporter seam, and capped crash reports. Only the serve process sends; admin commands send nothing and never load the client. Only npm run cli:dist carries the key, through a manual workflow, so clone builds and Docker stay silent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Redaction passes relative file names, hostnames and quoted prompt text, so the server's crash reports now carry only the type, frames and a Node error code. A failure during the stop now holds the exit until its report ends, so a crash can no longer exit 0. CI set to an empty value also counts as set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A file that cannot be read may have held an opt-out, so it no longer reads as the default. The consent gate answers locally rather than failing, so turning usage data off leaves no SDK stack trace in the server log. The keyed bundle workflow now loads the client chunk, and a failed start has its own test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Caution
The server analytics state can overwrite a completed opt-out and resume sending, so the consent boundary must be fixed before a keyed package is distributed. The new SDK also conflicts with part of the CLI's advertised Node range.
Reviewed changes across all three commits, covering the server analytics lifecycle, distribution path, privacy controls, crash behavior, and tests.
- Distribution and loading — Adds a manual keyed Linux bundle workflow, build-time key injection, lazy PostHog loading, and keyless local and Docker builds.
- Consent and lifecycle — Adds the server-specific state file, one-time notice,
telemetry status|on|off, environment gates, and foreground, daemon, and service launch reporting. - Events and crashes — Adds
server_started, a host-neutral reporter seam, message-free sanitized server exceptions, daily crash limits, and bounded flush behavior. - Contracts and coverage — Updates repository, analytics, CLI, and plan documentation and adds focused unit, bundle, real-process, and service tests.
@v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏
Every change to the server's consent file and each request's consent check now hold one cross-process lock, so a server starting up can't write back enabled state after `aiden telemetry off`, and no new request starts once it returns. Raise the Node floor to 22.22 to match posthog-node. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Important
The ordinary activation and request-admission races are fixed, but stale-lock reclamation still permits a completed opt-out to be overwritten by a live paused process.
Reviewed changes since the prior Pullfrog review, covering the new cross-process consent boundary and runtime compatibility updates.
- Serialized consent transitions — Added a shared
proper-lockfilecritical section around consent mutations and normal PostHog request admission. - Added concurrency coverage — Added real-process activation versus opt-out coverage, stale-lock recovery coverage, and a keyed request-admission assertion.
- Aligned runtime support — Raised the root and CLI Node floor to 22.22 and updated the affected documentation to match
posthog-node@5.56.1.
@v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏
A timed lock could be taken from a live process that was stopped between its read and its write, which could then undo a finished opt-out. The flock helper the server already uses is released only by the holder or its death, so `aiden telemetry off` now fails with an error rather than take the lock from a stuck process. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes since the prior Pullfrog review, focusing on the consent-lock replacement in e62ef96e0.
- Replaced timeout-based ownership — Switched consent mutations and request admission to the repository's OS-held process-lifetime lock, so a live paused holder cannot be displaced and a dead holder releases automatically.
- Made contention fail explicitly — Changed
telemetry on|offto report lock contention after a bounded wait while normal server sending continues to fail closed quickly. - Added real-process coverage — Added deterministic paused-holder and killed-holder tests and updated the privacy documentation for the new contention behavior.
@v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏
…8bfa4e # Conflicts: # AGENTS.md # README.md # docs/analytics.md # docs/plans/README.md # docs/plans/posthog-product-analytics-plan.md
#732 keeps a message only if it is a runtime's own sentence, so the bare code the server sends in the message field came out as "[message withheld]". The sanitizer now sees no message, and each error's checked code goes back afterwards through captureSanitizedException. The shared allowlist is unchanged, so what the desktop keeps is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Important
The server's documented Node error code still does not reach PostHog because the final outgoing guard strips it.
Reviewed changes since the prior Pullfrog review, covering the sanitizer integration added after #732 merged.
- Adapted server crash capture — Sanitized message-free server exception chains first, then restored checked Node error codes onto the corresponding sanitized errors.
- Expanded cause coverage — Added a nested-cause assertion intended to prove each error keeps only its own code while private messages remain absent.
- Synced merged analytics policy — Updated repository and product documentation to distinguish the desktop message allowlist from the server's narrower crash payload and recorded #732 as merged.
- Merged current
main— Incorporated three base updates around the functional sanitizer adaptation without changing the remaining server analytics architecture.
@v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏
The final guard re-parses every exception and withheld the bare code the server sends, so a keyed server never delivered it. The guard now keeps a code from the sanitizer's fixed errno lists on a server's report only; desktop reports are unchanged. The server drops any other code, and the crash test now reads what the guard lets through. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes since the prior Pullfrog review, focusing on the final outgoing validation fix in 38400d875.
- Preserved server system codes — Allowed fixed filesystem and network error codes to survive the final PostHog guard only for
source: "server"exception reports. - Kept desktop behavior unchanged — Continued applying normal message redaction to bare codes from
mainandrendererreports. - Strengthened boundary coverage — Exercised
validateOutgoingEventfrom both shared-core and CLI crash tests, including arbitrary codes, lookalikes, and nested causes, and aligned the privacy documentation with the narrower allowlist.
@v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏
…8bfa4e # Conflicts: # README.md # docs/analytics.md # docs/plans/README.md # docs/plans/posthog-product-analytics-plan.md
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes since the prior Pullfrog review at 38400d875, covering the merge of current main and its interaction with the server analytics implementation.
- Merged shared feature reporting — Incorporated #734's host-neutral analytics reporter and service-level event hooks, allowing the keyed server to receive shared feature events while retaining the documented daemon-chat gap.
- Reconciled analytics documentation — Resolved merge conflicts across the README, analytics reference, and plan inventory so feature events and headless-server behavior are described together.
- Preserved server guarantees — Re-read the full server diff and verified the merge with 158 shared analytics tests, a clean CLI bundle build, and all 45 focused CLI analytics tests.
@v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes since the prior Pullfrog review at 787446ddb, covering the merge of current main and its interaction with the server analytics implementation.
- Merged current
main— Incorporated Linux Electron E2E sharding and held-browser credential-field rescan fixes from the base branch. - Preserved analytics behavior — Confirmed the merge introduced no server-analytics conflict resolutions, contract changes, or changes to the PR’s final 32-file diff.
- Revalidated prior fixes — Confirmed the Node engine floor, cross-process consent lock, and final server error-code validation remain intact, with all earlier Pullfrog threads resolved.
@v0 or keep the SHA fresh with Dependabot | Fix it ➔ | View workflow run | Using GPT Sol | 𝕏
…8bfa4e Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # docs/plans/README.md # docs/plans/posthog-product-analytics-plan.md
A server report withholds the message but passed the raw stack on, and a stack opens with the message. Lines of a multi-line message that looked like frames were parsed as frames, and one naming a bundle path sent its text as a function name. Strip the message from the stack before it is dropped, as the desktop's sanitizer does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Caution
A stale Error stack can still send message-derived free text as a frame, violating the server's privacy contract.
Reviewed changes since the prior Pullfrog review at 6410ec5e6, covering the new server stack-message sanitization and the two merges of current main.
- Stripped stack messages — Removed an error's matched current message from its raw stack before constructing the server's message-free exception copy.
- Added multiline-message coverage — Added an error-and-cause test proving unchanged multiline messages cannot pose as in-bundle frames.
- Merged current
main— Carried forward the analytics-plan release-acceptance status and current base changes without altering the remaining server analytics architecture.
@v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏
V8 writes a stack's header once. If the message changes afterwards, the old message's lines stay in the stack, and removing the current message leaves them to pose as frames, one naming a bundle path keeping its text as a function name. Read frames only from a stack whose header is a name and the current message, ending at the line end. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Caution
The stale-stack privacy leak remains reachable when the current message is empty.
Reviewed changes since the prior Pullfrog review at 094ea8953, covering the new server-specific stack-header parser and its mutation coverage.
- Hardened stack parsing — Replaced shared message stripping with
stackBelowHeader, which keeps frames only behind a syntactically valid V8 header containing the current message. - Expanded mutation coverage — Added replaced, cleared, shortened, coded, unnamed, and nested-cause cases for stacks materialized before message mutation.
- Documented fail-closed behavior — Updated analytics policy and project memory to describe when stale stacks lose their frames and the known indistinguishable shortened-message case.
@v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏
A message opening on a new line leaves `Error: ` as the stack's first line, and its old lines below. Clearing the message then made that header pass, so those lines were read as frames. An empty message now needs the name alone, and a message needs a name before it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes since the prior Pullfrog review at a404d1ece, focusing on the final stale-stack privacy fix in 16e4eacf7.
- Tightened empty-message stack parsing — Required a colon-free V8 header when the current message is empty, while retaining the exact
name: messageform for non-empty messages. - Added production-path regression coverage — Added the newline-leading stale-message case that previously exposed an in-bundle function name and now verifies that no frames survive.
- Aligned the privacy record — Updated project memory to document the exact header distinction and retained fail-closed behavior for changed messages.
@v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏
…8bfa4e Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # packages/cli/package.json
Brings in #709, #715, #733 and #778. #778 retired Design Studio, so the hook gates lose their `design` field and hooks now apply to design mode, which runs in regular chats. Feature-owned chats stay out of manual PreCompact through the compaction service's own early return. Also lists the hooks skill only where the hooks tool is offered, by removing it from the Remote skill catalog, and says plainly in the docs that nothing sandboxes run_command, and that Full access shows no card. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

PR 5 of the PostHog plan: anonymous usage and crash data from the
aiden serveprocess. It is dormant when merged. Clone builds and the Docker image have no key, so nothing is sent and no notice appears until a keyed package is distributed.Before any keyed server package reaches anyone (owner steps)
src/components/LegalPage.tsxinaiden-websitesays "the desktop app" sends analytics, that it turns off "in Settings", and that the notice appears during onboarding. It doesn't cover the server oraiden telemetry off. I did not edit it..github/workflows/server-bundle.yml, manual,mainonly). It uses thereleaseenvironment and needsAIDEN_POSTHOG_PROJECT_KEYto be available to it. It fails if the key is missing.aiden-server-keyed-linux-x64. It is Linux x64 only, because the bundle carries native helpers for its build host. A macOS or arm64 package needs a build on that platform.What it does
aiden servesends. Admin commands send nothing, show no notice and never load the analytics core or client. The exceptions are the notice ataiden service installandaiden telemetry.server_startedreplaces the briefedcli_started, with one property,launch:foreground,daemonorservice. It goes out once the server is ready, so a failed start isn't counted.surface, exceptionsourceandprocess_typeare nowserver.<agentDir>/aiden-analytics.jsonwith its own install ID, never Pi'ssettings.json.aiden telemetry status|on|offis the switch, in its own file so it survives if other admin commands go.aiden service installand the firstaiden serveon a terminal. A server that never showed it sends nothing. WithCIset nothing is ever sent.DO_NOT_TRACK=1andAIDEN_ANALYTICS=0work as on desktop.telemetry offsaves first, sends oneanalytics_disabledunder the old ID and forgets the ID. A running server re-reads the file before every event and request, so it stops too.npm run cli:dist.analytics-report.tsis added as briefed, and no hooks were added to shared services.Differences from the brief
~/paths, hostnames and quoted prompt text, whichAGENTS.mdforbids. The server sends only the error type, sanitized frames and a Node error code such asENOENT. The desktop's shared sanitizer is unchanged, so PR 4 still sends redacted messages and its owner should decide whether to do the same.process_typewas renamed as well assource, for consistency, inanalytics-events.ts.aiden telemetry onreplaces it.After merging #732
#732 keeps a message only if it is a runtime's own sentence, so the bare error code the server sends (
EACCES) came out as[message withheld]. The server passes the sanitizer an empty message and puts each error's code back afterwards throughcaptureSanitizedException. A server error type outside that list is now sent asError, as on the desktop.The final guard re-parses every exception, so that alone was not enough: Pullfrog found the code was still withheld at the real transport, after the point the fake transport in the test observed. This needed a narrow change to the shared sanitizer,
main/services/analytics/analytics-sanitize.ts, and tovalidExceptionListinanalytics-core.ts:parseSanitizedErrortakesallowSystemErrorCode, passed only when the report'ssourceisserver. Desktop reports (main,renderer) parse exactly as before, so what the desktop keeps does not change.FILE_SYSTEM_ERRORS,NETWORK_ERROR), not a pattern. Anything else stays withheld.ERR_INVALID_ARG_TYPE, are no longer sent. The type and frames still identify those failures.Known limits
stackWithoutMessagestill returns an unmatched stack whole, so a changed message can leave the same stale lines there. This PR doesn't change it, because the sanitizer must stay narrow here.chat_message_sentyet.docs/analytics.mdsays so.app_active:server_startedand real actions are the server's activity signal.DO_NOT_TRACKfrom a shell, becausefileProfilerejects extraEnvironment=lines. The docs point service users toaiden telemetry off.offthenonuntil it restarts, because its ID is gone.aiden telemetryis running.telemetry on|offwaits 2 s, then reports an error and changes nothing if a live process still holds the lock. The lock is theaiden-lease-flockOS lock, so a process that dies releases it and a paused one keeps it.packages/cliand the root, to matchposthog-node5.56.1 (^20.20.0 || >=22.22.0). The root is included because the server is built from a clone with a rootnpm ci.a paused Bot stops its running turn, refuses new ones and runs again once unpaused(packages/cli/tests/parity.test.mjs) failed once in a full local CLI run on this branch, then passed three times alone and in the next full run. One earlier full run had one failure I did not identify by name. No CI run link: it has not failed in CI.tests/e2e/guided-setup.spec.ts:239(Model Freedom renders platform-accurate providers and classifier disclosures on linux) failed once in Electron E2E (1/3) onedb6d46f2withelectronApplication.evaluate: Resulting promise was garbage collectedat its firstaiden.app.evaluate, then passed on retry, so--fail-on-flaky-testsfailed the job. This PR changes no onboarding or Electron code. Run. Rerun once.tests/e2e/chat-top-bar.spec.ts:104(a Git repository adds branch, GitHub, and Changes) failed once in Electron E2E (2/3) withelectronApplication.evaluate: Resulting promise was garbage collectedat itsaiden.app.evaluateon line 117, then passed on retry. Run. The one allowed rerun is used, so this head has no green run yet. The same error is recorded on Replace thinking orbs with SVG activity marks (desktop, iOS, Android) #386, MCP 11/12: Keep custom MCP secrets in the keychain and approve outside-added commands #470, Keep each chat's model to that chat #602, Keyboard control wave 2: F6 areas, sidebar arrows, Bot keys, ↑ to resend, ⌘F #641, Bring back questions and approvals after a quit or crash #645, Draw Aiden's own title bar and window controls on Linux #691, Keep locally owned chats accessible when a UUID trips the child privacy filter #718 and Report a subagent shell stopped only once its work has settled #756.a Tailscale command still running at the deadline is killed, so the CLI leaves nothing behind(packages/cli/tests/reachability.test.mjs) failed once in a full local CLI run, then passed three times alone and in the next full run. This PR doesn't touch that file. No CI run link: it has not failed in CI.AidenChatTests.testForegroundProbeFindsRunsWithoutTheRosterAndStopsInTheBackgroundfailed once iniOS build and simulator testson787446ddbwithTimed out waiting for live foreign output(job). This PR changes nothing underios/,android/orprotocol/, and the test runs on a fake URL protocol with a 5-second wait. A local repeat could not run: the Mac had no disk space, so the test never started. That leaves the flake diagnosis unconfirmed by a repeat.Electron E2E (1/3)on the same head passed all 120 tests in 18.7 minutes, then hit the 20-minute job limit during cleanup and was cancelled (job). The shard has little headroom on a slow macOS runner.os_majoris the kernel major on the server.5d50d54ca,Electron E2E (2/4)was cancelled by its 20-minutetimeout-minutesat test 68 of 74, intests/e2e/settings-unification.spec.ts, with no failed test. Specs on that runner took about 1.2x to 1.9x theirFILE_SECONDSweights, and the other three shards finished in 7 to 11 minutes. That head's one rerun was a whole-run rerun of run 42144900614. The timeout was not raised.Testing
packages/clisuite: 224 passed, 3 skipped, 0 failed, including the newtests/analytics.test.mjs(realaiden servefor each launch, a failed start, admin commands loading no analytics code,telemetryend to end, and a real crash under the flush cap).test:ci-policy73,test:analytics92,analytics-build-config4,test:agents-instructions22, all passing.lint, roottype-checkandpackages/clitscare clean.fetch, so nothing reached PostHog: a server with no notice sent nothing; aftertelemetry on,server_startedwent tohttps://us.i.posthog.com/batch/withredirect: error; admin commands sent nothing;telemetry offsent oneanalytics_disabled; the nextservesent nothing. The fake key isn't indistor the repo.Two Opus 5.5 reviews ran one after the other, and their fixes are in the second and third commits. The crash-during-stop test was checked by removing the fix and watching it fail.
🤖 Generated with Claude Code