Skip to content

Add CLIProxyAPI cost attribution - #2457

Open
EClinick wants to merge 123 commits into
steipete:mainfrom
EClinick:task/ec/codex-proxy-attribution
Open

Add CLIProxyAPI cost attribution#2457
EClinick wants to merge 123 commits into
steipete:mainfrom
EClinick:task/ec/codex-proxy-attribution

Conversation

@EClinick

@EClinick EClinick commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • attribute Claude Code sessions routed through CLIProxyAPI using endpoint, installation, inventory, and request-log evidence
  • price confirmed proxied GPT usage in Codex totals while preserving route, backend, and auth provenance
  • surface proxy attribution in the spend dashboard and collect bounded CLIProxyAPI telemetry
  • serialize destructive telemetry collection and preserve full dashboard and synthetic-project attribution identities
  • keep proxy telemetry present for scoped callers while loading it exactly once beside account-scoped dashboard sources
  • persist each destructive queue batch before the next pop and surface cache-write failures
  • enforce the 366-day telemetry retention cutoff even when the proxy queue is empty
  • preserve request-log attribution beyond the newest 500 files
  • load the siloed proxy source for Claude-only dashboard configurations
  • retain Claude-only proxy spend through forced-refresh reconciliation
  • skip telemetry cache rewrites when an empty queue poll leaves the cache unchanged
  • filter expired telemetry during cache reads even when collection is unavailable
  • make request-log attribution loading cancellation-aware in full and cached scan paths
  • price aliased proxy usage from the telemetry-resolved upstream model
  • quarantine unresolved known foreign models from Claude totals while preserving confirmed non-Codex proxy attribution
  • refresh and retry proxy-only scans when a telemetry-confirmed upstream model is still unpriced
  • request refreshed pricing for the telemetry-resolved upstream model when its Claude-facing alias differs
  • resolve OpenAI-compatible proxy models across vendor catalogs after refresh instead of treating transport as vendor
  • keep global CLIProxyAPI supplemental usage out of account-scoped Codex scans
  • index retained proxy telemetry by canonical model and binary-search its bounded timestamp window
  • cache parsed CLIProxyAPI request logs by path, modification date, and size while pruning deleted paths
  • preserve explicit full-rescan semantics by bypassing the request-log cache when forced
  • resolve the default CLIProxyAPI home when hydrating cached spend through the production cache-root initializer
  • prefer timestamped request-log observations over undated fallbacks during telemetry correlation
  • migrate cost caches and add cross-provider regression coverage

Verification

  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer make check
  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer make test (725 selections, 61 groups, all passed on the first attempt)
  • swift test --filter SpendDashboardProxyAttributionTests
  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test --filter CLIProxyAPIAttributionResolverTests (24 tests)
  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test --filter CostUsageFetcherCacheSnapshotTests (13 tests)
  • swift test --filter CostUsageFetcherTests (18 tests)
  • focused resolver and fetcher suites together (40 tests)
  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test --filter CostUsageFetcherUnknownModelPricingTests (7 tests)
  • swift test --filter SpendDashboardCodexProxySourceTests (2 tests)
  • swift test --filter SpendDashboardForceStateMachineTests (14 tests)
  • focused resolver, proxy-source, and dashboard-controller suites (47 tests)
  • focused SpendDashboardTokenProvenanceTests, SpendDashboardControllerTests, CostUsageCacheTests, and CostUsageScannerClaudeFableTests

Remaining proof

  • A redacted live CLIProxyAPI-routed Claude Code run has not been collected in this PR. Automated tests use isolated fixtures and stubbed queue clients; they do not claim production-account or Keychain validation.

Copilot AI review requested due to automatic review settings July 25, 2026 23:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c82dab5a6d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/CLIProxyAPIAttributionResolver.swift Outdated
Comment thread Sources/CodexBarCore/CLIProxyAPIUsageTelemetry.swift Outdated
Comment thread Sources/CodexBar/SpendDashboardModel.swift Outdated
Comment thread Sources/CodexBarCore/CostUsageFetcher.swift
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Jul 26, 2026
@clawsweeper

clawsweeper Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed August 12, 2026, 5:14 AM ET / 09:14 UTC.

ClawSweeper review

What this changes

Adds CLIProxyAPI telemetry and request-log correlation so Claude Code usage routed through a proxy can be priced and displayed under its verified upstream provider.

Merge readiness

Blocked until real behavior proof from a real setup is added - 10 items remain

Keep open: current main does not provide this attribution feature, but the branch still depends on the removed JSON cost-cache path and has no real routed-run proof. The feature also needs a maintainer decision on owning a CLIProxyAPI endpoint/key configuration in CodexBar.

Priority: P2
Reviewed head: 8441b9a65a36b03b6838623bf58ae520ed31f5a0
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The branch has substantial test coverage, but an unresolved current-main persistence blocker and missing real behavior proof make it unready to merge.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: The PR explicitly provides fixture and stubbed-client tests only; it needs a redacted after-fix CLIProxyAPI-routed run showing the resulting dashboard attribution before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR explicitly provides fixture and stubbed-client tests only; it needs a redacted after-fix CLIProxyAPI-routed run showing the resulting dashboard attribution before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Current storage boundary: Current main defines the SQLite-backed CostUsageStore as the single-writer persistence layer for Codex cost scanning.
Current fetcher uses SQLite store: Current main reads Codex cache state through CostUsageStoreAccess, not the former JSON cache helper.
Branch retains removed cache API: The proposed supplemental proxy scan reads CostUsageCacheIO, which has no current-main references and must be ported to the SQLite store during the rebase.
Findings 1 actionable finding [P1] Port proxy cache reads to CostUsageStore
Security None None.

How this fits together

CodexBar scans local provider histories and cached telemetry to calculate costs, then supplies provider and model rows to the spend dashboard. This PR adds proxy logs and telemetry as a supplemental source for assigning Claude Code activity to an upstream provider.

flowchart LR
A[Claude Code history] --> C[Proxy attribution]
B[Proxy logs and telemetry] --> C
C --> D[Cost report generation]
D --> E[Persistent cost store]
E --> F[Spend dashboard]
F --> G[Shared statistics]
Loading

Decision needed

Question Recommendation
Should CodexBar own a built-in CLIProxyAPI endpoint/key configuration and cross-provider cost-attribution feature? Sponsor a narrowed integration: Keep the feature, but require a rebase onto the SQLite cost store and real routed-run proof before merge.

Why: The PR adds durable credentials, a settings workflow, and a new attribution policy rather than repairing an established contract; maintainers must choose the supported product boundary before a large rebase lands.

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR explicitly provides fixture and stubbed-client tests only; it needs a redacted after-fix CLIProxyAPI-routed run showing the resulting dashboard attribution before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Port proxy cache reads to CostUsageStore (P1) - Current main no longer contains CostUsageCacheIO; it reads Codex scan state through CostUsageStoreAccess. This supplemental path still loads the old JSON cache, so the dirty branch cannot be safely rebased or merged without porting proxy attribution and its cache lifecycle to the SQLite store. This repeats the outstanding prior P1 finding.
  • Resolve merge risk (P1) - The branch's JSON cache reads and directory-level cache lifecycle are incompatible with current main's SQLite CostUsageStore boundary; a mechanical conflict resolution could lose the intended proxy attribution or regress current persistence semantics.
  • Resolve merge risk (P1) - This adds a user-configured proxy endpoint and management-key flow, so provider attribution and credential ownership need explicit product approval.
  • Resolve merge risk (P1) - Only mocked and fixture-based verification is present; live provider routing and resulting dashboard attribution are unproven.
  • Complete next step (P2) - A maintainer must first sponsor the new credential/configuration surface; the required persistence port and contributor-owned real-run proof are not safe automated repairs.
  • Improve patch quality - Rebase and port proxy reads, writes, and cache-clear behavior to CostUsageStore with focused migration coverage.
  • Improve patch quality - Add a redacted live CLIProxyAPI-routed Claude Code run showing the dashboard attribution; remove keys, endpoints, and personal data.
  • Improve patch quality - Obtain maintainer sponsorship for the new proxy configuration and attribution policy.

Findings

  • [P1] Port proxy cache reads to CostUsageStore — Sources/CodexBarCore/CostUsageFetcher.swift:609-612
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Patch size 44 files; production +4,982, tests +6,209 The feature spans storage, scanning, credentials, dashboard presentation, CLI behavior, and extensive tests, making current-main integration especially important.

Merge-risk options

Maintainer options:

  1. Port persistence onto the current store (recommended)
    Rebase the proxy attribution flow onto CostUsageStore and add focused upgrade and cache-clear coverage before merging.
  2. Pause pending product sponsorship
    Defer the PR if maintainers do not want CodexBar to own CLIProxyAPI credentials and attribution policy.

Technical review

Best possible solution:

Sponsor a narrowed, rebased implementation that stores and reads proxy attribution through the current cost-store boundary, preserves provider silos, and includes a redacted live CLIProxyAPI-routed dashboard proof.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a pre-existing bug: this PR adds new attribution behavior, and its supplied evidence is fixture-based rather than a real CLIProxyAPI-routed setup.

Is this the best way to solve the issue?

No. The current branch is not the best merge path because it still uses the retired JSON cache API; porting the feature to the SQLite cost-store boundary is the narrower maintainable approach.

Full review comments:

  • [P1] Port proxy cache reads to CostUsageStore — Sources/CodexBarCore/CostUsageFetcher.swift:609-612
    Current main no longer contains CostUsageCacheIO; it reads Codex scan state through CostUsageStoreAccess. This supplemental path still loads the old JSON cache, so the dirty branch cannot be safely rebased or merged without porting proxy attribution and its cache lifecycle to the SQLite store. This repeats the outstanding prior P1 finding.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a90dfed5c264.

Labels

Label justifications:

  • P2: This is a substantial optional spend-accounting feature without evidence of a current core-runtime outage.
  • merge-risk: 🚨 compatibility: The branch retains a superseded cache API while current main uses a SQLite single-writer cost store.
  • merge-risk: 🚨 auth-provider: The feature persists proxy connection settings and maps usage to authenticated upstream provider identities.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR explicitly provides fixture and stubbed-client tests only; it needs a redacted after-fix CLIProxyAPI-routed run showing the resulting dashboard attribution before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • steipete: Peter Steinberger authored recent atomic cost-cache-save fixes on the current persistent-store boundary. (role: recent cost-store contributor; confidence: high; commits: 6bf0dc4aafd8, c735150bef29; files: Sources/CodexBarCore/Vendored/CostUsage/CostUsageStore.swift, Sources/CodexBarCore/Vendored/CostUsage/CostUsageStore+CodexCache.swift)
  • Yuxin Qiao: Yuxin Qiao recently refined the identical-save behavior that the current cost-store persistence path uses. (role: recent adjacent contributor; confidence: medium; commits: c9c727e10f8a; files: Sources/CodexBarCore/Vendored/CostUsage/CostUsageStore+CodexCache.swift)
  • Robert: Robert recently fixed the cost-store executor behavior on supported macOS versions. (role: recent adjacent contributor; confidence: medium; commits: b3c1bfa390a9; files: Sources/CodexBarCore/Vendored/CostUsage/CostUsageStore.swift)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (117 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-08T11:28:07.411Z sha c694017 :: needs real behavior proof before merge. :: [P2] Invalidate the proxy row after a generation-cancelled load
  • reviewed 2026-08-08T13:47:31.658Z sha c694017 :: needs real behavior proof before merge. :: [P2] Invalidate the proxy source after a cancelled load
  • reviewed 2026-08-08T16:56:33.311Z sha c694017 :: needs real behavior proof before merge. :: [P2] Invalidate the proxy source when its load is cancelled
  • reviewed 2026-08-08T17:10:37.046Z sha c694017 :: needs real behavior proof before merge. :: [P2] Invalidate the proxy source after a cancelled load
  • reviewed 2026-08-08T22:58:33.064Z sha c694017 :: needs real behavior proof before merge. :: [P2] Invalidate the proxy source after a cancelled scan
  • reviewed 2026-08-09T05:44:16.041Z sha c694017 :: needs real behavior proof before merge. :: [P2] Invalidate the proxy source after a cancelled scan
  • reviewed 2026-08-09T13:41:06.621Z sha 8441b9a :: needs real behavior proof before merge. :: [P1] Rebase proxy persistence onto the current SQLite cost store
  • reviewed 2026-08-09T14:16:07.984Z sha 8441b9a :: needs real behavior proof before merge. :: [P1] Rebase proxy persistence onto the SQLite cost store

Copy link
Copy Markdown
Contributor Author

@codex review

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 27, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c3bedb05f8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/CostUsageFetcher.swift Outdated
Comment thread Sources/CodexBarCore/CLIProxyAPIUsageTelemetry.swift Outdated
Comment thread Sources/CodexBarCore/CLIProxyAPIUsageTelemetry.swift Outdated

Copy link
Copy Markdown
Contributor Author

Follow-up fixes are pushed in 0f4bda0 and the three current review threads have been addressed.

@codex review
@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 27, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0f4bda0d9a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/CLIProxyAPIUsageTelemetry.swift Outdated

Copy link
Copy Markdown
Contributor Author

The current-head retention finding is fixed in e9b111e and its review thread is addressed.

@codex review
@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 27, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e9b111ef6c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/CLIProxyAPIAttributionResolver.swift Outdated
Comment thread Sources/CodexBar/SpendDashboardController.swift Outdated
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 27, 2026
@EClinick

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@EClinick

Copy link
Copy Markdown
Contributor Author

@codex review

@clawsweeper

clawsweeper Bot commented Jul 27, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added the P2 Normal priority bug or improvement with limited blast radius. label Aug 4, 2026
@EClinick

EClinick commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the canonical ClawSweeper missing-credential removal finding in 65cfa9a. Removal now accepts both an actually removed credential and an already-missing credential, while preserving rollback for genuine clear failures. Added a concurrent-removal regression; 31 focused tests, make check, and all 824 full-suite selections across 69 groups pass.

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 65cfa9aadf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/CLIProxyAPIUsageTelemetry.swift Outdated
@EClinick

EClinick commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Integrated the latest upstream main provider-plugin and ProviderInstanceID changes, resolving the UsageStore.swift conflict while preserving CLIProxyAPI telemetry collection and cost-cache clearing. Adapted the affected cache dictionaries to upstream instance IDs and moved the retry helper into the token-cost extension to keep the merged file within lint limits.

Verification on this exact head:

  • make check (0 SwiftFormat changes; 0 SwiftLint violations)
  • focused CLIProxyAPIUsageCacheTests (31 tests, 2 suites)
  • full make test (828 selections, 69 groups, 0 failures/retries/timeouts)

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 112461d4bc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBar/ShareStatsPayload.swift
@EClinick

EClinick commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

Please review exact head 06312e5e. This update keeps replacement telemetry isolated if credential rollback fails and exports CLIProxyAPI model rows under their verified upstream provider. Local verification: make check; focused proxy/share tests (48 passed); full make test (828 selections, 69 groups, zero failures/retries/timeouts).

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 06312e5e53

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/CLIProxyAPIUsageTelemetry.swift Outdated
@EClinick

EClinick commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The two findings from canonical comment 5081410241 were fixed in exact head 06312e5, the required exact-head Codex review completed cleanly, and the automatic canonical refresh did not follow after approximately 15 minutes. Please update the same durable comment for this head.

@clawsweeper

clawsweeper Bot commented Aug 4, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 session-state 🚨 Merging this PR could lose, corrupt, stale, or mis-associate session or agent state. labels Aug 4, 2026
@EClinick

EClinick commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Fixed both rollback findings from the canonical ClawSweeper checklist on head 1a66672:

  • Save rollback now marks the staged telemetry transaction for recovery before restoring credentials and the disconnect marker.
  • Removal rollback uses the same recovery marker, so a marker-reset failure cannot make staged artifacts look committed.
  • Added focused tests for both failed marker-rollback paths and next-lock recovery.

Verification: focused CLIProxyAPIUsageCacheTests passed; make check passed; full make test passed all 828 selections across 69 groups with no retries or failures.

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1a66672e28

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBarCore/CostUsageCacheLocations.swift
@EClinick

EClinick commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the exact-head Codex P2 on c694017:

  • Journal credential-rollback success in the artifacts transaction manifest before marker and artifact rollback.
  • Recovery restores staged old telemetry only when credential restoration was durably recorded.
  • If credential rollback was not confirmed, recovery discards the staged old telemetry and keeps the integration explicitly disconnected.
  • Extended the failed-credential rollback test through the next-lock recovery path.

Verification: focused CLIProxyAPIUsageCacheTests passed; make check passed; full make test passed all 828 selections across 69 groups with no retries or failures. Both handled Codex threads have disposition replies and are resolved.

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c694017bf6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBar/SpendDashboardController.swift
@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 Merging this PR could lose, corrupt, stale, or mis-associate session or agent state. and removed merge-risk: 🚨 session-state 🚨 Merging this PR could lose, corrupt, stale, or mis-associate session or agent state. labels Aug 6, 2026

EClinick commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the canonical ClawSweeper P2 cancellation finding in 8441b9a6: a cancelled CLIProxyAPI snapshot load now invalidates codex:cliproxyapi, so the controller cannot retain stale proxy spend across a configuration boundary. Added a retained-row regression test; focused tests, repository checks, and all 828 test selections pass.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 8441b9a65a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

EClinick commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Canonical finding fixed on exact head 8441b9a65a36b03b6838623bf58ae520ed31f5a0; the automatic review workflow completed but durable comment 5081410241 did not refresh.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 9, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants