StateStore.List reads *.json files out of .git/entire-sessions/ (git common dir, so it's shared across worktrees), unmarshals each one, drops corrupted/stale entries, and returns them. Sorting, the card rendering, and --json (writeSessionListJSON) all operate on that in-memory slice. No control-plane client, no cell client, no git network operation — not even a shadow-branch read.
What does go over the network
Two things fire from the root command's PersistentPostRun (root.go:65) after any non-hidden command, session list included:
Call
Endpoint
Condition
Version check
GET https://api.github.com/repos/entireio/cli/releases/latest (and /releases?per_page=20) — versioncheck/types.go:19
Always, 2s timeout, cached in ~/.cache/entire/version_check.json, notice to stderr
Only when telemetry: true in settings; detached subprocess, non-blocking
Neither is part of the listing — both are ambient CLI behavior, and neither touches an Entire host.
For contrast: sibling session commands do hit the API. entire session info --transcript and the activity/recap paths use auth.NewEntireAPICellClient (home-cell routing via the home_jurisdiction claim), and entire activity falls back to the data API. list deliberately stays local, which is why it works offline and without auth.
Branch:fix/1928-agent-group-external-discovery → main · 6 commits · +142/−10 across 3 files · author gtrrz-victor
I checked out the branch, built it against main, and exercised the paths with mock plugins rather than only reading the diff.
Verification status:go test ./cmd/entire/cli/... all green · golangci-lint 0 issues · gofmt clean.
Verdict
The core fix is correct and well-designed. The targeted-by-name discovery in add/remove is the right call — I confirmed entire agent add claude-code triggers zero plugin executions (the agent.Get short-circuit at discovery.go:97 fires before any $PATH lookup), so built-ins are untouched. Unknown names still route to printWrongAgentError with exit 1, errors go to stderr, and a broken plugin now yields a real diagnostic instead of "unknown agent" — exactly the stated goal. agent add <external> auto-enables external_agents via setup.go:1926, so the invariant the runAgentList comment relies on genuinely holds.
Two things I'd want addressed before merge, neither a blocker on correctness.
1. Default agent list now executes every plugin twice — and may display none of them
runAgentList calls gated DiscoverAndRegister even in the default path, then filters uninstalled externals out of the display. So the --all split is display-only; it does not reduce execution. Each plugin is run twice: info during discovery, are-hooks-installed via GetAgentsWithHooksInstalled.
Measured, agent list on main vs this branch with external_agents: true:
Plugins on PATH
main
branch
2 compiled Go plugins
0.087s
0.094s
1 Python plugin
0.084s
0.205s
9 shell-script plugins
0.05s / 0 execs
1.72s / 18 execs
In the 9-plugin case I diffed the output: , because none were installed. The cost scales with plugin count × startup latency, so compiled plugins are fine and interpreted ones (a plausible way to write an agent integration) are not.
User
can you add the tgwo main issues as finding on the trail, thanks
Assistant
Both findings are posted to trail #992:
Severity
Location
Finding
Medium
cmd/entire/cli/agent_group.go:79-104
Default agent list executes every plugin twice, then may display none of them
Low
cmd/entire/cli/agent_group_test.go
Test mocks leak permanently into the process-global agent registry
Each carries the measurement table / probe output from the review, plus a suggested direction. The medium one is framed as a design question for the author rather than a patch, since persisting installed external-agent names has no existing home in EntireSettings.
One thing worth noting: the trail had no findings before this, so these are the first two. The smaller notes from my review — the silent --all skip on a broken plugin, the doubled info: info: error prefix, the missing --all hint, and the CLAUDE.md:54 line — aren't filed. Say the word if you want any of those as findings too.
Author: gtrrz-victor · install-tracking-posthog → main · +271/−7 across 9 files · OPEN
Verification: checked out the PR head (175d40d19) in a worktree. go test ./cmd/entire/cli/telemetry/... ./cmd/entire/cli/versioncheck/... green · mise run lint 0 issues · bash -n scripts/install.sh clean · shellcheck clean.
Overview
Adds a cli_installed PostHog event fired from the three distribution channels, reusing the existing detached-spawn pipeline. The design is sound: no second PostHog client, machineid.ProtectedID for distinct_id consistent with existing events, a closed method allowlist, and previous_version persisted in the config dir (not the cache) so upgrade signal survives a cache wipe. Exporting versioncheck.ReleaseChannel is a clean reuse rather than a reimplementation. The opt-out check matches the != "" convention used at all five existing sites.
Answering your open question
Nothing needs wiring in .goreleaser.nonprod.yaml — it publishes no cask or scoop manifest. Its top-level keys are builds, archives, blobs, release, with release: disable: true and blobs going to an S3 bucket under commit/{{.FullCommit}}. There is no homebrew_casks and no scoops section, so there is no post-install hook to attach and no user-facing install path that could emit. Nightly casks come from the prod config via skip_upload: "{{ if not .Prerelease }}true{{ end }}" on the entire@nightly cask, which your diff does cover. I'd close the question as "intended, nothing to do".
Findings
1. The brew hook is unguarded against the exact failure you flagged as unverifiable — Medium
Scoop gets try { … } catch { }; brew gets a bare system_command. That asymmetry matters more than it looks:
I checked Homebrew's source (Library/Homebrew/system_command.rb:44,102) — system_command defaults to must_succeed: false, so a is safely ignored. But a raises from Ruby, which is not a non-zero exit and is not swallowed — it aborts . That is precisely the case you called out as untestable in CI, on the highest-traffic channel, with no guard.
User
can you check if there are other presendences in this regards of other clis using brew?
Assistant
Good question — and I can get real evidence two ways: the actual Homebrew corpus on this machine, and what comparable CLIs do. Let me check both.
Assistant
That doc summary makes a strong claim about sandboxing. Let me verify it against the actual Homebrew source rather than trust a summary.
Assistant
Yes — and checking the precedent turned up something that changes one of my earlier findings.
Correction to my review: the brew hook is riskier than I said
I previously said Homebrew's system_command defaults to must_succeed: false and so a non-zero exit is safely ignored. That's true of SystemCommand.run, but the cask DSL doesn't call run — Cask::DSL::Base#system_command (cask/dsl/base.rb:28) delegates to @command.run!, and run! defaults to must_succeed: true (system_command.rb:129).
So inside a cask hook, any non-zero exit from entire __track-install raises and aborts brew install — not just a missing binary. Finding #1 goes from Medium to High, and must_succeed: false moves from "nice to be explicit" to required. Good news from the same read: staged_path is a real delegator (base.rb:25), so #{staged_path}/entire resolves — the thing the author flagged as unverifiable is actually fine; it's the failure handling that isn't.
Precedent in homebrew-cask
Query
Result
Casks using postflight
83
Casks matching analytics + postflight
0
Casks matching curl + postflight
0
Casks matching telemetry
8 — all app names/descriptions (VSCodium, Tableau, openusage), none a post-install ping
I sampled the postflight bodies of ngrok, multipass, tidelift, orbstack. All are local setup — set_permissions, symlink, or invoking the app's own binary for local configuration. No cask in the official repo phones home from postflight.
The closest structural precedent is OrbStack:
ruby
postflight_steps do
run "OrbStack.app/Contents/MacOS/bin/orbctl", args: ["_internal", "brew-postflight"], base: :appdir
end
Same shape as this PR — a hidden vendor subcommand called from postflight. I can't tell from the cask what orbctl _internal brew-postflight does; the naming suggests local setup, not analytics. Note it uses the modern declarative , which per the Cask Cookbook runs sandboxed — so that form couldn't do what this PR wants even if OrbStack wanted to. GoReleaser's emits the legacy block instead, which s arbitrary Ruby unsandboxed (). That path still works, but it's the deprecated one, and it's deprecated precisely because arbitrary install-time code is what Homebrew is moving away from.
User
so what would you add as finding?
Assistant
Trail #995 exists for this branch. Here's what I'd file on it:
#
Sev
Location
Claim
1
High
.goreleaser.yaml (both cask hooks)
Cask::DSL::Base#system_command delegates to run! (must_succeed: true), so any non-zero exit from __track-install raises and aborts brew install. Needs must_succeed: false + a rescue, matching the guard scoop already has.
2
Medium
telemetry/detached.go:200
The git_version suppression enforces a documented privacy property via two unsynchronized "cli_installed" literals, with zero test coverage. Const + a testable enrichment seam.
3
Medium
.goreleaser.yaml / docs/security-and-privacy.md
brew and scoop send with no install-time notice. The PR cites Homebrew's analytics as its model, but Homebrew "displays a notice before analytics are enabled so a user can opt out before sending an event." The cited precedent argues against the current shape.
4
Low
.goreleaser.yaml
Depends on Homebrew's legacy unsandboxed postflight block. The modern replacement, postflight_steps, runs sandboxed with no network access — so if Homebrew retires the legacy path, this feature silently dies and the cask may error. Worth an explicit note so it's a known dependency, not a surprise.
5
Low
telemetry/detached.go:286, :330
previous_version advances even when the spawn never ships the event; writeInstalledVersion re-joins the filename instead of using installStatePath().
Finding 3 is the one that changed status since my first pass. I originally framed it as a judgment call for whoever owns privacy sign-off — the precedent research turned it into a documented inconsistency with the model the PR itself invokes, which makes it a finding rather than an opinion.
What I'd leave out: the precedent data itself (0 of 83 postflight casks phone home; OrbStack as the closest structural analog; no public Homebrew analytics for third-party taps). That's context for the discussion — and the third point actively supports shipping something here — so it belongs in a comment on the trail, not as a finding against the code. Same for the nonprod answer, which is a reply to the author's question. The remaining nits (redundant return, __send_analytics vs __track-install naming, test stderr noise) aren't worth findings.
Want me to file these five on trail #995, and add the precedent research + nonprod answer as a discussion comment?
User
let's add all 5
Assistant
Now filing all five on trail #995.
Assistant
All five are on the trail. One thing worth flagging — there was already a finding at that location:
Assistant
All five are filed on trail #995:
ID
Sev
Location
019fec7a-799
High
.goreleaser.yaml:151-154 — brew hook can abort brew install
One overlap you should know about. There was already a finding on this trail — 019feafd-750, medium, confidence 0.55, at .goreleaser.yaml:154 — covering the same brew/scoop asymmetry. It reached the right conclusion by inference ("Homebrew Cask's system_command raises on a non-zero/failed invocation by default") but without the source evidence, and it hung the argument on a Gatekeeper-quarantine hypothesis that doesn't hold: .goreleaser.yaml:56 notarizes both darwin build ids with wait: true, so a quarantined-binary kill isn't the trigger.
Mine supersedes it rather than complementing it — same defect, high vs medium, 0.95 vs 0.55, with cask/dsl/base.rb:28 → run! → system_command.rb:129 as the citation that settles the "by default" claim, and the misleading Gatekeeper framing removed.
I didn't touch it, since resolving someone else's finding felt like your call. Want me to resolve 019feafd-750 as superseded, or leave both open?
I'd flag this as worth a look rather than a regression — gated DiscoverAndRegister is already on hooks_cmd, resume, attach, explain, and review. But those aren't a sub-100ms listing command. The cheapest fix that keeps commit 896e533fe's intent (installed externals visible by default) is to persist installed external names at agent add time and have the default path call DiscoverAndRegisterNamedAlways per known name. There's no such record today — I checked EntireSettings, and AreHooksInstalled is the only source of truth — so this is a design question for the author, not a one-line change.
2. Test mocks leak permanently into the process-global agent registry
I confirmed this with a probe test. After the two new tests run, agent.StringList() still contains ext-available-test and ext-installed-test for the remainder of the package run:
code
registry after external tests: claude-code,codex,copilot-cli,cursor,
ext-available-test,ext-installed-test,factoryai-droid,gemini,opencode,pi,roger-roger
There is no Unregister in agent/registry.go. Their binaries live in t.TempDir()s that are deleted at test end, so every later GetAgentsWithHooksInstalled call in the package attempts to exec a deleted path. It's benign today only because a missing binary reports installed: false — that's TempDir cleanup ordering doing the isolation work, not the test. Had the mock reporting {"installed": true} outlived its directory, it would have polluted the installed-agent set package-wide.
Worth an agent.UnregisterForTesting (or snapshot/restore) seam wired to t.Cleanup. The full suite passes as-is, so this is hygiene, not a live failure.
Smaller notes
agent list --all silently omits plugins whose info fails. Verified: a plugin exiting non-zero is simply absent, exit 0, no diagnostic — while agent add <same> reports the underlying error fine. docs/architecture/external-agent-protocol.md:553 documents skip-on-failure as protocol behavior, so this is by design, but --all is an explicit "what's on my PATH" inventory request where a one-line stderr warning would save real debugging time.
Doubled prefix in the error chain:... from binary "...": info: info: boom: cannot start. Pre-existing wrap in the external package, but this PR is what first surfaces it to users.
No hint that --all exists. The default listing gives no pointer. Repo convention (entire investigate --findings printing view: entire investigate show <run-id>) suggests a footer line.
--all bypasses the external_agents gate, executing plugins for a user who never opted in. Defensible — the flag is the opt-in and the binaries are prefix-scoped to entire-agent-* — just confirming it's intentional.
CLAUDE.md:54 lists agent's subcommands without the new --all flag. agent-help renders live from Cobra, so that surface updates itself.
Tests correctly avoid t.Parallel() alongside t.Chdir/t.Setenv and document why, matching the repo's guidance. The sh-availability skip matches sibling tests.
non-zero exit
missing or non-executable
#{staged_path}/entire
Errno::ENOENT
brew install
Suggest making brew as defensive as scoop:
ruby
begin
system_command "#{staged_path}/entire", args: ["__track-install", "--method", "brew"], must_succeed: false
rescue => e
opoo "install tracking skipped: #{e}"
end
Worth noting the Gatekeeper angle is not a problem here — .goreleaser.yaml:56 notarizes both darwin build ids with wait: true, so a quarantined-binary kill isn't in play.
2. A documented privacy guarantee rests on two unsynchronized string literals with no test — Medium
docs/security-and-privacy.md commits to an exact property set for this pre-consent event. Enforcement is:
detached.go:259 — Event: "cli_installed" (the producer)
detached.go:200 — if payload.Event != "cli_installed" (the suppressor, in the detached child)
grep -rn '"cli_installed"' finds only these two plus one test assertion, and no test exercises the suppression — grep -rn git_version cmd/entire/cli/telemetry/ returns only the implementation. Rename the event in one place and the child silently starts attaching git_version to a pre-consent event whose disclosure says it has none.
The other event names in this package are also bare literals, so this isn't a convention break — the difference is that this one has a second, remote consumer enforcing a privacy property. Suggest a package const plus extracting the enrichment into a testable helper, since SendEvent currently has no seam (it constructs a real PostHog client inline):
go
const eventCLIInstalled = "cli_installed"
func enrichProperties(p *EventPayload) { … } // testable; assert no git_version for eventCLIInstalled
3. previous_version advances even when the event never ships — Low
TrackInstallDetached calls writeInstalledVersion(version) before spawnDetachedAnalytics, and the spawn is silently best-effort (execx.SpawnDetached returns early on os.Executable() or cmd.Start() failure). The comment covers the converse — "a write failure must never drop the event" — but not this direction: a dropped event still burns the version transition, so the next upgrade reports a previous_version whose install was never recorded. Moving the write after a successful cmd.Start() would need a return value from SpawnDetached; alternatively just note it as accepted loss.
Related, for whoever builds the dashboard: re-running curl | bash on the same version emits previous_version == cli_version. That's a reinstall, not an upgrade, and downstream needs to treat it as such.
4. Minor
writeInstalledVersion bypasses installStatePath() (detached.go:330), re-joining "install_state.json" inline while readInstalledVersion uses the helper. Two places to change the filename. Given the repo's dupl linter culture, worth tightening.
Trailing redundant return in writeInstalledVersion's final if err := os.WriteFile(...); err != nil { return } — the function ends there anyway.
Hidden-command naming drift: __send_analytics (underscore) vs __track-install (hyphen), adjacent in root.go. Cosmetic, but they're four lines apart.
TestTrackInstallCmd_RequiresMethod calls cmd.Execute() without SetOut/SetErr, so cobra's usage output lands on the real stderr and pollutes test logs.
Things I checked that are fine
Test safety — execx.SpawnDetached early-returns under testing.Testing(), so no test can emit a real event. TestInstalledVersionRoundTrip correctly sets ENTIRE_CONFIG_DIR and skips t.Parallel(); the userdirs in-process fallback covers the tests that don't.
Scoop's try/catch is right for the case that matters — a native exe's non-zero exit doesn't throw in PowerShell, but a missing $dir\entire.exe does, which is what the guard catches.
install.sh placement before the PATH early-exit is correct, and || true plus the detached spawn keeps it non-blocking. Env vars set ahead of curl … | bash do reach the child.
Opt-out consistency — != "" matches all five existing call sites, so ENTIRE_TELEMETRY_OPTOUT=0 opting out is pre-existing behavior, not something this PR introduces.
One judgment call for you, not a defect
Brew and scoop users get no install-time disclosure at all — the hook fires silently, and the only notice lives in docs/security-and-privacy.md. install.sh at least prints a line, though it prints and pings in the same breath, so it informs rather than offers a choice. Given this is pre-consent and keyed to a pseudonymous per-machine ID, that's a product/legal call rather than a code one. It's mitigated by the EU PostHog endpoint (eu.i.posthog.com) and DisableGeoIP, and the payload is genuinely minimal. Flagging it so the decision is explicit rather than implicit — you may want whoever owns privacy sign-off to confirm the brew/scoop silence is acceptable before this ships.
postflight_steps
without network access
hooks:
postflight do … end
instance_eval
cask/artifact/abstract_flight_block.rb
Third-party taps aren't bound by homebrew-cask policy, and I found no written Homebrew rule against this — Acceptable-Casks doesn't mention telemetry at all. So this isn't prohibited. It's just genuinely unusual.
Comparable CLIs
The dev-tool CLIs I could inspect directly don't do it. Graphite (withgraphite/tap) ships a plain formula with no post_install — and Graphite definitely has telemetry, it just collects at runtime. Bun's formula likewise. GitHub code search for goreleaser configs wiring analytics into cask/scoop post-install returned one unrelated hit.
One thing that argues for the PR
I checked whether Homebrew's own analytics could give you this for free. They can't: formulae.brew.sh/api/analytics/cask-install/30d.json covers 11,405 casks from homebrew-cask only, and entire isn't in it. Homebrew collects tap-identified events but doesn't publish third-party tap data, and brew info --analytics entireio/tap/entire returns nothing. So there is no off-the-shelf source for your brew install counts — the gap the PR is filling is real.
One thing that argues against the current shape
The PR body cites Homebrew's own analytics as the model. That precedent cuts the other way on disclosure: per docs.brew.sh/Analytics, "Homebrew displays a notice before analytics are enabled so a user can opt out before sending an event." Homebrew is opt-out with a pre-send notice. This PR's brew and scoop paths send with no notice at all — only install.sh prints anything, and it prints and pings in the same breath. If you're invoking the Homebrew precedent, the matching behavior would be a first-run notice before the first event, not a docs-only disclosure.
Net: the mechanism has precedent (OrbStack-shaped), the goal is legitimate (no free alternative exists for third-party taps), but zero casks in the official corpus phone home from postflight, and the run! discovery means the current hook can break brew install outright. I'd fix the must_succeed issue regardless of how the disclosure question lands.