Plugin telemetry: routing funnel, discovery link, MCP headers (GRO-305) - #11
Conversation
|
@BugBot review |
1 similar comment
|
@BugBot review |
|
@BugBot review |
cc2b089 to
349a978
Compare
349a978 to
b93b696
Compare
|
@BugBot review |
b93b696 to
a265175
Compare
|
@BugBot review |
df8480d to
5640e06
Compare
Add gateway-auth guardrails across try-arcade, arcade-operator, routing guidance, and the Cursor rule, plus a beforeSubmitPrompt hook so Cursor gets the same per-turn reminder Claude already has. Co-authored-by: Cursor <cursoragent@cursor.com>
SESSION_CONTEXT is injected into both Cursor and Claude SessionStart hooks; referring to Cursor only sent Claude users to the wrong place. Co-authored-by: Cursor <cursoragent@cursor.com>
Cursor's beforeSubmitPrompt only allows or blocks prompts; additional_context is ignored. Per-turn needsAuth guidance stays on the always-apply arcade rule. Co-authored-by: Cursor <cursoragent@cursor.com>
Rebase onto GRO-353 so SUBAGENT_CONTEXT includes the same no-substitute auth block as session and prompt guidance, keeping CI marker checks green. Co-authored-by: Cursor <cursoragent@cursor.com>
75f74a6 to
ad43a97
Compare
Supplemental funnel events post to PostHog via p.arcade.dev with per-machine install_id correlation, opt-out via ARCADE_PLUGIN_TELEMETRY=0, and no prompt text in payloads. Co-authored-by: Cursor <cursoragent@cursor.com>
Stacks on the Codex adapter work so SubagentStart emits the same supplemental funnel events as other lifecycle hooks. Co-authored-by: Cursor <cursoragent@cursor.com>
Wire resolvePosthogIngestHost through the detached capture script so the documented ingest override applies to actual event delivery. Co-authored-by: Cursor <cursoragent@cursor.com>
…nts. Rebased onto GRO-353 contract stack. Adds routing_context_emitted, routing_skipped_bare_continuation, hook_error, and post-arcade-tool MCP telemetry wired for Claude (PostToolUse/PostToolUseFailure) and Cursor (afterMCPExecution/postToolUseFailure). Codex post-tool hooks skipped: shared hooks/hooks.json is loaded by Codex and has no confirmed PostToolUse surface in the com.openai extension manifest. Co-authored-by: Cursor <cursoragent@cursor.com>
Record sanitized hook failures under ~/.arcade-plugin/self-reports/ with zero egress, independent of ARCADE_PLUGIN_TELEMETRY opt-out. Rebase onto GRO-353 hook manifest inventory hashing. Co-authored-by: Cursor <cursoragent@cursor.com>
Move PostToolUse telemetry to clients/claude/hooks/hooks.json and wire both hook paths from .claude-plugin/plugin.json so Codex no longer registers undocumented post-tool handlers from hooks/hooks.json. Co-authored-by: Cursor <cursoragent@cursor.com>
Same cross-host maintainer doc as GRO-353; includes Claude post-tool manifest split from the telemetry stack. Co-authored-by: Cursor <cursoragent@cursor.com>
Document plugin_version on every capture, fix Codex hook manifest split wording, and update the support matrix for Claude post-tool adapters. Co-authored-by: Cursor <cursoragent@cursor.com>
0232f29 to
57525c0
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 57525c0. Configure here.
| "hooks": [ | ||
| "./hooks/hooks.json", | ||
| "./clients/claude/hooks/hooks.json" | ||
| ] |
There was a problem hiding this comment.
Claude hooks may fire twice
Medium Severity
.claude-plugin/plugin.json now lists ./hooks/hooks.json plus the Claude-only post-tool file. Claude Code already auto-discovers hooks/hooks.json, and custom hook paths supplement that default rather than replacing it. SessionStart and UserPromptSubmit can therefore run twice, injecting duplicate routing context and double-counting telemetry.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 57525c0. Configure here.
Document which hosts consume root extensions.* (Codex only today), why sidecars remain for Cursor and Claude, and how we verified that with host docs plus local claude validate and cursor agent probes. Co-authored-by: Cursor <cursoragent@cursor.com>
| error_class: errorClassFrom(error), | ||
| }, | ||
| }); | ||
| }; |
There was a problem hiding this comment.
Can we make this opt-out instead? Telemetry should be enabled by default and disabled only with an explicit ARCADE_PLUGIN_TELEMETRY=0 (or equivalent) setting. Please update the docs and tests to match.
| } | ||
| ], | ||
| "SubagentStart": [ | ||
| { |
There was a problem hiding this comment.
Can you please audit the hook/event coverage across all supported clients? Several telemetry signals are currently wired for only one client even though comparable events appear to exist elsewhere (for example, Codex supports PostToolUse for MCP calls). Please add the appropriate cross-client coverage where supported, and update the implementation, documentation, and tests to match. Where parity is not possible, document the host-specific limitation explicitly.
There was a problem hiding this comment.
Done in 97b8c1c. Wired Codex PostToolUse / PostToolUseFailure in com.openai/hooks/hooks.json, added the cross-host coverage table in ARCHITECTURE, and documented Cursor's MCP-specific hook names in support-matrix.
Default hook telemetry on with ARCADE_PLUGIN_TELEMETRY=0 opt-out, wire PostToolUse telemetry for Codex, and document cross-host hook coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
Inspect hook payloads for error shapes instead of trusting success-hook argv alone on afterMCPExecution and PostToolUse paths. Co-authored-by: Cursor <cursoragent@cursor.com>
Shrink hooks to routing funnel and SelectTools query_id links, add static MCP headers for gateway attribution, and document the monorepo follow-up spec. Co-authored-by: Cursor <cursoragent@cursor.com>


Linear: https://linear.app/arcadedev/issue/GRO-305/evaluate-optional-plugin-side-telemetry-via-hooks
Summary
Adds a small plugin telemetry stream and a correlation bridge to authenticated gateway usage:
The bridge is intentionally partial. It applies when
Arcade_SelectToolssuccessfully returns aquery_id.What this PR adds
Plugin discovery linkedafter a successful SelectTools call when its result contains a validquery_id.result_jsonand the MCPstructuredContentand JSON text-content envelopes used by Claude Code and Codex.Arcade-Plugin: arcadeandArcade-Plugin-Versionheaders in generated MCP manifests.ARCADE_PLUGIN_TELEMETRY=0opt-out.Failure hooks are intentionally omitted: a failed tool call does not return the
query_idneeded for the correlation bridge, and Codex does not expose aPostToolUseFailureevent.Hook events use a hashed host session and do not send prompt text, tool arguments, tool results, paths, tokens, emails, or error messages. Events without a host session ID are skipped.
Correlation contract
host_session_hashquery_idprincipalIdplugin_source; SelectTools will carryquery_idplugin_versionis useful for debugging but is not required for correlation or dashboards. Plugin headers are client-declared analytics metadata, never authorization.Follow-up
The monorepo change described in
docs/research/gateway-telemetry-followup.mdwill:Arcade-Pluginasplugin_sourceon Usage events and preserveplugin_versionwhen present.query_idto the principal-attributedMCP tool recommendation queriedUsage event on both stateful and stateless paths.Then run one real SelectTools call in Cursor, Claude Code, and Codex to confirm the headers and result envelopes survive installation and authentication.
Limits
query_idcan be absent, so some conversations will not be cross-referenceable.plugin_sourcestill attributes their gateway usage.Canonical design:
docs/research/telemetry-design.mdValidation
npm run verify— 68 tests plus manifest generation, schema validation, plugin discovery, and Claude validation