Skip to content

feat(patchy): the CLI names its version, command and coding agent on every request #537

Closed

Description

@allisonmahmood

Problem

We can't tell which coding agent builds patches, or which CLI versions are in use. The agent is the most direct evidence for Patchy being agent native, and the number investors will ask for: what share of patches Claude Code, Codex and the rest publish. The version matters for support too: a publish refusal on an old CLI looks the same as one on the latest. Each patch_versions row already stores the CLI version, but it never reaches PostHog, and the agent isn't recorded anywhere.

This takes over the Patchy-Cli header from #383 and adds the agent.

Do

  • The CLI names itself. Every request the patchy CLI makes sends a Patchy-Cli header with its version, the command, and the coding agent running it.
  • Agent detection reads environment variables each harness sets for its child processes, against a closed list (Claude Code, Codex, Cursor, Gemini CLI, OpenCode and any other you can confirm). Verify each variable from the harness's own documentation or source rather than guessing. unknown when none match. Never send an environment value or free text.
  • The server parses strictly. The header is client supplied: the version must match the release pattern, and the command and agent must be in their closed lists; anything else is dropped. A request without the header (an older CLI) records nothing extra.
  • Recorded as cliVersion, cliCommand and agent on the request wide event, and on token.minted, patch.created and patch.updated (on the catalogue shape from feat(analytics): every business event names its company #534).
  • Docs: wherever request headers and wide event fields are documented (docs/API.md if the contract renders it, docs/OPERATIONS.md, packages/patchy/README.md, ADR-0004 if it covers request headers), and the analytics catalogue.
  • Privacy page: /cloud/privacy on patchyhq.com (allisonmahmood/patchy-web, src/app/cloud/privacy/page.tsx) says what usage records carry. Open a PR there that adds the CLI version, command and coding agent, and reconciles the page with feat(analytics): onboarding moments are business events #535 and fix(patches): every patch lifecycle change is a business event, from every path #536's new events (company, invitation, membership and patch lifecycle changes: ids, roles and states). It ships in the same release as this ticket; the page's header lists the code it mirrors.

Out

Done when

A CLI request from each supported agent's environment records that agent; a missing or malformed header records nothing extra; token.minted, patch.created and patch.updated carry cliVersion and agent; the privacy page PR is up.

Filed by Claude Opus 5.5 via Claude Code for Allison.

Activity

  1. added
    enhancement
    ready-for-agent
    area:server
    area:cli
    area:docs
    on Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliarea:docsarea:serverenhancementready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions