Skip to content

feat(quota-plane): adapter — ClinePass via dashboard session token #1159

Open

Description

@dezren39

Priority P1 — order 5a. Horizon: Week. Design: quota-plane-design-2026-10-26.md (usage-billing-hub goal files), Stage 2. Parent context: epic #1047. (§2) — on the token-adapter framework + gatherer from this epic.

ClinePass adapter: WorkOS session token -> app.cline.bot dashboard API (the endpoints behind Dashboard > Subscription): monthly/weekly/5h %, usage-credit balance, plan state. Replaces the daily manual dashboard read for this pool.
Acceptance: Cline rows refresh on the 15-minute tick; expiry surfaces as re-login needed, never as 0%.

Acceptance criteria

Activity

  1. developing-today commented on Oct 27, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Oct 27, 2026

    @dezren39
    MemberAuthor

    REVIEW FINDING (2026-10-26): this provider's adapter ALREADY EXISTS in OpenChamber's quota module (server/lib/quota/providers). Re-scope from "build adapter" to: wire the existing provider into the quota gatherer (#1151), verify it against the live account on the gatherer host (credential provenance is the open question, per #1155), fix gaps found, and confirm its output shape maps onto quota-current. Keep this issue open until the provider is arriving on the 15-minute tick.

  3. added
    kind/featureNew feature or capability request
    priority/highImportant and time-sensitive
    effort/mMedium: expected under 1 day of work
    source/humanFiled directly by a human
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Oct 28, 2026
  4. dezren39 commented on Oct 28, 2026

    @dezren39
    MemberAuthor

    Intake review

  5. added
    mode/onlineFully doable remotely: design, config, code, cloud
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 1, 2026
  6. 43 remaining items

  7. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  8. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 4, 2026
  9. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  10. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    Findings — the documented contract exposes windows only

    Verified 2026-11-04 against current main of both repos (laptop clones):

    1. One endpoint, one payload shape. A cross-repo search for api.cline.bot across developing-today/code and the OpenChamber fork finds exactly one endpoint: GET https://api.cline.bot/api/v1/users/me/plan/usage-limits → { data: { limits: [{ type, percentUsed, resetsAt }] } }. No subscription/plan/billing endpoint, and no plan or credit field, appears in any source file, test fixture, or doc in either repo; quota-plane-design-2026-10-26.md names no Cline endpoint beyond "app.cline.bot dashboard API".
    2. Both implementations agree. The aggregator adapter (pm-stack/aggregator/src/clinepass-adapter.ts, from PR feat(quota): ClinePass adapter on the token-adapter framework (#1159) #4659) maps data.limits only, and its fixtures (pm-stack/aggregator/test/clinepass-adapter.test.ts) model data: { limits: [...] } with nothing else. The OpenChamber source provider it was ported from (packages/web/server/lib/quota/providers/cline-pass.js) calls the same endpoint and returns usage.windows only.
    3. The target representation already exists — no contract work is owed. In pm-stack/aggregator/src/model.ts, QuotaCurrentEntry already carries planLabel?: string, and QuotaCurrentWindow explicitly anticipates a credits_balance window key whose value is null and whose balance rides in valueLabel (label-only rows). If the fields are ever exposed, mapping them is a small adapter change, not a design change.
    4. What source cannot settle: whether the live usage-limits envelope carries extra data fields beyond limits. That needs one credentialed probe recording field names/types only — task 8898 was explicitly scoped to exclude live credential/raw-payload access, so that probe is routed, not improvised here.

    Routing

    • Task 9233 (queued, repo-health-code-pilot): one shape-only live probe of the usage-limits envelope (field names/types only, no values recorded). If plan/credit fields are present → map them to planLabel / a credits_balance window with fixture tests. If absent → post the evidence here.
    • Acceptance decision needed if the probe comes back empty: the dashboard UI shows plan state and credit balance, but the session-token API contract available to the fleet would then be proven windows-only — feat(quota-plane): adapter — ClinePass via dashboard session token #1159's acceptance line "ClinePass rows (…, usage-credit balance, plan state)" would need amending to windows-only scope, or an alternative source for those two fields named. That call belongs to the issue owner; nothing here blocks the live 5h/weekly/monthly rows or the expiry-as-relogin semantics, which stay exactly as verified by task 7209.
  11. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

effort/mMedium: expected under 1 day of workkind/featureNew feature or capability requestmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedmeta/follow-upFollow-up spun out of earlier workmode/onlineFully doable remotely: design, config, code, cloudpriority/highImportant and time-sensitivequeue/claimedQueue worker lifecycle statesource/humanFiled directly by a humanstatus/in-progressQueue worker lifecycle statetask/triageQueue packet kind: verify, reproduce, and route this itemwork/assignedQueue worker lifecycle state

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions