Skip to content

Conversation

@michaelneale
Copy link
Collaborator

We are sending a LOT of stuff to posthog which is using it a little hard, this is an attempt (for now) to pare it back a bit to make it more mangeable.

Only the daily session_started event fires (installation_id, model,
provider, os, version). Error events, custom slash command events,
and the generic emit_event API are temporarily disabled with early
returns — all the code is preserved and can be re-enabled by
removing the returns.
@michaelneale michaelneale marked this pull request as ready for review February 9, 2026 01:23
Copilot AI review requested due to automatic review settings February 9, 2026 01:23
@michaelneale michaelneale changed the title chore: strip posthog to daily active user ping only chore: strip posthog for sessions/models/daily only Feb 9, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces PostHog telemetry volume by disabling most event emission paths in the goose core crate, keeping only the session_started event active.

Changes:

  • Short-circuits emit_error_with_context so error events are not sent.
  • Short-circuits emit_custom_slash_command_used so that custom slash command usage is not sent.
  • Short-circuits the generic emit_event API so UI/frontend-triggered events are not sent.

Comment on lines +265 to 269
// Temporarily disabled - only session_started events are sent
return;

#[allow(unreachable_code)]
let installation = load_or_create_installation();
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue here: returning early and then keeping the old implementation behind #[allow(unreachable_code)] makes the codebase harder to maintain; consider deleting the unreachable block or guarding the send behavior via a feature/env/config flag instead.

Copilot uses AI. Check for mistakes.
Comment on lines +545 to +549
// Temporarily disabled - only session_started events are sent
let _ = (event_name, &mut properties);
return Ok(());

#[allow(unreachable_code)]
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This no-op implementation relies on an early return Ok(()) plus an unreachable block; prefer a single explicit gate (feature/env/config) that either skips sending cleanly or compiles out the rest, and avoid borrowing &mut properties solely to satisfy unused_mut/unused-variable warnings.

Suggested change
// Temporarily disabled - only session_started events are sent
let _ = (event_name, &mut properties);
return Ok(());
#[allow(unreachable_code)]

Copilot uses AI. Check for mistakes.
Comment on lines +247 to +251
// Temporarily disabled - only session_started events are sent
let _ = (&error_type, &context);
return;

#[allow(unreachable_code)]
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This early return leaves a permanently unreachable block (suppressed via #[allow(unreachable_code)]), which is easy to forget/rot; prefer removing the dead code or gating it behind an explicit runtime/feature flag (so the implementation is either exercised or not compiled) instead of relying on unreachable code + dummy _ uses.

Copilot uses AI. Check for mistakes.
Comment on lines +247 to +249
// Temporarily disabled - only session_started events are sent
let _ = (&error_type, &context);
return;
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR title/description says “daily active user ping only”, but this change still sends session_started on every session start (not once per day); either update the PR wording or add a daily throttle (e.g., persist last-sent date) to match the intended behavior.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@codefromthecrypt codefromthecrypt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approving as saturated telemetry can be its own problem. in the future we should consider a fake endpoint to see what is sent for a change, but that infra doesn't exist (neither for otel yet), just a consideration

@michaelneale michaelneale added this pull request to the merge queue Feb 9, 2026
Merged via the queue into main with commit a9f4cac Feb 9, 2026
25 checks passed
@michaelneale michaelneale deleted the micn/posthog-tweaks branch February 9, 2026 08:42
jh-block added a commit that referenced this pull request Feb 9, 2026
* origin/main: (54 commits)
  chore: strip posthog for sessions/models/daily only (#7079)
  tidy: clean up old benchmark and add gym (#7081)
  fix: use command.process_group(0) for CLI providers, not just MCP (#7083)
  added build notify (#6891)
  test(mcp): add image tool test and consolidate MCP test fixtures (#7019)
  fix: remove Option from model listing return types, propagate errors (#7074)
  fix: lazy provider creation for goose acp (#7026) (#7066)
  Smoke tests: split compaction test and use debug build (#6984)
  fix(deps): trim bat to resolve RUSTSEC-2024-0320 (#7061)
  feat: expose AGENT_SESSION_ID env var to extension child processes (#7072)
  fix: add XML tool call parsing fallback for Qwen3-coder via Ollama (#6882)
  Remove clippy too_many_lines lint and decompose long functions (#7064)
  refactor: move disable_session_naming into AgentConfig (#7062)
  Add global config switch to disable automatic session naming (#7052)
  docs: add blog post - 8 Things You Didn't Know About Code Mode (#7059)
  fix: ensure animated elements are visible when prefers-reduced-motion is enabled (#7047)
  Show recommended model on failture (#7040)
  feat(ui): add session content search via API (#7050)
  docs: fix img url (#7053)
  Desktop UI for deleting custom providers (#7042)
  ...
tlongwell-block added a commit that referenced this pull request Feb 9, 2026
* origin/main:
  Docs: require auth optional for custom providers (#7098)
  fix: improve text-muted contrast for better readability (#7095)
  Always sync bundled extensions (#7057)
  feat: Add tom (Top Of Mind) platform extension (#7073)
  chore(docs): update GOOSE_SESSION_ID -> AGENT_SESSION_ID (#6669)
  fix(ci): switch from cargo-audit to cargo-deny for advisory scanning (#7032)
  chore(deps): bump @isaacs/brace-expansion from 5.0.0 to 5.0.1 in /evals/open-model-gym/suite (#7085)
  chore(deps): bump @modelcontextprotocol/sdk from 1.25.3 to 1.26.0 in /evals/open-model-gym/mcp-harness (#7086)
  fix: switch to windows msvc (#7080)
  fix: allow unlisted models for CLI providers (#7090)
  Use goose port (#7089)
  chore: strip posthog for sessions/models/daily only (#7079)
  tidy: clean up old benchmark and add gym (#7081)
  fix: use command.process_group(0) for CLI providers, not just MCP (#7083)
  added build notify (#6891)
michaelneale added a commit that referenced this pull request Feb 10, 2026
* main: (125 commits)
  chore: add a new scenario (#7107)
  fix: Goose Desktop missing Calendar and Reminders entitlements (#7100)
  Fix 'Edit In Place' and 'Fork Session' features (#6970)
  Fix: Only send command content to command injection classifier (excluding part of tool call dict) (#7082)
  Docs: require auth optional for custom providers (#7098)
  fix: improve text-muted contrast for better readability (#7095)
  Always sync bundled extensions (#7057)
  feat: Add tom (Top Of Mind) platform extension (#7073)
  chore(docs): update GOOSE_SESSION_ID -> AGENT_SESSION_ID (#6669)
  fix(ci): switch from cargo-audit to cargo-deny for advisory scanning (#7032)
  chore(deps): bump @isaacs/brace-expansion from 5.0.0 to 5.0.1 in /evals/open-model-gym/suite (#7085)
  chore(deps): bump @modelcontextprotocol/sdk from 1.25.3 to 1.26.0 in /evals/open-model-gym/mcp-harness (#7086)
  fix: switch to windows msvc (#7080)
  fix: allow unlisted models for CLI providers (#7090)
  Use goose port (#7089)
  chore: strip posthog for sessions/models/daily only (#7079)
  tidy: clean up old benchmark and add gym (#7081)
  fix: use command.process_group(0) for CLI providers, not just MCP (#7083)
  added build notify (#6891)
  test(mcp): add image tool test and consolidate MCP test fixtures (#7019)
  ...
lifeizhou-ap added a commit that referenced this pull request Feb 11, 2026
* main: (85 commits)
  Fix 'Edit In Place' and 'Fork Session' features (#6970)
  Fix: Only send command content to command injection classifier (excluding part of tool call dict) (#7082)
  Docs: require auth optional for custom providers (#7098)
  fix: improve text-muted contrast for better readability (#7095)
  Always sync bundled extensions (#7057)
  feat: Add tom (Top Of Mind) platform extension (#7073)
  chore(docs): update GOOSE_SESSION_ID -> AGENT_SESSION_ID (#6669)
  fix(ci): switch from cargo-audit to cargo-deny for advisory scanning (#7032)
  chore(deps): bump @isaacs/brace-expansion from 5.0.0 to 5.0.1 in /evals/open-model-gym/suite (#7085)
  chore(deps): bump @modelcontextprotocol/sdk from 1.25.3 to 1.26.0 in /evals/open-model-gym/mcp-harness (#7086)
  fix: switch to windows msvc (#7080)
  fix: allow unlisted models for CLI providers (#7090)
  Use goose port (#7089)
  chore: strip posthog for sessions/models/daily only (#7079)
  tidy: clean up old benchmark and add gym (#7081)
  fix: use command.process_group(0) for CLI providers, not just MCP (#7083)
  added build notify (#6891)
  test(mcp): add image tool test and consolidate MCP test fixtures (#7019)
  fix: remove Option from model listing return types, propagate errors (#7074)
  fix: lazy provider creation for goose acp (#7026) (#7066)
  ...
Tyler-Hardin pushed a commit to Tyler-Hardin/goose that referenced this pull request Feb 11, 2026
Tyler-Hardin pushed a commit to Tyler-Hardin/goose that referenced this pull request Feb 11, 2026
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.

2 participants