Trial customer agent usage tracking and upgrade

Task 8922 · Done · Epic · created · updated

When a new customer is on trial, they signed up for some agents, but they are not paying for them for 14 days. Let's give them unlimited agents and keep a tally of what was the max until now compared to what they signed up for. Something like 10/3. This needs to be web researched and analyzed and graphically represented in the sidebar with an unobtrusive Upgrade button that allows to increase the number of agents workin.

Subtasks

  • [business_analysis] Trial customer agent usage tracking and upgrade Done
    PRD settled after 3 interview rounds. During a per-agent trial the cap lifts to plan max, or a per-plan trial ceiling (default 10). Peak demand (running + plan-held) is tracked as peak/signed-up in the sidebar for all members. Admins get Upgrade, billed at conversion. 3-day warning. 10 oracled criteria. Memory: none applied.
  • [architecture] Trial customer agent usage tracking and upgrade Done
    New "trial" cap source in caps_of (orgs.agents_trial_until mirror), placer records running+cap-held peak; meter endpoint + sidebar; agent change opened in trial (no proration). Children: C1 cap/peak/API, C2 ceiling editor, C3 trial agent change, C4 meter. Memory: none applied.
  • [plan] Trial customer agent usage tracking and upgrade Done
    Split along the Architecture's C1–C4 seams into 4 coder children over 3 phases: Foundation is C1 (cap, peak, API) and C3 (trial agent change), then C2 (ceiling editor), then C4 (sidebar meter and the integrated pass). Done-checks are tighter than the PRD: trial billing copy, screenshots in both themes, and the bar-fill ratio. Memory: none applied.
  • Trial agent cap, peak, meter API Done
    Trial agent cap (plan max → ceiling → 10), peak-demand tally and GET /api/org/plan/trial-agents merged (#6614, f49b90d); quick gate and changed-area tests green; dev deploy ok — cap 10/trial and meter verified on dev; the dispatch legs were not run on dev (the fixture tenant has no node). Fixtures: plan trialagents, org t8937-trial-agents. Visual check done: Trial hint renders cleanly. Memory: none applied.
  • Open agent change during trial Done
    Trial agent-count change (both ways, unprorated, $0; trial end bills new count) + dialog "Nothing now" line. Quick gate, 1275 billing tests, Vitest green; Stripe test clock: 3→8 billed $160 at conversion. Merged #6611 (2ad8286); its deploy superseded. Dev Owner check deferred (needs deploy + trial fixture). Visual check done locally: readable on desktop/phone. Memory: proposed 1 gotcha.
  • Trial agent ceiling in editor Done
    Trial agent ceiling in the plan editor (API field + server default; shown only for per-agent trial plans; blank = default; 0 refused). Quick gate and changed-area tests green; #6616 merged (a4678b7), deploy ok; dev check: set 5, reload showed 5, restored. Visual check done: clean on desktop and phone. Memory: none applied.
  • Sidebar trial meter with Upgrade Done
    Sidebar trial meter (rail, collapsed, More sheet) with Owner/Admin Upgrade into Change agents; merged #6618 (af62316), quick gate + Vitest + 448px Playwright green, dev deploy ok. Visual check done: clean light/dark locally and on dev (0 / 3, 46d). Dev dispatch/peak legs not run: fixture has no node. Memory: none applied.
  • [finish] Trial customer agent usage tracking and upgrade Done
    All 4 coders merged (#6611/#6614/#6616/#6618), BA/arch/plan settled; meter + Upgrade reachable and clean on dev. Gap: Upgrade prefills 1 below 3 bought → follow-up 8957. Peak/warning not dev-exercised (no fixture node), test-covered. Memory: none applied.
  • Trial meter Upgrade never prefills below the agents Done
    Trial meter Upgrade now prefills max(peak, bought+1) clamped to plan max; Vitest table (5 cases) green, quick gate green, PR #6619 merged (69e9318a), Jaah Deploy succeeded. Dev check done: T8937 Upgrade shows 4 (was 1). Memory: none applied.

Artifacts

Activity

  • Created
  • Runner started
  • Ready
  • Ready
  • Ready
  • Runner started
  • Awaiting response
  • Awaiting response
  • Awaiting response
  • Awaiting response
  • Awaiting response
  • Runner resumed
  • Awaiting response
  • Awaiting response
  • Awaiting response
  • Awaiting response
  • Awaiting response
  • Runner resumed
  • Awaiting response
  • Awaiting response
  • Runner resumed
  • Runner ended (done)
  • Runner started
  • Awaiting response
  • Awaiting response
  • Awaiting response
  • Awaiting response
  • Runner resumed
  • Runner ended (done)
  • Runner started
  • Draft
  • Draft
  • Draft
  • Draft
  • Draft
  • Ready
  • Ready
  • Ready
  • Ready
  • Ready
  • Runner ended (done)
  • Runner started
  • Runner started
  • Runner ended (done)
  • Runner ended (done)
  • Runner started
  • Runner ended (done)
  • Runner started
  • Runner ended (done)
  • Runner started
  • Ready
  • Runner ended (done)
  • Runner started
  • Runner ended (done)
  • Runner ended (done)