Skip to content

fix(#266): report telemetry staleness honestly in /send-feedback collector#284

Merged
Lykhoyda merged 2 commits into
mainfrom
fix/266-feedback-telemetry-staleness
Jun 12, 2026
Merged

fix(#266): report telemetry staleness honestly in /send-feedback collector#284
Lykhoyda merged 2 commits into
mainfrom
fix/266-feedback-telemetry-staleness

Conversation

@Lykhoyda

Copy link
Copy Markdown
Owner

Summary

rn-collect-feedback presented telemetry events from 2026-05-31 as "Recent Tool Activity" despite weeks of heavy plugin usage since (GH #266).

Root cause — telemetry capture didn't break, it was removed by design: commit 3beb8e52 (PR #203, closes #200) deleted the Experience Engine including src/experience/telemetry.ts, the per-tool-call writer of ~/.claude/rn-agent/telemetry/*.jsonl. The collector was never updated and kept tailing the orphaned files. Disk evidence matches exactly: newest file is May 31 20:44 — the writer's last day alive.

Fix — collector honesty, not writer resurrection

Re-adding per-call telemetry would silently reverse the #200 architecture decision under cover of a bugfix, so the scope is the consumer:

  • collect-feedback.sh cross-checks the newest event's age. Fresh (0 <= age < 1 day, e.g. a legacy plugin version still writing) → telemetry_status: "ok" + events as before. Otherwise events are omitted and telemetry_status reports stale (last event N day(s) ago — …) or none explicitly — exactly what the issue requested.
  • /send-feedback template renders the status line when no fresh events exist — never an empty or misleading activity table.
  • Empty-telemetry edge no longer emits a bogus [{}] event (the "[]" placeholder passed through the dict filter).

Hardening from the multi-LLM review round (both verdicts SHIP):

  • An empty telemetry dir used to kill the whole collector under set -euo pipefail (unmatched glob → ls fails → zero JSON; verified live). Now degrades to "none".
  • A future mtime (clock skew / fs restore) yielded a negative age that counted as fresh; fresh now requires age >= 0.

Verification

  • TDD throughout: scripts/test/telemetry-staleness.test.sh (10 assertions: stale / none / fresh / empty-dir / future-mtime), each watched fail first; registered as a CI step.
  • Live repro on the reporting machine's real orphaned files: collector now emits stale (last event 11 day(s) ago — …) with 0 events.
  • redact.test.sh (collector security regression) still passes.
  • Changeset bumps rn-dev-agent-plugin only — no cdp-bridge code touched.

Closes #266

🤖 Generated with Claude Code

Lykhoyda and others added 2 commits June 12, 2026 14:59
…ector

Telemetry capture didn't break — it was removed by design: commit
3beb8e5 (PR #203, closes #200) deleted the Experience Engine including
src/experience/telemetry.ts, the per-tool-call writer of
~/.claude/rn-agent/telemetry/*.jsonl. collect-feedback.sh was never
updated and kept tailing the orphaned files, presenting weeks-old
events as "Recent Tool Activity" in filed issues (disk evidence: newest
file 2026-05-31 20:44, the writer's last day alive).

Fix (collector honesty, NOT resurrecting the removed writer):
- collect-feedback.sh cross-checks the newest event's age. <24h →
  telemetry_status "ok" + events as before (legacy versions still
  writing). Otherwise events are omitted and telemetry_status says
  "stale (last event N days ago — ...)" or "none" explicitly.
- Empty-telemetry edge no longer emits a single bogus {} event
  (the "[]" placeholder used to pass through the dict filter).
- send-feedback.md template renders the status line when no fresh
  events exist — never an empty/misleading activity table.
- New end-to-end test scripts/test/telemetry-staleness.test.sh
  (stale / none / fresh), registered in CI.

Verified live: against this machine's real orphaned files the collector
now reports "stale (last event 11 days ago ...)" with 0 events.
redact.test.sh still passes.

Closes #266

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…e — review findings

Multi-LLM review round (both SHIP) surfaced two verified edges:

- Empty telemetry dir (manual cleanup) made the unmatched glob fail
  `ls`, and under `set -euo pipefail` that killed the WHOLE collector —
  /send-feedback got zero JSON (verified live: exit=1, 0 bytes).
  Pre-existing, but same block and same bug family; `|| true` on the
  pipeline degrades it to telemetry_status "none".
- Future file mtime (clock skew, fs restore) yielded a negative age that
  passed `-lt 1` and shipped possibly-stale events as fresh. Fresh now
  requires 0 <= age < 1; negative/unparseable ages report "unknown".
- Test cleanup: trap on parent-scope home vars (array registration from
  $(...) subshells never reached the parent — caught by the run itself);
  "day(s)" grammar.

telemetry-staleness.test.sh: 10/10. redact.test.sh: pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@Lykhoyda Lykhoyda merged commit 0466d15 into main Jun 12, 2026
10 checks passed
@Lykhoyda Lykhoyda deleted the fix/266-feedback-telemetry-staleness branch June 12, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant