Skip to content

Add ClinePass usage provider#2199

Closed
derekszen wants to merge 1 commit into
steipete:mainfrom
derekszen:feat/clinepass-provider
Closed

Add ClinePass usage provider#2199
derekszen wants to merge 1 commit into
steipete:mainfrom
derekszen:feat/clinepass-provider

Conversation

@derekszen

@derekszen derekszen commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add ClinePass as a first-class provider across the app, CLI, widget, diagnostics, provider registry, and documentation
  • expose ClinePass in Providers settings with an enable switch and secure API-key field backed by ~/.codexbar/config.json
  • use Cline's official bot mark from the published Cline brand assets for the provider icon
  • fetch subscription limits from GET https://api.cline.bot/api/v1/users/me/plan/usage-limits using Bearer authentication
  • display 5-hour, weekly, and monthly usage windows with reset timestamps
  • accept keys from provider config, CLINE_API_KEY, or CLINEPASS_API_KEY
  • update the public provider count from 59 to 60

Verification

  • swift test --filter ClinePassProviderLinuxTests
  • make test
  • ./Scripts/lint.sh lint-linux
  • node Scripts/check-site-locales.mjs
  • rendered ProviderIcon-clinepass.svg and visually confirmed the official Cline bot silhouette

Sources

Notes

The usage request is read-only. ClinePass is implemented directly as a CodexBar provider; the separate local AI Router shim is not part of this pull request or required by CodexBar.

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

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

statusLinkURL: nil),
branding: ProviderBranding(
iconStyle: .clinepass,
iconResourceName: "ProviderIcon-clinepass",

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 Add the bundled ClinePass provider icon

This descriptor points brand-icon loading at ProviderIcon-clinepass.svg, but the commit does not add that resource under Sources/CodexBar/Resources (verified with find). Any ClinePass entry rendered through ProviderBrandIcon.image(for:) returns nil, so icon-and-percent/sidebar/provider-card brand icon UI loses the icon and the existing ProviderIconResourcesTests all-provider resource check fails for .clinepass.

Useful? React with 👍 / 👎.

}

private struct ClinePassLimit: Decodable, Sendable {
let type: ClinePassLimitType

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 Ignore unknown ClinePass limit types

If the usage-limits API adds another entry to the limits array, decoding type through this closed enum makes JSONDecoder reject the entire response before the parser can use the known 5-hour/weekly/monthly entries. For an external endpoint where extra limit windows are additive, this should decode the raw string and skip unknown types so existing ClinePass usage does not break when a new limit kind appears.

Useful? React with 👍 / 👎.

@derekszen
derekszen force-pushed the feat/clinepass-provider branch from d39ba46 to 0ed01c4 Compare July 16, 2026 02:29
@derekszen
derekszen force-pushed the feat/clinepass-provider branch from 0ed01c4 to a178968 Compare July 16, 2026 03:05
@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. labels Jul 16, 2026
@clawsweeper

clawsweeper Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed July 15, 2026, 11:49 PM ET / July 16, 2026, 03:49 UTC.

Summary
Adds ClinePass as an API-key usage provider across the app, CLI, diagnostics, provider registry, tests, icon assets, and public documentation.

Reproducibility: not applicable. to the requested capability because this PR adds a provider rather than fixing broken current-main behavior. The parser finding is nevertheless source-reproducible by adding any unrecognized limits[].type value to the response fixture.

Review metrics: 1 noteworthy metric.

  • Integration footprint: 27 files; 745 added, 87 removed. The change spans fetching, credentials, app settings, CLI diagnostics, widget exhaustiveness, tests, icons, generated data, and localized website copy.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Make unknown limit types non-fatal and add a focused regression test.
  • Post redacted live evidence showing authentication, a successful fetch, and the displayed quota windows.

Proof guidance:

  • [P1] Needs real behavior proof before merge: Tests and icon rendering are supplemental only; add a redacted terminal screenshot, live output, logs, or app capture showing a real successful ClinePass fetch and mapped windows. After updating the PR body, a fresh review should run automatically; otherwise 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.

Risk before merge

  • [P1] If Cline adds another entry to limits[].type, this provider will report no usage even when the existing 5-hour, weekly, and monthly records remain valid.
  • [P1] Green tests do not establish that a real ClinePass key can access this endpoint or that the production response shape and reset timestamps match the fixtures.

Maintainer options:

  1. Decide the mitigation before merge
    Decode limit types as raw strings, ignore unknown entries while preserving recognized windows, add a regression fixture containing an extra type, and provide a redacted live CLI or app capture of a successful ClinePass fetch.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Wait for the contributor to fix the decoder and supply real ClinePass behavior proof, then re-review the exact head; an automated repair cannot satisfy the contributor-environment proof gate.

Security
Cleared: The diff adds no dependency, workflow, downloaded executable, or broadened permission surface and uses the repository’s existing provider-token handling pattern.

Review findings

  • [P2] Ignore unknown ClinePass limit types — Sources/CodexBarCore/Providers/ClinePass/ClinePassUsageFetcher.swift:64
Review details

Best possible solution:

Decode limit types as raw strings, ignore unknown entries while preserving recognized windows, add a regression fixture containing an extra type, and provide a redacted live CLI or app capture of a successful ClinePass fetch.

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

Not applicable to the requested capability because this PR adds a provider rather than fixing broken current-main behavior. The parser finding is nevertheless source-reproducible by adding any unrecognized limits[].type value to the response fixture.

Is this the best way to solve the issue?

No, not yet; the provider architecture is appropriate, but the decoder must tolerate additive API values and the production endpoint must be demonstrated before this becomes the narrowest reliable solution.

Full review comments:

  • [P2] Ignore unknown ClinePass limit types — Sources/CodexBarCore/Providers/ClinePass/ClinePassUsageFetcher.swift:64
    Decode type as a raw string and skip unrecognized values rather than using a closed Decodable enum. The earlier review concern remains on this head: one additive limit kind from the external API makes JSONDecoder reject the entire response, hiding every still-valid known window; add a regression fixture containing one unknown type.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P2: This is a bounded new-provider improvement with one normal-priority reliability defect and no demonstrated regression to existing providers.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Tests and icon rendering are supplemental only; add a redacted terminal screenshot, live output, logs, or app capture showing a real successful ClinePass fetch and mapped windows. After updating the PR body, a fresh review should run automatically; otherwise 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.

Label justifications:

  • P2: This is a bounded new-provider improvement with one normal-priority reliability defect and no demonstrated regression to existing providers.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Tests and icon rendering are supplemental only; add a redacted terminal screenshot, live output, logs, or app capture showing a real successful ClinePass fetch and mapped windows. After updating the PR body, a fresh review should run automatically; otherwise 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

What I checked:

Likely related people:

  • steipete: The new provider crosses the central descriptor, implementation-registry, settings, CLI, and documentation surfaces owned by this repository, making this the strongest available routing candidate. (role: repository owner and provider architecture reviewer; confidence: medium; files: docs/provider.md, Sources/CodexBarCore/Providers/ProviderDescriptor.swift, Sources/CodexBar/Providers/Shared/ProviderImplementationRegistry.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@steipete

Copy link
Copy Markdown
Owner

Thank you, @derekszen, for the original ClinePass implementation and test work. We landed #2219 as the canonical PR because it carried this implementation forward with the remaining lint and unknown-limit handling fixes; your authored commit and credit are preserved there.

@steipete steipete closed this Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants