Commit graph

2223 commits

Author SHA1 Message Date
Marshall Bowers
53849cf983
collab: Remove Zed Free as an option when initiating a checkout session (#31638)
This PR removes Zed Free as an option when initiating a checkout
session, as we manage this plan automatically now.

Release Notes:

- N/A
2025-05-28 23:00:54 +00:00
Marshall Bowers
469824c350
collab: Use StripeClient for creating model usage meter events (#31633)
This PR updates the `StripeBilling::bill_model_request_usage` method to
use the `StripeClient` trait.

Release Notes:

- N/A
2025-05-28 22:19:43 +00:00
Marshall Bowers
00bdebc89d
collab: Use StripeClient in StripeBilling::subscribe_to_price (#31631)
This PR updates the `StripeBilling::subscribe_to_price` method to use
the `StripeClient` trait.

Release Notes:

- N/A
2025-05-28 21:17:11 +00:00
Marshall Bowers
75e69a5ae9
collab: Use StripeClient to retrieve prices and meters from Stripe (#31624)
This PR updates `StripeBilling` to use the `StripeClient` trait to
retrieve prices and meters from Stripe instead of using the
`stripe::Client` directly.

Release Notes:

- N/A
2025-05-28 19:51:06 +00:00
Marshall Bowers
361ceee72b
collab: Introduce StripeClient trait to abstract over Stripe interactions (#31615)
This PR introduces a new `StripeClient` trait to abstract over
interacting with the Stripe API.

This will allow us to more easily test our billing code.

This initial cut is small and focuses just on making
`StripeBilling::find_or_create_customer_by_email` testable. I'll follow
up with using the `StripeClient` in more places.

Release Notes:

- N/A
2025-05-28 18:34:44 +00:00
Marshall Bowers
09fc64e0c5
collab: Downgrade non-collab queries to READ COMMITTED isolation level (#31552)
This PR downgrades a number of database queries that aren't part of the
actual collaboration from `SERIALIZABLE` to `READ COMMITTED`.

The serializable isolation level is overkill for these queries.

Release Notes:

- N/A
2025-05-27 17:02:27 -04:00
Marshall Bowers
fc803ce9d4
collab: Increase max database connections to 250 (#31553)
This PR increases the number of max database connections to 250.

Release Notes:

- N/A
2025-05-27 16:48:50 -04:00
Marshall Bowers
32848e9c8a
collab: Add support for overage billing for Claude Opus 4 (#31544)
This PR adds support for billing for overages for Claude Opus 4.

Release Notes:

- N/A
2025-05-27 18:37:57 +00:00
Marshall Bowers
8faeb34367
Rename assistant_settings to agent_settings (#31513)
This PR renames the `assistant_settings` crate to `agent_settings`, as
well a number of constructs within it.

Release Notes:

- N/A
2025-05-27 15:16:55 +00:00
Ben Kunkle
c0aa8f63fd
zlog: Replace usages of env_logger in tests with zlog (#31436)
Also fixes:
https://github.com/zed-industries/zed/pull/31400#issuecomment-2908165249

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-05-26 11:48:50 -04:00
Ben Brandt
ca72efe701
Add overdue invoices check (#31290)
- Rename current_user_account_too_young to account_too_young for
consistency
- Add has_overdue_invoices field to track billing status
- Block edit predictions when user has overdue invoices
- Add overdue invoice warning to inline completion menu

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-05-23 20:02:02 +00:00
Marshall Bowers
1683e2f144
collab: Prevent canceling the free plan (#31292)
This PR makes it so the Zed Free plan cannot be canceled.

We were already preventing this on the zed.dev side, but this will make
it more airtight.

Release Notes:

- N/A
2025-05-23 15:48:21 +00:00
Antonio Scandurra
9dba8e5b0d
Ensure client reconnects after erroring during the handshake (#31278)
Release Notes:

- Fixed a bug that prevented Zed from reconnecting after erroring during
the initial handshake with the server.
2025-05-23 15:46:30 +02:00
Antonio Scandurra
e88cad29e5
Reduce the amount of queries performed when updating plan (#31268)
Release Notes:

- N/A
2025-05-23 12:03:50 +00:00
smit
1cad1cbbfc
Add Code Actions to the Toolbar (#31236)
Closes issue #31120.


https://github.com/user-attachments/assets/a4b3c86d-7358-49ac-b8d9-e9af50daf671

Release Notes:

- Added a code actions icon to the toolbar. This icon can be disabled by
setting `toolbar.code_actions` to `false`.
2025-05-23 16:55:29 +05:30
Joseph T. Lyons
f435304209
Use read-only access methods for read-only entity operations (#31254)
This PR replaces some `update()` calls with either `read()` or
`read_with()` when the `update()` call performed read-only operations on
the entity.

Many more likely exist, will follow-up with more PRs.

Release Notes:

- N/A
2025-05-23 06:13:49 -04:00
Ben Brandt
508ccde363
Better messaging for accounts that are too young (#31212)
Right now you find this out the first time you try and submit a
completion.

These changes communicate much earlier to the user what the issue is
with their account and what they can do about it.

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2025-05-23 09:32:03 +00:00
Marshall Bowers
37f49ce304
collab: Add support for overage billing for Claude Sonnet 4 (#31206)
This PR adds support for billing for overages for Claude Sonnet 4.

Release Notes:

- N/A
2025-05-22 18:40:06 +00:00
Anthony Eid
1c9b818342
debugger: Use DAP schema to configure daps (#30833)
This PR allows DAPs to define their own schema so users can see
completion items when editing their debug.json files.

Users facing this aren’t the biggest chance, but behind the scenes, this
affected a lot of code because we manually translated common fields from
Zed's config format to be adapter-specific. Now we store the raw JSON
from a user's configuration file and just send that.

I'm ignoring the Protobuf CICD error because the DebugTaskDefinition
message is not yet user facing and we need to deprecate some fields in
it.

Release Notes:

- debugger beta: Show completion items when editing debug.json
- debugger beta: Breaking change, debug.json schema now relays on what
DAP you have selected instead of always having the same based values.

---------

Co-authored-by: Remco Smits <djsmits12@gmail.com>
Co-authored-by: Cole Miller <m@cole-miller.net>
Co-authored-by: Cole Miller <cole@zed.dev>
2025-05-22 05:48:26 -04:00
Marshall Bowers
eb35d25a7d
collab: Drop billing_events table (#31131)
This PR drops the `billing_events` table, as we're no longer using it.

Release Notes:

- N/A
2025-05-21 22:43:46 +00:00
Marshall Bowers
b829f72c17
collab: Prefer the plan on the subscription over the one on the usage (#31127)
This PR makes it so we always prefer the plan on the subscription.

The plan stored on the subscription usage is informational only.

Release Notes:

- N/A
2025-05-21 22:00:19 +00:00
Marshall Bowers
ffa8310d04
collab: Drop monthly_usages and lifetime_usages tables (#31124)
This PR drops the `monthly_usages` and `lifetime_usages` tables from the
LLM database, as they are no longer used.

Release Notes:

- N/A
2025-05-21 21:55:48 +00:00
Marshall Bowers
b444b326cb
collab: Remove GET /billing/monthly_spend endpoint (#31123)
This PR removes the `GET /billing/monthly_spend` endpoint, as it is no
longer used.

Release Notes:

- N/A
2025-05-21 21:30:12 +00:00
Marshall Bowers
3ee56c196c
collab: Add GET /users/look_up endpoint (#31059)
This PR adds a new `GET /users/look_up` endpoint for retrieving users by
various identifiers.

This endpoint can look up users by the following identifiers:

- Zed user ID
- Stripe Customer ID
- Stripe Subscription ID
- Email address
- GitHub login

Release Notes:

- N/A
2025-05-21 01:29:16 +00:00
Kirill Bulatov
16366cf9f2
Use anyhow more idiomatically (#31052)
https://github.com/zed-industries/zed/issues/30972 brought up another
case where our context is not enough to track the actual source of the
issue: we get a general top-level error without inner error.

The reason for this was `.ok_or_else(|| anyhow!("failed to read HEAD
SHA"))?; ` on the top level.

The PR finally reworks the way we use anyhow to reduce such issues (or
at least make it simpler to bubble them up later in a fix).
On top of that, uses a few more anyhow methods for better readability.

* `.ok_or_else(|| anyhow!("..."))`, `map_err` and other similar error
conversion/option reporting cases are replaced with `context` and
`with_context` calls
* in addition to that, various `anyhow!("failed to do ...")` are
stripped with `.context("Doing ...")` messages instead to remove the
parasitic `failed to` text
* `anyhow::ensure!` is used instead of `if ... { return Err(...); }`
calls
* `anyhow::bail!` is used instead of `return Err(anyhow!(...));`

Release Notes:

- N/A
2025-05-20 23:06:07 +00:00
Piotr Osiewicz
17cf04558b
debugger: Surface validity of breakpoints (#30380)
We now show on the breakpoint itself whether it can ever be hit.

![image](https://github.com/user-attachments/assets/148d7712-53c9-4a0a-9fc0-4ff80dec5fb1)

Release Notes:

- N/A

---------

Signed-off-by: Umesh Yadav <git@umesh.dev>
Co-authored-by: Anthony <anthony@zed.dev>
Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: Michael Sloan <michael@zed.dev>
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Agus Zubiaga <hi@aguz.me>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Agus Zubiaga <agus@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Co-authored-by: peppidesu <bakker.pepijn@gmail.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Ben Kunkle <ben.kunkle@gmail.com>
Co-authored-by: Jens Krause <47693+sectore@users.noreply.github.com>
Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
Co-authored-by: Max Nordlund <max.nordlund@gmail.com>
Co-authored-by: Finn Evers <dev@bahn.sh>
Co-authored-by: tidely <43219534+tidely@users.noreply.github.com>
Co-authored-by: Sergei Kartsev <kartsevsb@gmail.com>
Co-authored-by: Shardul Vaidya <31039336+5herlocked@users.noreply.github.com>
Co-authored-by: Chris Kelly <amateurhuman@gmail.com>
Co-authored-by: Peter Tripp <peter@zed.dev>
Co-authored-by: Umesh Yadav <23421535+imumesh18@users.noreply.github.com>
Co-authored-by: Julia Ryan <juliaryan3.14@gmail.com>
Co-authored-by: Cole Miller <m@cole-miller.net>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: william341 <wwokwilliam@gmail.com>
Co-authored-by: Liam <33645555+lj3954@users.noreply.github.com>
Co-authored-by: AidanV <aidanvanduyne@gmail.com>
Co-authored-by: imumesh18 <umesh4257@gmail.com>
Co-authored-by: d1y <chenhonzhou@gmail.com>
Co-authored-by: AidanV <84053180+AidanV@users.noreply.github.com>
Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
Co-authored-by: 张小白 <364772080@qq.com>
Co-authored-by: THELOSTSOUL <1095533751@qq.com>
Co-authored-by: Ron Harel <55725807+ronharel02@users.noreply.github.com>
Co-authored-by: Tristan Hume <tristan@anthropic.com>
Co-authored-by: Stanislav Alekseev <43210583+WeetHet@users.noreply.github.com>
Co-authored-by: Joseph T. Lyons <JosephTLyons@gmail.com>
Co-authored-by: Remco Smits <djsmits12@gmail.com>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Oleksiy Syvokon <oleksiy@zed.dev>
Co-authored-by: Thomas David Baker <bakert@gmail.com>
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Co-authored-by: Rob McBroom <github@skurfer.com>
Co-authored-by: CharlesChen0823 <yongchen0823@gmail.com>
2025-05-20 15:56:15 +00:00
Marshall Bowers
110195cdae
collab: Only create a Zed Free subscription if there is no other active subscription (#31023)
This PR makes it so we only create a Zed Free subscription if there is
no other active subscription, rather than just having another Zed Free
subscription.

Release Notes:

- N/A

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2025-05-20 15:00:10 +00:00
Marshall Bowers
051f49ce9a
collab: Cancel trials when they end with a missing payment method (#31018)
This PR makes it so we cancel trials instead of pausing them when they
end with a missing payment method.

Release Notes:

- N/A
2025-05-20 14:01:45 +00:00
Marshall Bowers
f73c8e5841
collab: Don't create a Zed Free subscription if one already exists in Stripe (#30983)
This PR adds a check for if a Zed Free subscription already exists in
Stripe before we try to create one.

Release Notes:

- N/A
2025-05-20 00:18:45 +00:00
Marshall Bowers
f7a0834f54
collab: Create Zed Free subscription when issuing an LLM token (#30975)
This PR makes it so we create a Zed Free subscription when issuing an
LLM token, if one does not already exist.

Release Notes:

- N/A

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2025-05-19 18:45:22 -04:00
Max Brunsfeld
83d513aef4
Continue processing Stripe events after seeing one that's > 1 day old (#30971)
This mostly affects local development. It fixes a bug where we would
only process one Stripe event per polling period (5 seconds) when
hitting old events.

Release Notes:

- N/A

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-05-19 20:17:54 +00:00
Marshall Bowers
b440e1a467
collab: Allow starting a trial from Zed Free (#30970)
This PR makes it so a user can initiate a checkout session for a Zed Pro
trial while on the Zed Free plan.

Release Notes:

- N/A

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2025-05-19 19:39:01 +00:00
Marshall Bowers
05f8001ee9
collab: Only subscribe to Zed Free if there isn't an existing active subscription (#30967)
This PR adds a sanity check to ensure that we only subscribe the user to
Zed Free if they don't already have an active subscription.

Release Notes:

- N/A
2025-05-19 18:26:54 +00:00
Marshall Bowers
b93c67438c
collab: Require product code for POST /billing/subscriptions (#30968)
This PR makes the `product` field required in the request body for `POST
/billing/subscriptions`.

We were already passing this everywhere, in practice.

Release Notes:

- N/A
2025-05-19 18:11:33 +00:00
Marshall Bowers
fdec966226
collab: Subscribe to Zed Free when a subscription is canceled or paused (#30965)
This PR makes it so that when a Stripe subscription is canceled or
paused we'll subscribe the user to Zed Free.

Release Notes:

- N/A
2025-05-19 17:35:03 +00:00
Marshall Bowers
d9f12879e2
collab: Add POST /billing/subscriptions/sync endpoint (#30956)
This PR adds a new `POST /billing/subscriptions/sync` endpoint that can
be used to sync a user's billing subscriptions from Stripe.

Release Notes:

- N/A
2025-05-19 10:01:53 -04:00
Marshall Bowers
c76295251b
collab: Factor out subscription kind determination (#30955)
This PR factors out the code that determines the `SubscriptionKind` into
a separate method for reusability purposes.

Release Notes:

- N/A
2025-05-19 13:22:56 +00:00
Piotr Osiewicz
0f17e82154
chore: Bump Rust to 1.87 (#30739)
Closes #ISSUE

Release Notes:

- N/A
2025-05-15 22:28:52 +00:00
Kirill Bulatov
471e02d48f
Separate timeout and connection dropped errors out (#30457) 2025-05-10 15:12:58 +03:00
Marshall Bowers
daa777440d
collab: Push down plan changes to the client (#30447)
This PR makes it so we push down plan updates from the server when the
user's subscription changes.

Release Notes:

- N/A
2025-05-10 00:08:48 +00:00
Marshall Bowers
f29c6e5661
Update zed_llm_client to v0.8.1 (#30433)
This PR updates the `zed_llm_client` crate to v0.8.1.

The name of `Plan::Free` changed to `Plan::ZedFree` in this version.

Release Notes:

- N/A
2025-05-09 21:08:03 +00:00
Marshall Bowers
8f07135201
collab: Don't require payment method to subscribe to Zed Free (#30398)
This PR makes it so we don't require a payment method to subscribe to
the Zed Free plan.

Release Notes:

- N/A
2025-05-09 17:11:37 +00:00
Marshall Bowers
cf8f003916
collab: Improve error message when requesting an LLM token without a subscription (#30405)
This PR improves the error message when trying to obtain an LLM token
without a subscription:

<img width="411" alt="Screenshot 2025-05-09 at 12 30 41 PM"
src="https://github.com/user-attachments/assets/c53326ba-4a99-4d9c-88ba-674e520f941f"
/>

Release Notes:

- N/A
2025-05-09 16:51:41 +00:00
Marshall Bowers
d270f6b953
collab: Require subscription_period in LLM token claims (#30392)
This PR makes the `subscription_period` field in the LLM token claims
required.

Release Notes:

- N/A
2025-05-09 15:20:14 +00:00
Marshall Bowers
822580cb12
collab: Check if the user has a payment method before upgrading to Zed Pro (#30310)
This PR adds a check for if the user has a payment method before
attempting to upgrade them to Zed Pro.

Release Notes:

- N/A
2025-05-08 20:58:36 +00:00
Cole Miller
8b764a5477
Add a test for remote tool use by the agent (#30289)
- Adds a new smoke test for the use of the read_file tool by the agent
in an SSH project
- Fixes the SSH shutdown sequence to use a timer from the app's executor
instead of always using a real timer
- Changes the main executor loop for tests to advance the clock
automatically instead of panicking with `parked with nothing left to
run` when there is a delayed task

Release Notes:

- N/A
2025-05-08 16:53:04 -04:00
Marshall Bowers
660b4cee76
collab: Add intent for updating payment method (#30306)
This PR adds a new `ManageSubscriptionIntent` for initiating a session
to update the user's payment method.

Release Notes:

- N/A
2025-05-08 20:17:19 +00:00
Marshall Bowers
6827bf114a
collab: Remove legacy claims from LLM token (#30294)
This PR removes some legacy claims related to the old billing from the
LLM token.

We already stopped reading this in the LLM Worker.

Also removed an outdated feature flag check that restricted access to
obtaining an LLM token.

Release Notes:

- N/A
2025-05-08 14:32:54 -04:00
Marshall Bowers
b343a8aa22
language_models: Improve subscription states in the Agent configuration view (#30252)
This PR improves the subscription states in the Agent configuration view
to the new billing system.

Zed Free (legacy):

<img width="638" alt="Screenshot 2025-05-08 at 8 42 59 AM"
src="https://github.com/user-attachments/assets/7b62d4c1-2a9c-4c6a-aa8f-060730b6d7b3"
/>

Zed Free (new):

<img width="640" alt="Screenshot 2025-05-08 at 8 43 56 AM"
src="https://github.com/user-attachments/assets/8a48448e-813e-4633-955d-623d3e6d603c"
/>

Zed Pro trial:

<img width="641" alt="Screenshot 2025-05-08 at 8 45 52 AM"
src="https://github.com/user-attachments/assets/1ec7ee62-e954-48e7-8447-4584527307c9"
/>

Zed Pro:

<img width="636" alt="Screenshot 2025-05-08 at 8 47 21 AM"
src="https://github.com/user-attachments/assets/f934b2e3-0943-4b78-b8dc-0a31e731d8fb"
/>

Release Notes:

- agent: Improved the subscription-related information in the
configuration view.
2025-05-08 09:10:50 -04:00
Marshall Bowers
6ac2f4e6a5
Remove assistant crate (#30168)
This PR removes the `assistant` crate, as it is no longer used.

Release Notes:

- N/A
2025-05-07 23:05:38 +00:00