Skip to content

Commit 3a26454

Browse files
committed
Merge remote-tracking branch 'origin/main' into jahooma/freebuff-glm-limit
# Conflicts: # cli/src/hooks/use-freebuff-session.ts # web/src/app/api/v1/freebuff/session/_handlers.ts # web/src/server/free-session/public-api.ts
2 parents 7dd903b + 64edebb commit 3a26454

35 files changed

Lines changed: 859 additions & 731 deletions

agents/__tests__/editor.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ describe('editor agent', () => {
6767
expect(glmEditor.model).toBe('z-ai/glm-5.1')
6868
})
6969

70+
test('creates minimax editor', () => {
71+
const minimaxEditor = createCodeEditor({ model: 'minimax' })
72+
expect(minimaxEditor.model).toBe('minimax/minimax-m2.7')
73+
})
74+
7075
test('gpt-5 editor does not include think tags in instructions', () => {
7176
const gpt5Editor = createCodeEditor({ model: 'gpt-5' })
7277
expect(gpt5Editor.instructionsPrompt).not.toContain('<think>')
@@ -79,6 +84,12 @@ describe('editor agent', () => {
7984
expect(glmEditor.instructionsPrompt).not.toContain('</think>')
8085
})
8186

87+
test('minimax editor does not include think tags in instructions', () => {
88+
const minimaxEditor = createCodeEditor({ model: 'minimax' })
89+
expect(minimaxEditor.instructionsPrompt).not.toContain('<think>')
90+
expect(minimaxEditor.instructionsPrompt).not.toContain('</think>')
91+
})
92+
8293
test('opus editor includes think tags in instructions', () => {
8394
const opusEditor = createCodeEditor({ model: 'opus' })
8495
expect(opusEditor.instructionsPrompt).toContain('<think>')

agents/editor/editor.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ import { publisher } from '../constants'
44
import type { AgentDefinition } from '../types/agent-definition'
55

66
export const createCodeEditor = (options: {
7-
model: 'gpt-5' | 'opus' | 'glm'
7+
model: 'gpt-5' | 'opus' | 'glm' | 'minimax'
88
}): Omit<AgentDefinition, 'id'> => {
99
const { model } = options
1010
return {
1111
publisher,
1212
model:
1313
options.model === 'gpt-5'
1414
? 'openai/gpt-5.1'
15+
: options.model === 'minimax'
16+
? 'minimax/minimax-m2.7'
1517
: options.model === 'glm'
1618
? 'z-ai/glm-5.1'
1719
: 'anthropic/claude-opus-4.7',
@@ -65,7 +67,7 @@ OR for new files or major rewrites:
6567
}
6668
</codebuff_tool_call>
6769
68-
${model === 'gpt-5' || model === 'glm'
70+
${model === 'gpt-5' || model === 'glm' || model === 'minimax'
6971
? ''
7072
: `Before you start writing your implementation, you should use <think> tags to think about the best way to implement the changes.
7173

agents/types/agent-definition.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,6 @@ export type ModelName =
423423
// Other open source models
424424
| 'moonshotai/kimi-k2'
425425
| 'moonshotai/kimi-k2:nitro'
426-
| 'moonshotai/kimi-k2.5'
427-
| 'moonshotai/kimi-k2.5:nitro'
428426
| 'z-ai/glm-5'
429427
| 'z-ai/glm-5.1'
430428
| 'z-ai/glm-4.6'

cli/src/chat.tsx

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ import {
1111
} from 'react'
1212
import { useShallow } from 'zustand/react/shallow'
1313

14-
import { getAdsEnabled, handleAdsDisable } from './commands/ads'
14+
import { getAdsEnabled } from './commands/ads'
1515
import { routeUserPrompt, addBashMessageToHistory } from './commands/router'
16-
import { AdBanner } from './components/ad-banner'
1716
import { ChoiceAdBanner } from './components/choice-ad-banner'
1817
import { ChatInputBar } from './components/chat-input-bar'
1918
import { LoadPreviousButton } from './components/load-previous-button'
@@ -175,13 +174,7 @@ export const Chat = ({
175174
})
176175
const hasSubscription = subscriptionData?.hasSubscription ?? false
177176

178-
const { ad, adData, recordImpression } = useGravityAd({ enabled: IS_FREEBUFF || !hasSubscription })
179-
const [adsManuallyDisabled, setAdsManuallyDisabled] = useState(false)
180-
181-
const handleDisableAds = useCallback(() => {
182-
handleAdsDisable()
183-
setAdsManuallyDisabled(true)
184-
}, [])
177+
const { adData, recordImpression } = useGravityAd({ enabled: IS_FREEBUFF || !hasSubscription })
185178

186179
// Set initial mode from CLI flag on mount
187180
useEffect(() => {
@@ -1466,19 +1459,11 @@ export const Chat = ({
14661459
/>
14671460
)}
14681461

1469-
{ad && (IS_FREEBUFF || (!adsManuallyDisabled && getAdsEnabled())) && (
1470-
adData?.variant === 'choice' ? (
1471-
<ChoiceAdBanner
1472-
ads={adData.ads}
1473-
onImpression={recordImpression}
1474-
/>
1475-
) : (
1476-
<AdBanner
1477-
ad={ad}
1478-
onDisableAds={handleDisableAds}
1479-
isFreeMode={IS_FREEBUFF}
1480-
/>
1481-
)
1462+
{adData && (IS_FREEBUFF || getAdsEnabled()) && (
1463+
<ChoiceAdBanner
1464+
ads={adData.variant === 'choice' ? adData.ads : [adData.ad]}
1465+
onImpression={recordImpression}
1466+
/>
14821467
)}
14831468

14841469
{reviewMode ? (

cli/src/components/ad-banner.tsx

Lines changed: 0 additions & 236 deletions
This file was deleted.

0 commit comments

Comments
 (0)