Trail Finding and Pi Review Token Deduplication · Entire

Address "entire trail finding"

2w ago·3.4s·29 calls

Changed:

Verified:

Was there any feature creep happening here?

2w ago·6.0s

What changed:

No new commands, API behavior, flags, or UX flows were added.

The only arguable scope expansion is that I updated both the CLI help text and the agent-injected hint, because they previously duplicated the same sentence. If you wanted the fix limited strictly to the context injection or strictly to help output, I can narrow it.

Commit and push the fixes (pull first).

2w ago·4.9s·20 calls

Done.

Entire Trail review comment

ID: 019f1ebb-8946-708f-9454-999bd43c3017
URL: https://entire.io/gh/entireio/cli/trails/467/review-pi-reviewer
Severity: low
Context: cmd/entire/cli/agent/pi/reviewer.go:193
Selected context:

total.In += usage.Input + usage.CacheRead + usage.CacheWrite

addPiReviewTokens adds usage.Input + usage.CacheRead + usage.CacheWrite into total.In. For OpenAI-shaped usage, cache-read tokens are reported as a subset of input tokens (the codex reviewer in this repo explicitly avoids summing subset fields to prevent double-counting), and Pi normalizes across providers including OpenAI (gpt-5). If Pi's Input already includes cached tokens, this inflates the reported input count. Confirm Pi's input/cacheRead/cacheWrite are mutually exclusive before summing.

2w ago·5.4s·20 calls

Addressed and pushed.

Entire Trail review comment

ID: 019f1ec1-3e28-7373-81b8-bbf656ff9184
URL: https://entire.io/gh/entireio/cli/trails/467/review-pi-reviewer
Severity: low
Context: cmd/entire/cli/agent/pi/reviewer.go:179
Selected context:

if key := env.MessageID(); key != "" {

emitPiReviewTokens only dedupes usage when env.MessageID() is non-empty. The realistic stream fixture (TestPiReviewer_ParseJSONEventStream) shows message_end carrying usage with no id/message.id, so MessageID() returns "" and the dedup guard is skipped entirely. If Pi also emits a turn_end (which this parser explicitly reads usage from) for the same turn without an id, the input/output tokens would be counted twice. Consider a per-turn/per-type dedup fallback when no id is available.

2w ago·13.8s·9 calls

Deduplicate no-id Pi review token events