Skip to content

Add CLIProxyAPI cost attribution - #2457

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

EClinick wants to merge 229 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 (972 selections, 81 groups, all passed on the first attempt; 0 retries/timeouts)
  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcrun swift test --disable-sandbox --skip-build --filter 'queue client blocks hostile redirects before redirected IO' (real loopback I/O; redirected endpoint received 0 requests and 0 bearer headers)
  • 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

Redirect final-effect proof

  • Ran the production CLIProxyAPIUsageQueueClient against two real ephemeral loopback HTTP servers with a redacted proof token.
  • The origin received one bearer-authenticated queue request and returned a hostile 307 redirect to the capture server.
  • The redirect guard refused the redirect before final I/O: the capture server received 0 requests and 0 Authorization headers.
  • No production credential, provider request, account state, or Keychain access was used.

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 September 3, 2026, 12:54 AM ET / 04:54 UTC.

ClawSweeper review

What this changes

This PR adds optional CLIProxyAPI management-queue collection so CodexBar can attribute Claude Code proxy usage to upstream providers in cost views, exports, and shared statistics.

Merge readiness

⛔ Blocked before merge - 12 items remain

Keep this PR open: it has an unresolved bearer-token exposure to an unauthenticated initial loopback listener and still fails to parse valid quoted alias-item keys. The supplied redirect scenario is useful but does not prove the configured attribution flow or rejection of the nearest unauthorized listener.

Priority: P1
Reviewed head: b5bee207f307ee8ab9f1b34c44c58bf58c9acadf
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The PR has substantial focused coverage, but an unresolved credential-boundary defect, a concrete parser defect, and insufficient end-to-end proof block merge readiness.
Proof confidence 🧂 unranked krab (1/6) Needs stronger real behavior proof before merge: Authority-chain proof required: the body reports a real hostile-redirect run, but the associated test proves only that a redirected target gets no request after the initial listener already received the bearer header. It does not prove rejection of the nearest unauthorized initial listener or a redacted configured CLIProxyAPI-to-attribution result; add that evidence and redact private endpoints, keys, and account data. Updating the PR body should trigger re-review; if it does not, ask a maintainer to comment @clawsweeper re-review. 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 🧂 unranked krab (1/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Authority-chain proof required: the body reports a real hostile-redirect run, but the associated test proves only that a redirected target gets no request after the initial listener already received the bearer header. It does not prove rejection of the nearest unauthorized initial listener or a redacted configured CLIProxyAPI-to-attribution result; add that evidence and redact private endpoints, keys, and account data. Updating the PR body should trigger re-review; if it does not, ask a maintainer to comment @clawsweeper re-review. 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 Initial request sends the management key: The new queue client adds the configured bearer key to its initial HTTP request; loopback-address validation does not authenticate the process listening on that address and port.
Redirect proof leaves initial-listener exposure: The included redirect test explicitly expects the initial loopback origin to receive one bearer header, while only proving that a redirected endpoint receives none.
Quoted block alias fields remain unsupported: The alias parser recognizes quoted section keys through simpleYAMLMappingKey, but block item fields are still matched only with literal name: and alias: prefixes; valid quoted fields therefore leave the route unresolved.
Findings 2 actionable findings [P1] Authenticate the initial loopback peer before sending the key
[P2] Parse quoted block-mapping alias fields
Security Needs attention Initial loopback listener can capture management key: Restricting the URL to loopback does not prove the listener is CLIProxyAPI. A competing local process can receive the management credential before redirect protection applies.

How this fits together

CodexBar scans local provider histories into cost snapshots used by the menu bar and Spend Dashboard. This PR adds a CLIProxyAPI telemetry source that resolves proxy-route provenance before those snapshots are published.

flowchart LR
A[Claude Code history] --> C[Attribution resolver]
B[CLIProxyAPI management queue] --> C
C --> D[Cost scanner]
D --> E[Usage snapshots]
E --> F[Spend Dashboard]
E --> G[Exports and shared stats]
Loading

Decision needed

Question Recommendation
Should CodexBar permit a management key to be sent to any process listening on a user-configured loopback URL, or require authenticated server identity before collection? Require authenticated endpoint identity: Adopt a pinned or mutually authenticated local-management contract and prove an impostor listener is rejected before it receives the key.

Why: Loopback location identifies a host, not the intended local process; the appropriate identity mechanism and compatibility contract require maintainer security judgment.

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Authority-chain proof required: the body reports a real hostile-redirect run, but the associated test proves only that a redirected target gets no request after the initial listener already received the bearer header. It does not prove rejection of the nearest unauthorized initial listener or a redacted configured CLIProxyAPI-to-attribution result; add that evidence and redact private endpoints, keys, and account data. Updating the PR body should trigger re-review; if it does not, ask a maintainer to comment @clawsweeper re-review. 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.
  • Authenticate the initial loopback peer before sending the key (P1) - The configured HTTP loopback URL identifies only an address, not the CLIProxyAPI process. Any process that wins the configured port receives the bearer key at this line; the redirect guard starts only after that request. The included redirect test confirms the initial server receives the header, so require trusted server identity before sending it.
  • Parse quoted block-mapping alias fields (P2) - Valid YAML such as - "name": gpt-5.5 followed by "alias": proxy-codex-alias reaches this branch but matches neither literal prefix, leaving the configured route unresolved. Parse the field key with simpleYAMLMappingKey, as the section and flow-mapping paths already do.
  • Resolve security concern: Initial loopback listener can capture management key - Restricting the URL to loopback does not prove the listener is CLIProxyAPI. A competing local process can receive the management credential before redirect protection applies.
  • Resolve merge risk (P1) - A local process that binds the configured loopback port can receive the persisted CLIProxyAPI management key before redirect protection is relevant.
  • Resolve merge risk (P1) - Quoted alias-item keys can silently prevent configured proxy attribution.
  • Resolve merge risk (P1) - GitHub currently reports the branch as conflicted with main, so final merge behavior needs a refreshed review after rebase.
  • Complete next step (P2) - Before merge, resolve the management-endpoint trust boundary and its final-effect proof, repair quoted alias-item keys, and refresh the conflicted branch against current main.
  • Improve patch quality - Adopt and implement an authenticated initial management-endpoint contract before sending the bearer key.
  • Improve patch quality - Add regression coverage for quoted block-item name and alias keys.
  • Improve patch quality - Add final-effect proof for the nearest unauthorized principal and, when authority persists, prove revocation or reassignment invalidates it before I/O.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

  • [P1] Authenticate the initial loopback peer before sending the key — Sources/CodexBarCore/CLIProxyAPIUsageTelemetry.swift:1433
  • [P2] Parse quoted block-mapping alias fields — Sources/CodexBarCore/CLIProxyAPIAttributionResolver.swift:707-710
  • [high] Initial loopback listener can capture management key — Sources/CodexBarCore/CLIProxyAPIUsageTelemetry.swift:1433
Agent review details

Security

Needs attention: The new local-management client sends a persisted bearer key to an unauthenticated initial loopback listener.

Review metrics

Metric Value Why it matters
Patch scope 68 files, +15,550 / -713 lines The large cross-layer change spans transport, persisted telemetry, attribution, UI, and extensive tests, so the security contract needs explicit review.

Merge-risk options

Maintainer options:

  1. Authenticate the initial management endpoint (recommended)
    Require a trusted endpoint identity before attaching the management key, then prove an impostor loopback listener receives no request or credential.
  2. Pause queue collection
    Do not merge the management-queue feature until CLIProxyAPI can provide an authenticated local-management contract.

Technical review

Best possible solution:

Use an authenticated or pinned management-endpoint contract before sending the key, parse quoted YAML item keys through the existing mapping-key helper, then demonstrate a redacted configured attribution run and forbidden-listener rejection.

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

Yes for both blockers from source: quoted block-item keys bypass the parser's mapping-key helper, and the queue client attaches the bearer key before any server identity check. The included real-loopback test additionally confirms that its initial listener receives that header.

Is this the best way to solve the issue?

No. Redirect blocking protects only a subsequent hop; it cannot authenticate the initial loopback peer. A trusted endpoint contract plus the narrow quoted-key parser repair is the safer solution.

Full review comments:

  • [P1] Authenticate the initial loopback peer before sending the key — Sources/CodexBarCore/CLIProxyAPIUsageTelemetry.swift:1433
    The configured HTTP loopback URL identifies only an address, not the CLIProxyAPI process. Any process that wins the configured port receives the bearer key at this line; the redirect guard starts only after that request. The included redirect test confirms the initial server receives the header, so require trusted server identity before sending it.
    Confidence: 0.98
  • [P2] Parse quoted block-mapping alias fields — Sources/CodexBarCore/CLIProxyAPIAttributionResolver.swift:707-710
    Valid YAML such as - "name": gpt-5.5 followed by "alias": proxy-codex-alias reaches this branch but matches neither literal prefix, leaving the configured route unresolved. Parse the field key with simpleYAMLMappingKey, as the section and flow-mapping paths already do.
    Confidence: 0.99

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 01da8fc6ea2d.

Labels

Label changes:

  • remove merge-risk: 🚨 compatibility: Current PR review merge-risk labels are merge-risk: 🚨 security-boundary.

Label justifications:

  • P1: The new management-key request can disclose an authority-bearing credential to an unintended local listener.
  • merge-risk: 🚨 security-boundary: Merging introduces a persisted management credential that is sent before the initial peer is authenticated.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: the body reports a real hostile-redirect run, but the associated test proves only that a redirected target gets no request after the initial listener already received the bearer header. It does not prove rejection of the nearest unauthorized initial listener or a redacted configured CLIProxyAPI-to-attribution result; add that evidence and redact private endpoints, keys, and account data. Updating the PR body should trigger re-review; if it does not, ask a maintainer to comment @clawsweeper re-review. 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

Security concerns:

  • [high] Initial loopback listener can capture management key — Sources/CodexBarCore/CLIProxyAPIUsageTelemetry.swift:1433
    Restricting the URL to loopback does not prove the listener is CLIProxyAPI. A competing local process can receive the management credential before redirect protection applies.
    Confidence: 0.98

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Zhongyue Lin: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (170 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-31T03:32:25.289Z sha 5576aeb :: needs real behavior proof before merge. :: [P1] Require acknowledged delivery before destructive queue reads
  • reviewed 2026-08-31T03:42:33.927Z sha 5576aeb :: needs real behavior proof before merge. :: [P1] Avoid destructive dequeue without acknowledged delivery
  • reviewed 2026-08-31T05:26:48.467Z sha 7dd482e :: needs real behavior proof before merge. :: [P1] Require acknowledged delivery before destructive dequeue | [P2] Strip inline comments before matching YAML section headers
  • reviewed 2026-08-31T15:44:28.959Z sha 65f36ab :: needs real behavior proof before merge. :: [P1] Authenticate the loopback peer before sending the management key | [P1] Require acknowledged delivery before destructive dequeue | [P2] Recognize bare-dash YAML sequence items
  • reviewed 2026-08-31T16:54:21.551Z sha 6926672 :: needs real behavior proof before merge. :: [P1] Authenticate the loopback peer before sending the management key | [P1] Require acknowledged delivery before destructive dequeue | [P2] Parse flow-style alias mappings
  • reviewed 2026-08-31T17:19:38.463Z sha 6926672 :: needs real behavior proof before merge. :: [P1] Authenticate the initial loopback peer before sending the management key | [P1] Avoid destructive dequeue without acknowledged delivery | [P2] Parse flow-style alias mappings
  • reviewed 2026-09-01T02:50:50.392Z sha 129a798 :: needs real behavior proof before merge. :: [P1] Authenticate the initial loopback peer before sending the management key | [P1] Avoid destructive dequeue without acknowledged delivery | [P2] Isolate attribution when startup finds no credential
  • reviewed 2026-09-01T14:58:31.820Z sha 7c19e3a :: needs real behavior proof before merge. :: [P1] Authenticate the initial loopback peer before sending the management key | [P2] Parse quoted YAML mapping keys before matching alias sections

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:

@EClinick

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 31, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@EClinick

Copy link
Copy Markdown
Contributor Author

@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: 69266723e1

ℹ️ 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
# Conflicts:
#	Sources/CodexBarCore/Generated/CodexParserHash.generated.swift
#	Sources/CodexBarCore/Vendored/CostUsage/CostUsageScanner+Claude.swift
#	Tests/CodexBarTests/PiSessionCostCompatibilityTests.swift
#	Tests/CodexBarTests/ProviderArchitectureGatekeeperTests.swift
@EClinick

EClinick commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@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: 129a798957

ℹ️ 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/UsageStore+CLIProxyAPI.swift
@EClinick

EClinick commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 1, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

# Conflicts:
#	Sources/CodexBarCore/Generated/CodexParserHash.generated.swift
#	Tests/CodexBarTests/PiSessionCostCompatibilityTests.swift
@EClinick

EClinick commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@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: 1a44434375

ℹ️ 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/UsageStore+SpendDashboardTokenCost.swift Outdated
@EClinick

EClinick commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@EClinick

EClinick commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 1, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@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: 1a44434375

ℹ️ 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
@EClinick

EClinick commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 7c19e3afbf

ℹ️ 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

EClinick commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@EClinick

EClinick commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Canonical ClawSweeper P2 (quoted YAML mapping keys) is fixed in dfb6159bd: alias section detection now parses mapping keys independently, with regression coverage for both quoted root and nested codex keys. Local validation: focused parser/architecture tests, make check, and all 1,008 test selections across 84 groups passed.

@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: dfb6159bdd

ℹ️ 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
@EClinick

EClinick commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@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: b5bee207f3

ℹ️ 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 on lines +707 to +710
} else if field.hasPrefix("name:") {
currentName = self.simpleYAMLScalar(String(field.dropFirst("name:".count)))
} else if field.hasPrefix("alias:") {
currentAlias = self.simpleYAMLScalar(String(field.dropFirst("alias:".count)))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Parse quoted alias item keys

When a valid YAML alias entry quotes its block-mapping keys, such as - "name": gpt-5.5 followed by "alias": proxy-codex-alias, neither prefix check recognizes the fields, so the configured Codex route is discarded and matching proxied usage can remain unresolved and disappear from both provider projections. Fresh evidence beyond the quoted section-key fix is that these item fields still bypass simpleYAMLMappingKey; parse their keys independently as the flow-mapping path already does.

AGENTS.md reference: AGENTS.md:L46-L46

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Valid finding. Quoted block-item keys still bypass simpleYAMLMappingKey, so a valid "name" / "alias" pair can remain unresolved. This run has reached the ship workflow’s three exact-head Codex review rounds, so I am carrying this as the first actionable fix for the next authorized cycle rather than starting a fourth push/review loop. Leaving the thread unresolved.

@steipete

Copy link
Copy Markdown
Owner

Thanks @EClinick for the attribution work and the extensive regression coverage. We’re closing this version after comparing it with current main.

Main now handles foreign-model Claude pricing, proxy response deduplication, incomplete proxy records, and GPT long-context thresholds. #3676 also prices OpenCodex records by their recorded provider. Those changes do not implement CLIProxyAPI upstream attribution, so this is not a claim that the whole feature has been superseded.

The remaining patch adds a destructive telemetry collector, credential and cache lifecycle, request-log correlation, and dashboard/export changes across 68 files. It also changes which unresolved foreign-model rows remain visible in Claude totals, and its pricing path needs to use the current recorded-provider catalog boundary. These require a separately scoped feature decision rather than a parser patch.

A future implementation should preserve client/provider/model/auth provenance, retain visible unknown attribution, keep global proxy history separate from account-owned history, and use the shared pricing and plugin-host architecture. We are not asking you to revise this large branch again.

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

Labels

merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P1 Urgent regression or broken agent/channel workflow affecting real users now. 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