← Model losses

Head-to-head comparison

openai / gpt-6.1-sol / low / low 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 / low / low effort answer

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

**The menu bar is native Swift; the numbers come from installed OpenCode plugin loops hosted by this app—not OpenCode’s running process and not provider clients implemented in Swift.**

- Swift creates the `NSStatusItem` and SwiftUI panel (`Sources/CodingUsage/CodingUsageApp.swift:81–123`).
- Swift launches Node with an explicit environment pointing to OpenCode 2’s cache, data, and configuration directories; it does not forward ambient API keys (`Sources/CodingUsage/CodingUsageApp.swift:328–352`).
- The collector imports modules from `[REDACTED: home-relative path]` and the private V2 OpenRouter fetcher path, then starts their provider refresh loops (`helper/collector.mjs:7–14,435–459,493–529,610–621`).
- Swift receives JSON snapshots through stdout rather than making provider API calls (`Sources/CodingUsage/CodingUsageApp.swift:353–366,403–437`).

Using the supplied, separately verified endpoint facts: those plugins call Anthropic OAuth usage, ChatGPT WHAM usage, Grok billing, Cursor dashboard APIs, OpenRouter credits, and DeepSeek balance APIs with stored credentials. Grok uses the existing xAI token in `opencode.db` without refreshing it; OpenRouter reads `OPENROUTER_API_KEY` from OpenCode’s `service.json`. The repository documentation describes the same credential ownership boundary (`README.md:20–24`).

## Shareability verdict

**For someone already possessing these exact local plugins:** conditionally usable as a source-built personal utility, with compatible Node and macOS tooling.

**As a general Mac app:** not ready to distribute independently.

Concrete blockers:

- **All-or-nothing dependency loading.** Every module participates in one `Promise.all`; missing OpenRouter alone rejects loading and returns `IMPORT_FAILED` **before any provider loop starts** (`helper/collector.mjs:435–459,480–505`).
- **Private external plugin paths:** dependencies are expected in another person’s home directory, not bundled (`helper/collector.mjs:7–14`; `scripts/build-app.sh:43–48`).
- **Limited Node discovery:** only three absolute locations are searched; merely finding an executable does not verify support for `--experimental-strip-types` or module registration (`Sources/CodingUsage/CodingUsageApp.swift:339,440–443`; `helper/usage-helper.mjs:1,57`).
- **Local ad-hoc signing:** both scripts use `codesign --sign -`, not a distributor identity (`scripts/build-app.sh:50`; `scripts/install-login-item.sh:24`).
- **Personal namespace:** `ai.utilityinsights.CodingUsage` is fixed in the bundle and LaunchAgent (`Support/Info.plist:9–10`; `scripts/install-login-item.sh:5–9`).
- **No license in the supplied complete source inventory**, and `README.md:1–45` supplies no license grant. Adding one requires the owner’s decision.
- **Installer is persistent and invasive:** it rebuilds, stops matching processes, replaces `[REDACTED: home-relative path]`, clears extended attributes, and installs/enables a login LaunchAgent (`scripts/install-login-item.sh:12–25,49–70`).

Do not resolve these dependencies by shipping secrets or private plugin source. This app should remain a consumer of existing credential ownership, not become a token-refresh owner.

## Security findings

### Existing protections

- **Output is deliberately narrowed:** collector mappings select usage fields, hash account identifiers, and emit a defined snapshot (`helper/collector.mjs:68–70,126–291,320–366,415–432`).
- **Stdout filtering:** the wrapper rejects non-JSON/nonprotocol output and scans snapshots for selected secret keys and token patterns (`helper/usage-helper.mjs:3–28,30–44`).
- **Stderr is discarded twice:** the wrapper suppresses stderr and console methods; Swift drains stderr without displaying or persisting it (`helper/usage-helper.mjs:45–55`; `Sources/CodingUsage/CodingUsageApp.swift:364–366`).
- **Codex rotation block:** refresh-capable credentials near expiry or with invalid expiry cause the Codex loop to stop and cached data to be marked `REFRESH_BLOCKED`; checks repeat every 15 seconds (`helper/collector.mjs:470–477,537–558,595–621`). Reset-credit calls use an existing, nonexpired access token (`helper/collector.mjs:561–574`).

### Real limitations

1. **Account labels can pass through.** Claude and Codex labels become snapshot `title` strings without label redaction, and Swift displays those titles (`helper/collector.mjs:285–290,359–365`; `Sources/CodingUsage/UsageViews.swift:187–190`). An email-bearing label therefore can appear in stdout and screenshots. Hashing IDs does not anonymize labels.

2. **The stdout gate is not a strict field allowlist.** Any schema-1 snapshot without recognized secret patterns passes; error codes are arbitrary strings and bypass `containsSecret` (`helper/usage-helper.mjs:15–24`). This is defense in depth, not proof that arbitrary plugin output cannot disclose sensitive strings. No actual token disclosure is demonstrated.

3. **Instance lock uses `0644`, not `0600`.** It contains no credential writes in this code, so this is not an observed secret leak (`Sources/CodingUsage/CodingUsageApp.swift:33–39`). Also, every failed `flock` is classified as “already running,” which can silently prevent startup on a genuine lock error.

4. **Installer clears quarantine-related metadata** through unrestricted `xattr -cr` before ad-hoc signing (`scripts/install-login-item.sh:21–24`). That is a concrete trust-metadata removal, not evidence of malicious behavior.

The Codex guard is a preflight/watch mechanism, not an interception of every possible refresh inside external plugin code. Preserve it; do not claim the repository independently proves every imported implementation’s behavior.

## Prioritized safe cleanup

1. **Isolate provider dependency failures.** Load and validate each provider independently, keeping Codex’s auth/cache dependencies grouped. Render a provider-specific unavailable card when OpenRouter is missing; keep other loops running. Add regression coverage for that exact case. Current global failure: `helper/collector.mjs:435–490`.

2. **Add actionable, sanitized startup diagnostics.** Distinguish missing Node, incompatible Node, missing module, and missing export using fixed codes—never raw exceptions or credentials. Check compatibility before installation. Current discovery and generic diagnostics: `Sources/CodingUsage/CodingUsageApp.swift:332–339,440–443`; `helper/usage-helper.mjs:69–78`.

3. **Tighten the existing output boundary.** Validate exact snapshot/error/check shapes, types, and bounded strings; redact email-like account labels while preserving useful generic account differentiation. Test both normal mappings and accidental plugin output. Relevant boundary: `helper/usage-helper.mjs:15–44`; label passthrough: `helper/collector.mjs:287,362`.

4. **Make installation reversible and narrowly scoped.** Document/add uninstall, confirm replacement, avoid broad process-name termination, and remove blanket extended-attribute clearing. Preserve explicit opt-in login installation (`scripts/install-login-item.sh:16–24,69–70`).

5. **Correct lock and restart housekeeping.** Use private lock permissions, distinguish contention from other lock errors, close failed lock descriptors, and clear partial stdout buffering when starting a new helper process (`Sources/CodingUsage/CodingUsageApp.swift:33–39,282,328–377,379–418`).

6. **Add fixture-based tests and accurate portability documentation.** Cover import isolation, output privacy, Codex expiry blocking, and lock failures without real credentials or provider requests. Document the private-plugin prerequisite, Node requirements, ad-hoc signing, fixed identity, and absent license; defer licensing/distribution identity decisions to the owner.

**Confidence:** high for the repository wiring and identified behavior. External provider implementations remain dependencies; endpoint facts above are accepted as supplied, not re-derived. This was an independent, read-only assessment of the supplied snapshot.

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 better-supported first action for restoring availability across providers while keeping empty-lock-file hardening proportionate. This is a weak, forced preference between substantially equivalent audits, not an established material quality gap; an independent review could reasonably prefer B's privacy-first ordering.

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_3e182550538894e26a9c7988d478c0e03a22e4f37b2a604b7c090797c677b5f3. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.