Add opt-in SSH costs for Claude and Codex - #3545
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Mac cost reports cannot currently show native Codex history from a remote Linux or macOS host. Add separate per-host estimates to the native menu and Usage & Spend, with explicit SSH aliases and a CLI --remote mode. Reuse the existing cost scanner and send only compact summary JSON. Preserve host calendars, pricing provenance, unknown costs, and incomplete coverage. Keep local totals independent, fail per host, and cancel or discard reports when the configured hosts or history window change. Do not sum overlapping histories or copy raw transcripts, session identifiers, or account metadata. Document the opt-in protocol and updated-CLI requirement. Extend existing tests for validation, scoped failures, cancellation, menu integration, and native controls; relocate unchanged architecture-catalog source anchors. Validation: make check passed with zero violations; make test passed all 89 groups without retries or timeouts. Linux ARM64 CLI build, real Mac-to-DGX SSH reports, and native Apply/error/disconnect interactions also passed. Requires updated CodexBar on the remote host. Reports remain API-equivalent estimates and deliberately do not combine overlapping host histories. Refs: steipete#3036
Remote cost configuration reused whole-target lowercase deduplication, so Alice@server and alice@server collapsed into one account. Normalize only the hostname in the shared SSH helper, preserving distinct usernames for both remote cost reports and live sessions. Extend the existing target checks to retain both accounts while still deduplicating hostname case variants. Exercise empty and legacy stored preferences to confirm remote costs require separate opt-in and preserve existing agent-session settings. Validation: the two identity regressions failed before the fix and pass after it; 39 focused tests, make check, Linux ARM64 CLI build, real Mac-to-DGX SSH success/failure checks, and native Apply persistence all pass. Full make test (group size 48): all 1,060 selections / 23 groups passed on the first attempt, with no retries or timeouts. The PR remains a draft pending maintainer approval of the CLI/native polling scope. No production app or remote CLI was permanently replaced.
|
Codex review: blocked before merge. Reviewed September 11, 2026, 1:50 PM ET / 17:50 UTC (Revision 10). ClawSweeper reviewWhat this changesAdds optional SSH cost reports for Claude and Codex, saved host controls, separate CLI reports, and selectable combined totals with stacked charts. Merge readiness⛔ Blocked before merge - 5 items remain This remains useful work absent from main. The updated proof is sufficient, but the remote-only chart repair is incomplete and its new fallback misstates coverage. Priority: P2 Review scores
Verification
How this fits togetherCodexBar reads local provider histories to estimate token usage and cost. This change runs the remote CodexBar CLI over SSH, validates numeric summaries, and feeds them into native reports and charts alongside local estimates. flowchart LR
A[Saved SSH hosts] --> B[Opt-in refresh scheduler]
B --> C[System SSH and remote CLI]
C --> D[Validated provider summaries]
D --> E[Separate host reports]
D --> F[Selected combined estimates]
G[Local cost history] --> F
F --> H[Native cost charts]
Decision needed
Why: VISION.md requires feature sign-off, the contributor explicitly awaits it, and the overlapping proposal does not settle the double-counting tradeoff. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep per-host estimates independently usable and approve an explicit accounting contract before offering combined charts, with remote-only access and missing-source coverage handled consistently. Do we have a high-confidence way to reproduce the issue? Yes, by source inspection: selected SSH history with empty local daily history fails the outer menu check, and the missing-local fallback defaults coverage to complete. No runtime tests were executed during this read-only review. Is this the best way to solve the issue? Unclear overall: reusing the remote CLI and retaining bounded per-host summaries is sound, but additive accounting needs approval and the chart integration still has two concrete defects. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1c4650d1b421. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (9 earlier review cycles; latest 8 shown)
|
6098762 to
d5431e3
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Addressed all three actionable findings from the latest review on
I added focused regression coverage, reran the full 1,070-test harness cleanly in 90/90 groups, and rebuilt/launched the exact branch. The PR now uses live screenshots from that binary for both the stacked local + SSH Claude chart and the SSH cost settings. I also removed the PR-body port/builds-on framing and the auto-closing issue language while preserving the original commit authorship. The PR remains draft for the maintainer decision on additive same-account estimates and the documented double-counting tradeoff. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Summary
cost --remoteand--summary-onlyto Claude, Codex, and both.Safety
Live UI proof
Exact-branch Claude cost history with this Mac in orange and the selected SSH device in the configured cyan color:
Exact-branch settings with
sandboxselected for SSH costs and same-account combination while Agent Sessions remains independent:Verification
3abd4ca6: built, packaged, and launched the app, then captured both screenshots from that running binary.git diff --checkpass for the touched code; all repository-ownedmake checkgates pass. The final TypeScript wrapper still encounters an unrelated parent/Users/kelashik/node_modules/@types/nodeinstallation missingundici-types; the project passes with an isolated empty type root.sandbox: fresh 90-day JSON returned both providers and dated daily buckets, including 249,005,023 Codex tokens / $353.61 and 6,956,682,068 Claude tokens / $4,164.95. The screenshots show those SSH buckets reaching the receiving chart path; host identity is omitted from published proof.This remains a draft pending maintainer scope approval for additive same-account estimates.