Skip to content

Commit b920b83

Browse files
committed
Merge branch 'main' into opus-4.6
2 parents 4b76bc0 + f8383bc commit b920b83

File tree

22 files changed

+3208
-192
lines changed

22 files changed

+3208
-192
lines changed

.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ NEXTAUTH_SECRET=dummy_nextauth_secret_at_least_32_chars_long
1616
# Payment (Stripe)
1717
STRIPE_SECRET_KEY=sk_test_dummy_stripe_secret
1818
STRIPE_WEBHOOK_SECRET_KEY=whsec_dummy_webhook_secret
19-
STRIPE_USAGE_PRICE_ID=price_dummy_usage_id
2019
STRIPE_TEAM_FEE_PRICE_ID=price_dummy_team_fee_id
2120
STRIPE_SUBSCRIPTION_100_PRICE_ID=price_dummy_subscription_100_id
2221
STRIPE_SUBSCRIPTION_200_PRICE_ID=price_dummy_subscription_200_id

cli/release/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codebuff",
3-
"version": "1.0.610",
3+
"version": "1.0.612",
44
"description": "AI coding agent",
55
"license": "MIT",
66
"bin": {

cli/src/__tests__/test-utils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ const TEST_SERVER_ENV_DEFAULTS: Record<string, string> = {
7979
NEXTAUTH_SECRET: 'test-secret',
8080
STRIPE_SECRET_KEY: 'sk_test_dummy',
8181
STRIPE_WEBHOOK_SECRET_KEY: 'whsec_dummy',
82-
STRIPE_USAGE_PRICE_ID: 'price_test',
8382
STRIPE_TEAM_FEE_PRICE_ID: 'price_test',
8483
LOOPS_API_KEY: 'test',
8584
DISCORD_PUBLIC_KEY: 'test',

cli/src/components/subscription-limit-banner.tsx

Lines changed: 68 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -127,47 +127,76 @@ export const SubscriptionLimitBanner = () => {
127127
<text style={{ fg: theme.muted }}>{weeklyPercentUsed}% used</text>
128128
</box>
129129

130-
{hasAlaCarteCredits && (
131-
<Button onClick={handleToggleFallbackToALaCarte} disabled={updatePreference.isPending}>
132-
<text style={{ fg: theme.muted }}>
133-
{updatePreference.isPending ? '[...]' : fallbackToALaCarte ? '[x]' : '[ ]'} always use credits if subscription limit is reached
134-
</text>
135-
</Button>
136-
)}
137-
138-
<box style={{ flexDirection: 'row', gap: 2, marginTop: 1 }}>
139-
{hasAlaCarteCredits ? (
140-
<>
141-
<Button onClick={handleContinueWithCredits}>
142-
<text style={{ fg: theme.background, bg: theme.foreground }}>
143-
{' '}Continue with credits ({remainingBalance.toLocaleString()}){' '}
130+
{hasAlaCarteCredits ? (
131+
<box style={{ flexDirection: 'column', gap: 1, marginTop: 1 }}>
132+
{fallbackToALaCarte ? (
133+
<>
134+
<text style={{ fg: theme.muted }}>
135+
✓ Credit spending enabled. You can continue using your credits.
144136
</text>
145-
</Button>
146-
{canUpgrade ? (
147-
<Button onClick={handleUpgrade}>
148-
<text style={{ fg: theme.background, bg: theme.foreground }}>{' '}Upgrade Plan ↗{' '}</text>
137+
<box style={{ flexDirection: 'row', gap: 2 }}>
138+
<Button onClick={handleContinueWithCredits}>
139+
<text style={{ fg: theme.background, bg: theme.foreground }}>
140+
{' '}Continue with credits ({remainingBalance.toLocaleString()}){' '}
141+
</text>
142+
</Button>
143+
{canUpgrade ? (
144+
<Button onClick={handleUpgrade}>
145+
<text style={{ fg: theme.background, bg: theme.foreground }}>{' '}Upgrade Plan ↗{' '}</text>
146+
</Button>
147+
) : (
148+
<Button onClick={handleBuyCredits}>
149+
<text style={{ fg: theme.background, bg: theme.muted }}>{' '}Buy Credits ↗{' '}</text>
150+
</Button>
151+
)}
152+
</box>
153+
<Button onClick={handleToggleFallbackToALaCarte} disabled={updatePreference.isPending}>
154+
<text style={{ fg: theme.muted }}>
155+
{updatePreference.isPending ? '[updating...]' : '[disable credit spending]'}
156+
</text>
149157
</Button>
150-
) : (
151-
<Button onClick={handleBuyCredits}>
152-
<text style={{ fg: theme.background, bg: theme.muted }}>{' '}Buy Credits ↗{' '}</text>
153-
</Button>
154-
)}
155-
</>
156-
) : (
157-
<>
158-
<text style={{ fg: theme.muted }}>No a-la-carte credits available.</text>
159-
{canUpgrade ? (
160-
<Button onClick={handleUpgrade}>
161-
<text style={{ fg: theme.background, bg: theme.muted }}>{' '}Upgrade Plan ↗{' '}</text>
162-
</Button>
163-
) : (
164-
<Button onClick={handleBuyCredits}>
165-
<text style={{ fg: theme.background, bg: theme.muted }}>{' '}Buy Credits ↗{' '}</text>
166-
</Button>
167-
)}
168-
</>
169-
)}
170-
</box>
158+
</>
159+
) : (
160+
<>
161+
<text style={{ fg: theme.warning }}>
162+
Credit spending is disabled. Enable it to continue.
163+
</text>
164+
<box style={{ flexDirection: 'row', gap: 2 }}>
165+
<Button onClick={handleToggleFallbackToALaCarte} disabled={updatePreference.isPending}>
166+
<text style={{ fg: theme.background, bg: theme.foreground }}>
167+
{updatePreference.isPending ? ' Enabling... ' : ' Enable Credit Spending '}
168+
</text>
169+
</Button>
170+
{canUpgrade ? (
171+
<Button onClick={handleUpgrade}>
172+
<text style={{ fg: theme.background, bg: theme.muted }}>{' '}Upgrade Plan ↗{' '}</text>
173+
</Button>
174+
) : (
175+
<Button onClick={handleBuyCredits}>
176+
<text style={{ fg: theme.background, bg: theme.muted }}>{' '}Buy Credits ↗{' '}</text>
177+
</Button>
178+
)}
179+
</box>
180+
<text style={{ fg: theme.muted }}>
181+
You have {remainingBalance.toLocaleString()} credits available.
182+
</text>
183+
</>
184+
)}
185+
</box>
186+
) : (
187+
<box style={{ flexDirection: 'row', gap: 2, marginTop: 1 }}>
188+
<text style={{ fg: theme.muted }}>No a-la-carte credits available.</text>
189+
{canUpgrade ? (
190+
<Button onClick={handleUpgrade}>
191+
<text style={{ fg: theme.background, bg: theme.muted }}>{' '}Upgrade Plan ↗{' '}</text>
192+
</Button>
193+
) : (
194+
<Button onClick={handleBuyCredits}>
195+
<text style={{ fg: theme.background, bg: theme.muted }}>{' '}Buy Credits ↗{' '}</text>
196+
</Button>
197+
)}
198+
</box>
199+
)}
171200
</box>
172201
</box>
173202
)

cli/src/components/usage-banner.tsx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -266,16 +266,23 @@ const SubscriptionUsageSection: React.FC<SubscriptionUsageSectionProps> = ({
266266
</box>
267267
</box>
268268
) : null}
269-
<box style={{ flexDirection: 'row', alignItems: 'center', gap: 1, marginTop: 1 }}>
270-
<text style={{ fg: theme.muted }}>When limit reached:</text>
269+
<box style={{ flexDirection: 'column', gap: 0, marginTop: 1 }}>
270+
<box style={{ flexDirection: 'row', alignItems: 'center', gap: 1 }}>
271+
<text style={{ fg: theme.muted }}>Credit spending:</text>
272+
<text style={{ fg: fallbackToALaCarte ? theme.foreground : theme.warning }}>
273+
{fallbackToALaCarte ? 'enabled' : 'disabled'}
274+
</text>
275+
<Button onClick={handleToggleFallbackToALaCarte} disabled={updatePreference.isPending}>
276+
<text style={{ fg: theme.muted, attributes: TextAttributes.UNDERLINE }}>
277+
{updatePreference.isPending ? '[updating...]' : `[${fallbackToALaCarte ? 'disable' : 'enable'}]`}
278+
</text>
279+
</Button>
280+
</box>
271281
<text style={{ fg: theme.muted }}>
272-
{fallbackToALaCarte ? 'spend credits' : 'pause'}
282+
{fallbackToALaCarte
283+
? 'Your credits will be used when subscription limits are reached.'
284+
: 'Credits will NOT be spent when subscription limits are reached. Enable to use credits.'}
273285
</text>
274-
<Button onClick={handleToggleFallbackToALaCarte} disabled={updatePreference.isPending}>
275-
<text style={{ fg: theme.muted, attributes: TextAttributes.UNDERLINE }}>
276-
{updatePreference.isPending ? '[updating...]' : `[${fallbackToALaCarte ? 'switch to pause' : 'switch to spend credits'}]`}
277-
</text>
278-
</Button>
279286
</box>
280287
</box>
281288
)

common/src/constants/claude-oauth.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export const OPENROUTER_TO_ANTHROPIC_MODEL_MAP: Record<string, string> = {
7272
'anthropic/claude-4-sonnet': 'claude-sonnet-4-20250514',
7373

7474
// Claude 4.x Opus models
75+
'anthropic/claude-opus-4.6': 'claude-opus-4-6',
7576
'anthropic/claude-opus-4.5': 'claude-opus-4-5-20251101',
7677
'anthropic/claude-opus-4.1': 'claude-opus-4-1-20250805',
7778
'anthropic/claude-opus-4': 'claude-opus-4-1-20250805',

evals/buffbench/eval-codebuff.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"NEXTAUTH_SECRET": "test-nextauth-secret",
2828
"STRIPE_SECRET_KEY": "test-stripe-key",
2929
"STRIPE_WEBHOOK_SECRET_KEY": "test-stripe-webhook",
30-
"STRIPE_USAGE_PRICE_ID": "test-price-id",
3130
"STRIPE_TEAM_FEE_PRICE_ID": "test-team-price-id",
3231
"LOOPS_API_KEY": "test-loops",
3332
"DISCORD_PUBLIC_KEY": "test-discord-public",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE "user" DROP COLUMN "stripe_price_id";

0 commit comments

Comments
 (0)