fix(#266): report telemetry staleness honestly in /send-feedback collector#284
Merged
Conversation
…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>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Summary
rn-collect-feedbackpresented 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 includingsrc/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.shcross-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 andtelemetry_statusreportsstale (last event N day(s) ago — …)ornoneexplicitly — exactly what the issue requested./send-feedbacktemplate renders the status line when no fresh events exist — never an empty or misleading activity table.[{}]event (the"[]"placeholder passed through the dict filter).Hardening from the multi-LLM review round (both verdicts SHIP):
set -euo pipefail(unmatched glob →lsfails → zero JSON; verified live). Now degrades to"none".age >= 0.Verification
scripts/test/telemetry-staleness.test.sh(10 assertions: stale / none / fresh / empty-dir / future-mtime), each watched fail first; registered as a CI step.stale (last event 11 day(s) ago — …)with 0 events.redact.test.sh(collector security regression) still passes.rn-dev-agent-pluginonly — no cdp-bridge code touched.Closes #266
🤖 Generated with Claude Code