fix(telemetry): report every Paperclip runner harness as its own adapter_type (#22637)

## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - The server sends `agent.task_run` and `agent.task_completed`
telemetry. Each event has an `adapter_type` dimension with a fixed enum
in the generated telemetry contract.
> - #22324 made a Paperclip runner agent report its underlying harness
as `adapter_type`.
> - Seven harnesses that the runner can resolve to are not in the enum:
Copilot, Antigravity, AWS AgentCore, Claude Managed, Grok Bot, Muse and
OpenAI Dot. Delivery normalizes them to `other`, on open source and on
Cloud.
> - Thus, the adapter breakdown in analytics still has an `other` bucket
that no build can fix.
> - This pull request syncs the telemetry contract, which now lists the
seven harnesses, and sends Copilot as `copilot_runtime`.
> - The benefit is that every runner harness has its own `adapter_type`
value in analytics.

## Linked Issues or Issue Description

Refs #22324

**What happened?**
A Paperclip runner agent that uses Copilot, Antigravity, AWS AgentCore,
Claude Managed, Grok Bot, Muse or OpenAI Dot sends an `adapter_type`
value that is not in the generated contract enum. The value is
normalized to `other`. Copilot also sends `acpx:copilot`, which is not a
contract-style name.

**Expected behavior**
Each runner harness reports its own `adapter_type` value. Copilot
reports `copilot_runtime`, which is the name
`agentRuntimeSettingsHarness()` already uses.

**Steps to reproduce**
1. Create a Paperclip runner agent with `provider: "acpx"` and
`acpxAgent: "antigravity"` (or `"copilot"`).
2. Let the agent finish a run.
3. Look at the `agent.task_run` event. `adapter_type` is `other`.

**Paperclip version or commit**
`master` at 30881e6aa9.

## What Changed

- `packages/shared/src/telemetry/generated/paperclip-telemetry.ts`: sync
the generated contract. The `adapter_type` enum on `agent.task_run` and
`agent.task_completed` now lists `antigravity_runtime`,
`copilot_runtime`, `aws_agentcore`, `claude_managed`, `grok_bot`, `muse`
and `openai_dot`. The source schema changed in the telemetry backend
first, and the collector accepts these values once that change deploys.
- `server/src/services/agent-task-run-telemetry.ts`:
`telemetryAdapterType()` sends `copilot_runtime` for the `acpx:copilot`
harness. All other values are unchanged.
- `server/src/__tests__/agent-task-run-telemetry.test.ts`: the coverage
test now expects no runner harness to be missing from the contract.
Added Copilot and Antigravity cases to the runner `adapterType` table.
- `packages/shared/src/telemetry/README.md`: replace the list of known
gaps with the Copilot rename and the steps to add a new harness.
- `tests/runner-e2e/source-sdk-public-inputs.json`: refresh the pinned
inputs for the two changed shared files.
- Cloud direct delivery fixtures were regenerated with
`scripts/generate-posthog-direct-fixtures.mjs` from the updated backend.
No fixture changed.

## Verification

- Red/green: before the fix, 3 tests failed (`expected 'acpx:copilot' to
be 'copilot_runtime'`, and seven harnesses missing from both event
contracts). After the fix, `agent-task-run-telemetry.test.ts` passes
52/52.
- `npx vitest run server/src/__tests__/agent-task-run-telemetry.test.ts
server/src/__tests__/posthog-direct-telemetry.test.ts
packages/shared/src/telemetry`: 117 passed.
- `pnpm --filter @paperclipai/shared typecheck` and `pnpm --filter
@paperclipai/server typecheck`: pass.
- `pnpm verify` asked for broader coverage (exit 2) because the pinned
runner-e2e inputs changed. Required CI supplies that coverage.

## Risks

- Low risk. The change only adds enum values and renames one value that
delivery already dropped to `other`. Older collectors still accept the
events and normalize unknown values to `other`, so nothing is
quarantined while the backend deploys.
- Analytics: `copilot_runtime` replaces `other` for Copilot runner
agents. No dashboard filters on `acpx:copilot`, because that value never
reached analytics.

## Privacy Review

This is a Telemetry change under `rules/data-paths.mdc`. I request a
privacy review.

- Data added: seven new allowed values for the existing `adapter_type`
enum dimension on `agent.task_run` and `agent.task_completed`. They are
fixed harness names chosen by Paperclip code: `antigravity_runtime`,
`copilot_runtime`, `aws_agentcore`, `claude_managed`, `grok_bot`,
`muse`, `openai_dot`.
- No new field. No free text, user content, identifier, credential, URL
or host is added. The schema classification stays `non_personal`.
- These values were already sent from the app. Before this change the
receiving layer normalized them to `other`. After this change it keeps
the harness name.
- The generated contract and `packages/shared/src/telemetry/README.md`
are updated in this pull request.

## Model Used

Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, with tool use
(shell, file edits, PostHog HogQL queries).

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DottaandClaude Opus 5.5 authored and GitHub committed 2026-11-23 09:32:42 -06:00
1 parent 8f20961d20
commit 06d488b430
7 files changed
+67 -28

No files matched your search

+8 -4
View File
@@ -65,10 +65,14 @@ export function agentRunner(adapterType: string): AgentRunner {
return adapterType === "paperclip_runner" ? "paperclip" : "legacy";
}
/** Product name of the harness an agent runs; reported as telemetry `adapter_type`. */
export function agentHarnessName(adapterType: string, config: Record<string, unknown> = {}): string {
const harness = agentHarnessType(adapterType, config);
return harness === "acpx:copilot" ? "copilot_runtime" : harness;
}
/** Stable configuration group across native and legacy execution backends. */
export function agentRuntimeSettingsHarness(adapterType: string, config: Record<string, unknown> = {}): string {
const harness = agentHarnessType(adapterType, config);
if (harness === "acpx:copilot") return "copilot_runtime";
if (harness === "cursor") return "cursor_local";
return harness;
const harness = agentHarnessName(adapterType, config);
return harness === "cursor" ? "cursor_local" : harness;
}
+1 -1
View File
@@ -3095,7 +3095,7 @@ export {
type AntigravityThinkingLevel,
} from "./antigravity-models.js";
export { ANTIGRAVITY_GENERATED_MODEL_CATALOG } from "./antigravity-models.generated.js";
export { agentHarnessType, agentRuntimeSettingsHarness, agentRunner, paperclipRunnerCreationLifecycle, paperclipRunnerProfileForHarness, paperclipRunnerSupportsPlatform, PAPERCLIP_RUNNER_MINIMUM_GLIBC_VERSION, type AgentRunnerChoice, type AgentRunner, type AgentRunnerAvailability } from "./agent-runner.js";
export { agentHarnessName, agentHarnessType, agentRuntimeSettingsHarness, agentRunner, paperclipRunnerCreationLifecycle, paperclipRunnerProfileForHarness, paperclipRunnerSupportsPlatform, PAPERCLIP_RUNNER_MINIMUM_GLIBC_VERSION, type AgentRunnerChoice, type AgentRunner, type AgentRunnerAvailability } from "./agent-runner.js";
export { normalizeClaudeRunnerOptions, type AgentConfigurationWarning } from "./runner-configuration-warnings.js";
export { EXTERNAL_AGENT_TOOL_GUIDANCE, DOT_AGENT_TOOL_GUIDANCE, GROK_BOT_AGENT_TOOL_GUIDANCE } from "./external-agent-guidance.js";
+6 -6
View File
@@ -140,13 +140,13 @@ test fails when a code in those sets has no telemetry code.
The `adapter_type` dimension on `agent.task_run` and `agent.task_completed`
reports the harness the agent runs, as `agentHarnessType()` resolves it. A
Paperclip runner agent therefore reports its underlying harness (for example
`claude_local` or `codex_local`), not `paperclip_runner`. Some runner harnesses
are not in the generated `adapter_type` enum yet: `acpx:copilot`,
`antigravity_runtime`, `aws_agentcore`, `claude_managed`, `grok_bot`, `muse`,
and `openai_dot`. The receiving layer reports them as `other` until the
contract lists them. A test in
`claude_local` or `codex_local`), not `paperclip_runner`. The one rename is the
Copilot harness: `agentHarnessType()` returns `acpx:copilot`, and telemetry
sends `copilot_runtime`, the name `agentRuntimeSettingsHarness()` also uses.
Every runner harness is in the generated `adapter_type` enum. A test in
`server/src/__tests__/agent-task-run-telemetry.test.ts` fails when a runner
harness that is not in this list is missing from the contract.
harness is missing from the contract. Add it to the telemetry-backend schema
first, then copy the regenerated contract here.
## Product Lifecycle Events
@@ -11,7 +11,7 @@ agent_role: ("ceo" | "cto" | "cmo" | "cfo" | "security" | "engineer" | "designer
}
export interface PaperclipAgentTaskCompletedDimensions {
adapter_type: ("process" | "http" | "acpx_local" | "claude_local" | "codex_local" | "cursor_cloud" | "gemini_local" | "hermes_gateway" | "hermes_local" | "opencode_local" | "pi_local" | "cursor" | "openclaw_gateway" | "grok_local" | "kimi_local" | "other")
adapter_type: ("process" | "http" | "acpx_local" | "claude_local" | "codex_local" | "cursor_cloud" | "gemini_local" | "hermes_gateway" | "hermes_local" | "opencode_local" | "pi_local" | "cursor" | "openclaw_gateway" | "grok_local" | "kimi_local" | "antigravity_runtime" | "copilot_runtime" | "aws_agentcore" | "claude_managed" | "grok_bot" | "muse" | "openai_dot" | "other")
agent_id: string
agent_role: ("ceo" | "cto" | "cmo" | "cfo" | "security" | "engineer" | "designer" | "pm" | "qa" | "devops" | "researcher" | "general" | "other")
model?: string
@@ -19,7 +19,7 @@ task_id?: string
}
export interface PaperclipAgentTaskRunDimensions {
adapter_type?: ("process" | "http" | "acpx_local" | "claude_local" | "codex_local" | "cursor_cloud" | "gemini_local" | "hermes_gateway" | "hermes_local" | "opencode_local" | "pi_local" | "cursor" | "openclaw_gateway" | "grok_local" | "kimi_local" | "other")
adapter_type?: ("process" | "http" | "acpx_local" | "claude_local" | "codex_local" | "cursor_cloud" | "gemini_local" | "hermes_gateway" | "hermes_local" | "opencode_local" | "pi_local" | "cursor" | "openclaw_gateway" | "grok_local" | "kimi_local" | "antigravity_runtime" | "copilot_runtime" | "aws_agentcore" | "claude_managed" | "grok_bot" | "muse" | "openai_dot" | "other")
agent_id: string
agent_role?: ("ceo" | "cto" | "cmo" | "cfo" | "security" | "engineer" | "designer" | "pm" | "qa" | "devops" | "researcher" | "general" | "other")
model?: string
@@ -309,6 +309,13 @@ export const PAPERCLIP_ENUM_DESCRIPTIONS = {
"openclaw_gateway": "Agent runtime uses the OpenClaw gateway adapter.",
"grok_local": "Agent runtime uses the local Grok adapter.",
"kimi_local": "Agent runtime uses the local Kimi adapter.",
"antigravity_runtime": "Agent runs Google Antigravity through the Paperclip runner.",
"copilot_runtime": "Agent runs GitHub Copilot through the Paperclip runner.",
"aws_agentcore": "Agent runs on AWS Bedrock AgentCore through the Paperclip runner.",
"claude_managed": "Agent runs on Claude Managed Agents through the Paperclip runner.",
"grok_bot": "Agent runs as Grok Bot through the Paperclip runner.",
"muse": "Agent runs Muse through the Paperclip runner.",
"openai_dot": "Agent runs OpenAI Dot through the Paperclip runner.",
"other": "Fallback when the adapter type is unknown or not represented by the tracked enum."
},
"agent_role": {
@@ -344,6 +351,13 @@ export const PAPERCLIP_ENUM_DESCRIPTIONS = {
"openclaw_gateway": "Agent runtime uses the OpenClaw gateway adapter.",
"grok_local": "Agent runtime uses the local Grok adapter.",
"kimi_local": "Agent runtime uses the local Kimi adapter.",
"antigravity_runtime": "Agent runs Google Antigravity through the Paperclip runner.",
"copilot_runtime": "Agent runs GitHub Copilot through the Paperclip runner.",
"aws_agentcore": "Agent runs on AWS Bedrock AgentCore through the Paperclip runner.",
"claude_managed": "Agent runs on Claude Managed Agents through the Paperclip runner.",
"grok_bot": "Agent runs as Grok Bot through the Paperclip runner.",
"muse": "Agent runs Muse through the Paperclip runner.",
"openai_dot": "Agent runs OpenAI Dot through the Paperclip runner.",
"other": "Fallback when the adapter type is unknown or not represented by the tracked enum."
},
"agent_role": {
@@ -382,6 +382,8 @@ describeEmbeddedPostgres("emitAgentTaskRun", () => {
{ adapterConfig: {}, adapterType: "codex_local" },
{ adapterConfig: { provider: "acpx", acpxAgent: "claude" }, adapterType: "claude_local" },
{ adapterConfig: { provider: "opencode" }, adapterType: "opencode_local" },
{ adapterConfig: { provider: "acpx", acpxAgent: "copilot" }, adapterType: "copilot_runtime" },
{ adapterConfig: { provider: "acpx", acpxAgent: "antigravity" }, adapterType: "antigravity_runtime" },
])("reports a Paperclip runner agent's underlying harness $adapterType as adapterType", async ({ adapterConfig, adapterType }) => {
await seedCompanyAndAgent({ adapterType: "paperclip_runner", adapterConfig });
const [run] = await db.insert(heartbeatRuns).values({ companyId, agentId, status: "succeeded" }).returning();
@@ -471,7 +473,7 @@ describe("agentRunFailureCause", () => {
});
describe("Paperclip runner adapter_type coverage", () => {
it.each(["agent.task_run", "agent.task_completed"] as const)("lists every runner harness in the %s adapter_type contract except the known gaps", (event) => {
it.each(["agent.task_run", "agent.task_completed"] as const)("lists every runner harness in the %s adapter_type contract", (event) => {
const contract = Object.keys(PAPERCLIP_ENUM_DESCRIPTIONS[event].adapter_type);
const harnesses = [
...Object.keys(PAPERCLIP_RUNNER_PERMISSION_CAPABILITIES)
@@ -480,14 +482,33 @@ describe("Paperclip runner adapter_type coverage", () => {
...PAPERCLIP_RUNNER_ACPX_PROFILES.map(({ value }) => telemetryAdapterType({ adapterType: "paperclip_runner", adapterConfig: { provider: "acpx", acpxAgent: value } })),
];
expect(harnesses.filter((harness) => !contract.includes(harness)).sort()).toEqual([
"acpx:copilot",
"antigravity_runtime",
"aws_agentcore",
"claude_managed",
"grok_bot",
"muse",
"openai_dot",
expect(harnesses.filter((harness) => !contract.includes(harness)).sort()).toEqual([]);
});
it("reports each runner harness as its expected adapter_type", () => {
const reported = Object.fromEntries([
...Object.keys(PAPERCLIP_RUNNER_PERMISSION_CAPABILITIES)
.filter((provider) => provider !== "acpx")
.map((provider) => [provider, telemetryAdapterType({ adapterType: "paperclip_runner", adapterConfig: { provider } })]),
...PAPERCLIP_RUNNER_ACPX_PROFILES.map(({ value }) => [`acpx:${value}`, telemetryAdapterType({ adapterType: "paperclip_runner", adapterConfig: { provider: "acpx", acpxAgent: value } })]),
]);
expect(reported).toEqual({
codex: "codex_local",
opencode: "opencode_local",
claude_managed: "claude_managed",
aws_agentcore: "aws_agentcore",
grok_bot: "grok_bot",
muse: "muse",
openai_dot: "openai_dot",
cursor_cloud: "cursor_cloud",
"acpx:grok": "grok_local",
"acpx:claude": "claude_local",
"acpx:cursor": "cursor",
"acpx:copilot": "copilot_runtime",
"acpx:pi": "pi_local",
"acpx:kimi": "kimi_local",
"acpx:antigravity": "antigravity_runtime",
});
});
});
@@ -1,6 +1,6 @@
import { and, eq, sql } from "drizzle-orm";
import { agents, heartbeatRuns, issues, type Db } from "@paperclipai/db";
import { agentHarnessType, requiresExecutionReconciliation } from "@paperclipai/shared";
import { agentHarnessName, requiresExecutionReconciliation } from "@paperclipai/shared";
import { PERMANENT_FAILURE_CODES, RESTART_CLASS_FAILURE_CODES, SETUP_FAILURE_CODES } from "./continuation-cause.js";
import { trackAgentTaskRun } from "@paperclipai/shared/telemetry";
import { parseObject } from "../adapters/utils.js";
@@ -144,7 +144,7 @@ export function agentRunFailureCause(input: {
}
export function telemetryAdapterType(agent: { adapterType: string; adapterConfig: unknown }): string {
return agentHarnessType(agent.adapterType, parseObject(agent.adapterConfig));
return agentHarnessName(agent.adapterType, parseObject(agent.adapterConfig));
}
function providerFailureCategory(resultJson: unknown): string | null {
@@ -56,7 +56,7 @@
"packages/shared/src/agent-observability.test.ts": "36cd74a8a8d1947364ec96fa30deabff14658df2",
"packages/shared/src/agent-observability.ts": "52dc94e13624adeaf1aafa8996099a5dc158ef4b",
"packages/shared/src/agent-runner.test.ts": "d02d0bba0cf57838011d4ec5f1304b65c15cff56",
"packages/shared/src/agent-runner.ts": "c4e9a7206d8c5cba7d9d95e7b02389cc351f3ecb",
"packages/shared/src/agent-runner.ts": "db11502d8a42961170badd4264aa3fe45a95049c",
"packages/shared/src/agent-url-key.ts": "d0ec20b3ea1636a960bc5372a2c1e5a124bc5511",
"packages/shared/src/aggregator-app-catalog.test.ts": "39ee377e55cc9565fce004b928bbe0998268e004",
"packages/shared/src/aggregator-app-catalog.ts": "d6778b07a41356878c549d039ae316553ca9a22b",
@@ -275,7 +275,7 @@
"packages/shared/src/home-paths.ts": "fa4f1c440653b76b3dbb7a51026d557287deb45d",
"packages/shared/src/humanize-connection.test.ts": "ba9e90a44c63452b0bf9f733adb90241921e8eca",
"packages/shared/src/humanize-connection.ts": "fbd414476a0ef7106a7c80d8572208781b091699",
"packages/shared/src/index.ts": "92261d37eff283b4eaac2566bab089d426e9f987",
"packages/shared/src/index.ts": "76a0b1a876d4ab010fdec130c267ddf5af5ba465",
"packages/shared/src/issue-activity-identity.test.ts": "3dc294640f54c2be67943e3e0149cf4eff2c95ca",
"packages/shared/src/issue-activity-identity.ts": "1b0f07ec3fe0506aaaf80a4fa9893f3baf8f0075",
"packages/shared/src/issue-attribution.test.ts": "84563685e7f3c48029243cf1cc24a3a09ee3cde9",
@@ -374,14 +374,14 @@
"packages/shared/src/standing-checks.ts": "7ab71e4b6984e41e1c1dfd1bddf0116041d5abf1",
"packages/shared/src/subscriptions.ts": "ef70e63395ca967bbc30776b71560e96eb354a75",
"packages/shared/src/summary-slot.test.ts": "5f8e222dea425f0d5bff0adb5c683087bd7cf7fb",
"packages/shared/src/telemetry/README.md": "41b9c614005d53b74b6a4c9c9a55c715e9144653",
"packages/shared/src/telemetry/README.md": "04a42702f053688a41bcea09a93f8f33d2c9aa5d",
"packages/shared/src/telemetry/client-types.test.ts": "3b630edda4972b929ba4decd7457f226eb9cfc5b",
"packages/shared/src/telemetry/client.test.ts": "5a95f2305a393c5b2e7750b10e0ed65da0f30cf8",
"packages/shared/src/telemetry/client.ts": "d6534ce8aaa6f69fb2dd03e12487db024e250a96",
"packages/shared/src/telemetry/config.ts": "dfcd4d692cc06e71cb77f70b44fc05721eb330d1",
"packages/shared/src/telemetry/connector-events.test.ts": "c060017c7a6a26e67aea56e5c9e36059be527070",
"packages/shared/src/telemetry/events.ts": "b7c7fa27da4bec5e207785bfa6793d9ceffaf4db",
"packages/shared/src/telemetry/generated/paperclip-telemetry.ts": "3d0f4e7c22a12937a07ca617e4e9093de6fb90e9",
"packages/shared/src/telemetry/generated/paperclip-telemetry.ts": "033fd3d295ebf5fbed2938f58b4e04e7f4a110fb",
"packages/shared/src/telemetry/index.ts": "69e507a3d178c2daaa609f75b79f4cadfdc720af",
"packages/shared/src/telemetry/product-events.test.ts": "d3182c7e18fbe9c2915497fc1e2048fb2a250a04",
"packages/shared/src/telemetry/readme-contract.test.ts": "eec9d4511ddc3085a9af1a2dab6bf8487e49dfd7",