← Model losses

Head-to-head comparison

openai / gpt-6.1-sol / xhigh / xhigh effort preferred over openai / gpt-6-luna / none / none effort · close win.

Primary judge: Sol 6.1, requested Low. Effective provider effort and internal attempts were not verified. A close win is still a scored preference; it does not establish a material defect.

Reviewed public evidence

Task goal

Source-backed audit of CodingUsage. The previous effort-comparison wave did not open the repository and produced no source-verified findings. The attached files are the evidence. Read them. Do not modify files. Do not repeat an evidence-limit disclaimer if the attached sources answer the question.

Answer with file and line citations from the attached sources:

1. Provenance. The menu bar is native Swift. helper/collector.mjs imports [REDACTED: home-relative path] and [REDACTED: home-relative path] and starts their refresh loops. Swift sets OpenCode 2 XDG dirs and does not call provider APIs. Separately verified outside this repo, do not re-derive if you cannot read those files: Claude fetches https://api.anthropic.com/api/oauth/usage; Codex fetches https://chatgpt.com/backend-api/wham/usage; Grok fetches https://cli-chat-proxy.grok.com/v1/billing using the xAI access token already in opencode.db and does not refresh it; Cursor uses Cursor dashboard APIs; OpenRouter fetches https://openrouter.ai/api/v1/credits using OPENROUTER_API_KEY from OpenCode service.json; DeepSeek fetches https://api.deepseek.com/user/balance. Say clearly whether displayed numbers are OpenCode's running process, native clients in this app, or plugin loops hosted by this app that call provider APIs with stored credentials.

2. Shareability verdict for another person. Cite concrete blockers in the attached files: all-or-nothing dynamic import, Node path list, ad-hoc codesign, personal bundle id, missing license, LaunchAgent installer, private plugin paths. Separate "another person who already has these exact local plugins" from "a general Mac app." Do not recommend vendoring secrets or private plugin source, and do not recommend this app refreshing tokens.

3. Security findings supported by the attached code only. Include stdout allowlisting, stderr discard, Codex refresh block, instance lock mode, and whether account labels can pass through. Flag only real issues.

4. Prioritized safe cleanup that stays in this repo, does not change the data source, and does not productize credential ownership. Rank by user impact. Call out whether a missing OpenRouter fetcher fails every provider. No rewrite.

Return a direct OpenCode-or-native answer, a shareability verdict, and a cleanup list another engineer could implement without a product decision.

openai / gpt-6.1-sol / xhigh / xhigh effort answer

## Direct answer: native UI, app-hosted OpenCode plugin polling

**The menu bar is native Swift; the numbers come from installed OpenCode plugins running inside this app’s Node helper.** They are **not streamed from OpenCode’s running process**, and Swift does not implement native provider API clients.

- AppKit creates the status item and panel; SwiftUI renders the panel (`Sources/CodingUsage/CodingUsageApp.swift:81–123`).
- Swift launches Node, sets OpenCode 2’s cache/data/config directories, and decodes JSON snapshots (`Sources/CodingUsage/CodingUsageApp.swift:336–366,421–437`).
- The collector imports modules from `[REDACTED: home-relative path]` and the private V2 OpenRouter fetcher, then starts their refresh loops (`helper/collector.mjs:7–14,435–459,493–529,610–621`). Refresh intervals are 60 seconds (`helper/collector.mjs:15,504–528`).
- This architecture works independently of an open coding window, as documented (`README.md:3–5`).

**Using the separately verified provider facts supplied with the question**, those hosted plugins call:

| Provider | API and credential provenance |
|---|---|
| Claude | `https://api.anthropic.com/api/oauth/usage` using stored OAuth credentials |
| Codex | `https://chatgpt.com/backend-api/wham/usage` using stored credentials, subject to the monitor’s refresh block |
| Grok | `https://cli-chat-proxy.grok.com/v1/billing` using the existing xAI access token in `opencode.db`; no token refresh |
| Cursor | Cursor dashboard APIs |
| OpenRouter | `https://openrouter.ai/api/v1/credits` using `OPENROUTER_API_KEY` from OpenCode’s `service.json` |
| DeepSeek | `https://api.deepseek.com/user/balance` |

Thus, **“OpenCode-backed” describes plugin and credential provenance—not ownership by a running OpenCode process.** Swift’s child environment excludes ambient provider keys; credential access happens in the installed plugins/helper, not Swift (`Sources/CodingUsage/CodingUsageApp.swift:341–352`; `README.md:20–22`).

## Shareability verdict

### Someone with these exact local plugins

**Conditionally usable as a locally built wrapper.** They need compatible installed plugin exports, matching OpenCode 2 directories and credentials, compatible Node, and macOS 14 or newer (`helper/collector.mjs:435–459`; `Sources/CodingUsage/CodingUsageApp.swift:339–352`; `Package.swift:1–8`).

### A general Mac app

**Not ready for general distribution.** Concrete blockers:

- **Private dependencies are not bundled.** The build copies only the three local helper files; provider implementations remain in private home-directory paths (`scripts/build-app.sh:48`; `helper/collector.mjs:7–14`).
- **Imports are all-or-nothing.** All nine imports use one `Promise.all`; any missing module or required export prevents startup (`helper/collector.mjs:435–459,480–491`). **A missing OpenRouter fetcher disables every provider**, because no refresh loops have started when that failure returns.
- **Node discovery is narrow and checks executability, not compatibility:** `/opt/homebrew/bin/node`, `/usr/local/bin/node`, `/usr/bin/node`. Startup requires type-stripping support and the helper’s module-registration API (`Sources/CodingUsage/CodingUsageApp.swift:339,440–444`; `helper/usage-helper.mjs:1,57`).
- **Signing is ad hoc**, not a public Developer ID/notarization workflow (`scripts/build-app.sh:50`; `scripts/install-login-item.sh:23–24`).
- **The bundle identity is author-specific and reused by the installer:** `ai.utilityinsights.CodingUsage` (`Support/Info.plist:9–10`; `scripts/install-login-item.sh:5–9`).
- **No license appears in the supplied inventory**, and the README provides no reuse grant (`README.md:1–45`). Redistribution needs an owner-selected license.
- **Installation is a local LaunchAgent workflow**, with app replacement, process-name termination, and extended-attribute clearing—not a general app installation contract (`scripts/install-login-item.sh:14–24,27–70`).

Sharing must not involve copying credentials, private plugin source, databases, or captured snapshots. The repository already excludes common credential artifacts and explicitly prohibits committing them (`.gitignore:7–17`; `README.md:42–44`). This app should not become a token-refresh owner.

## Security findings

### Existing protections

- **Projected stdout:** the collector constructs usage sections and rows rather than serializing credential objects wholesale. Account identifiers become truncated SHA-256-derived identifiers (`helper/collector.mjs:68–70,95–106,284–290,359–365`).
- **Output filtering:** the wrapper rejects non-JSON/nonprotocol output and checks snapshots for named secret keys and recognizable token prefixes (`helper/usage-helper.mjs:4–27,30–43`).
- **Raw diagnostics are discarded:** console methods and helper stderr are suppressed, and Swift separately drains stderr without retaining it (`helper/usage-helper.mjs:45–55`; `Sources/CodingUsage/CodingUsageApp.swift:364–366`). This reduces leakage, but also limits troubleshooting.
- **Codex refresh blocking:** a refresh-enabled source with missing/invalid expiry, or within six minutes of expiry, blocks the whole Codex refresh loop. It uses cached usage and marks it `REFRESH_BLOCKED`; the check repeats every 15 seconds (`helper/collector.mjs:16,470–478,537–559,595–621`).

The Codex block does **not** mean zero Codex API reads: reset-credit details are fetched using an existing, unexpired access token, before the rotation check. No refresh operation is invoked by that call site (`helper/collector.mjs:561–574,604–608`).

### Actual limitations—not evidence of credential theft

- **Account labels can pass through.** Claude and Codex copy `account.label` directly into `title`, which is displayed and included in accessibility text (`helper/collector.mjs:287,362`; `Sources/CodingUsage/UsageViews.swift:187–190,257–259`). The unused/null `accountLabel` field does not prevent this. Cached Codex labels also retain four characters of `labelHint` (`helper/collector.mjs:374`). Identifying labels are therefore not anonymized.
- **The stdout gate is not a complete schema or secret allowlist.** Snapshots may contain arbitrary extra fields if they pass the regex scan; error/check branches bypass that scan (`helper/usage-helper.mjs:15–24`). Current collector error calls use fixed codes, so this does **not** establish an existing token leak. It establishes that the guard cannot guarantee comprehensive redaction.
- **The instance lock uses creation mode `0644`.** No sensitive content is written to it, so its readability is not a credential-disclosure finding (`Sources/CodingUsage/CodingUsageApp.swift:33–39`). Separately, every `flock` failure is treated as “already running,” including failures other than lock contention—a reliability defect, not evidence of compromise.

## Prioritized safe cleanup

All of these stay in this repository and preserve the installed-plugin data source.

1. **Isolate provider import/start failures.** Validate and load providers independently; keep Codex auth/cache dependencies scoped to Codex. Report a fixed provider-specific unavailable state instead of globally returning `IMPORT_FAILED`. Acceptance test: removing the OpenRouter fetcher leaves the other providers updating (`helper/collector.mjs:435–459,480–529`).

2. **Add actionable runtime preflight.** Check Node’s required capabilities before launch; distinguish unsupported Node, missing plugin, and incompatible exports using fixed diagnostic codes—not raw exceptions or credential contents. Extend the existing `--check` path and Swift error-copy mapping (`helper/usage-helper.mjs:69–78`; `Sources/CodingUsage/CodingUsageApp.swift:332–339,440–444`; `Sources/CodingUsage/UsageViews.swift:40–55`).

3. **Fix helper lifecycle and freshness handling.**
   - Clear process-specific partial stdout when replacing a helper; the existing buffer survives launches/exits (`Sources/CodingUsage/CodingUsageApp.swift:282,328–401,403–418`).
   - Keep restart bookkeeping on its serial queue; `restarts` is currently reset on the main actor but otherwise managed on the helper queue (`Sources/CodingUsage/CodingUsageApp.swift:379–400,429–432`).
   - Make retained data explicitly stale after helper failure and keep age labels advancing. Snapshot timestamps currently describe emission time, while the UI computes age only when rendered (`helper/collector.mjs:415–431`; `Sources/CodingUsage/CodingUsageApp.swift:258–265`; `Sources/CodingUsage/UsageViews.swift:137,391–397`).

4. **Make the existing installer safer and reversible.** Stage and validate the replacement before stopping the existing installation; avoid broad `pkill -x`; remove unnecessary blanket extended-attribute clearing; add an uninstall script limited to this LaunchAgent. Preserve the optional, per-user login workflow (`scripts/install-login-item.sh:16–24,27–70`).

5. **Tighten protocol/privacy handling and regression tests.** Enforce the actual schema and fixed error codes; inspect every accepted message type; bound free-text fields and document that account labels may identify people. Add credential-free fixtures for labels, partial stdout, provider failures, and Codex near-expiry/cache behavior (`helper/usage-helper.mjs:4–27`; `helper/collector.mjs:287,362,470–478`). Also distinguish lock contention from other errors and use `0600` as lock-file hygiene (`Sources/CodingUsage/CodingUsageApp.swift:33–39`).

**Next action:** implement and test item 1 first. It removes the largest current failure mode without changing providers, credentials, or token ownership.

Independent, read-only assessment; no files modified.

openai / gpt-6-luna / none / none effort answer

## Direct answer

This is **a native Swift macOS menu-bar app that hosts Node plugin refresh loops**—not OpenCode’s running process and not a native provider client. Swift launches the helper with OpenCode 2 XDG directories and a fixed Node `PATH` (`Sources/CodingUsage/CodingUsageApp.swift:328–352`). The helper imports the listed installed plugins and starts their refresh loops (`helper/collector.mjs:7–14, 435–459, 493–529`). Swift does not call provider APIs in the supplied code; it receives JSON snapshots from the helper (`Sources/CodingUsage/CodingUsageApp.swift:353–358, 403–437`).

The separately supplied endpoint facts attribute provider calls to those plugin loops using stored credentials: Anthropic, Codex, Grok, Cursor, OpenRouter, and DeepSeek. The repo describes OpenRouter credentials as read by its installed V2 loop from OpenCode’s private service environment, and Grok’s already-refreshed OpenCode DB token as read without rotation (`README.md:20–24`). It also explicitly blocks the Codex refresh loop when a token might rotate (`README.md:24–26`; `helper/collector.mjs:470–477, 595–619`).

## Shareability verdict

- **For someone who already has these exact local plugins:** potentially usable, but tightly coupled to their paths, exports, behavior, and OpenCode 2 data layout. The imports are all-or-nothing: every module is loaded through one `Promise.all`, and import or required-export failure returns `IMPORT_FAILED` before loops start (`helper/collector.mjs:435–459, 480–491`). The Swift launcher only searches three hard-coded Node locations (`Sources/CodingUsage/CodingUsageApp.swift:440–444`) and supplies a fixed `PATH` (`:341–352`).
- **As a general Mac app:** not ready to share. It uses an ad-hoc signature (`scripts/build-app.sh:43–50`), a personal bundle identifier (`Support/Info.plist:9–10`), and a LaunchAgent installer that installs into the current user’s Applications and LaunchAgents directories (`scripts/install-login-item.sh:5–14, 27–70`). The README calls it private and documents the private plugin paths as runtime dependencies (`README.md:3, 7–18`). No license appears in the supplied scope.
- Do **not** vendor private plugin source or secrets, or make this app responsible for refreshing credentials. The current documented design avoids that (`README.md:20–26`).

## Security findings

- **Stdout allowlisting is present:** the helper forwards only accepted JSON lines; snapshots are rejected if the recursive secret-key or secret-pattern check matches (`helper/usage-helper.mjs:4–28, 30–44`). This is useful filtering, not a guarantee against every sensitive value or a substitute for reviewing plugin output.
- **Stderr is discarded by the helper**, and Swift drains its stderr pipe without logging it (`helper/usage-helper.mjs:45–49`; `Sources/CodingUsage/CodingUsageApp.swift:353–366`). This reduces accidental error disclosure but also hides diagnostics.
- **Codex refresh is guarded:** if account listing fails or a refresh-capable credential is near expiry, the Codex loop stops and cached data is shown as blocked (`helper/collector.mjs:470–477, 595–619`). The separate reset-detail fetch is attempted only with an access token and account ID and when the token is not expired (`:560–594`). The actual implementation of the imported fetcher is outside this packet, so its behavior cannot be verified here.
- **Instance lock permissions are broader than needed:** the lock file is created with mode `0644` (`Sources/CodingUsage/CodingUsageApp.swift:33–40`). This is a concrete least-privilege issue for a per-user lock file; prefer owner-only permissions.
- **Account labels can pass through.** Claude and Codex titles are taken directly from `account.label` when it is a nonempty string (`helper/collector.mjs:284–291, 359–366`), and the stdout filter does not redact arbitrary labels unless they match its limited secret checks (`helper/usage-helper.mjs:8–28`). Codex expiry titles are more constrained (`helper/collector.mjs:304–317`). This is a real privacy risk if labels contain personal or sensitive text.

## Prioritized safe cleanup

1. **Restrict instance-lock permissions** from `0644` to owner-only (`Sources/CodingUsage/CodingUsageApp.swift:33–40`).
2. **Sanitize account labels before emitting them**—or omit them—so provider-supplied labels cannot flow into snapshots and the UI (`helper/collector.mjs:284–291, 359–366`; `Sources/CodingUsage/UsageViews.swift:12–19, 181–190`).
3. **Improve safe diagnostics:** retain a bounded, redacted failure code or status for stderr/import failures rather than silently discarding all stderr (`helper/usage-helper.mjs:45–49`; `Sources/CodingUsage/CodingUsageApp.swift:364–366`). Do not log raw plugin errors.
4. **Make plugin dependency failures clearer and more isolated.** Today, a missing OpenRouter fetcher **fails every provider**: its import is inside the shared `Promise.all`, and `start()` returns on any import failure before starting any loop (`helper/collector.mjs:435–459, 480–491`). Handle/report that dependency explicitly while leaving the other loops running; do not change their data source.
5. **Clarify the sharing boundary in the README:** label the app as dependent on exact local plugins and Node paths, and distinguish personal ad-hoc/LaunchAgent installation from general distribution (`README.md:7–18`; `Sources/CodingUsage/CodingUsageApp.swift:440–444`; build and installer citations above). No rewrite or credential-ownership change is needed.

Primary judge's stated reason

A gives an engineer a more defensible impact-ranked starting point and avoids presenting readable, non-sensitive lock-file contents as an established security problem. This is a weak, forced preference between substantially equivalent audits, not a proven material quality gap. The relative value of privacy hardening versus availability remains context-dependent, and an independent review could reject this preference.

This reason is the judge's assessment. No independent factual-defect finding is asserted by this record.

Battle wave: 4ba7cb49-5416-45bf-8817-98135322db50. Pair: brp1_b679df7bdfac235901e44db7284066a58c3346c40aa09cbed8470b3be15df724. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.