Skip to content

Commit f175c76

Browse files
egavrindevagent
andcommitted
fix: preserve DeepSeek reasoning loops
- Add a native DeepSeek streaming transport for thinking tool use - Persist assistant thinking while only replaying tool-call reasoning - Refresh DeepSeek V4 model pricing and registry coverage Co-Authored-By: devagent <devagent@egavrin>
1 parent c610a15 commit f175c76

14 files changed

Lines changed: 774 additions & 43 deletions

models/deepseek.toml

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,45 @@
22
provider = "deepseek"
33
base_url = "https://api.deepseek.com/v1"
44

5+
# Current V4 models. Pricing from https://api-docs.deepseek.com/quick_start/pricing.
6+
[deepseek-v4-flash]
7+
context_window = 1000000
8+
response_headroom = 384000
9+
default_max_tokens = 384000
10+
tokenizer = "deepseek"
11+
supports_tools = true
12+
supports_parallel_tools = false
13+
supports_temperature = false
14+
input_price_per_million = 0.14
15+
cache_hit_input_price_per_million = 0.028
16+
output_price_per_million = 0.28
17+
18+
[deepseek-v4-pro]
19+
context_window = 1000000
20+
response_headroom = 384000
21+
default_max_tokens = 384000
22+
tokenizer = "deepseek"
23+
supports_tools = true
24+
supports_parallel_tools = false
25+
supports_temperature = false
26+
input_price_per_million = 1.74
27+
cache_hit_input_price_per_million = 0.145
28+
output_price_per_million = 3.48
29+
30+
# Compatibility aliases. DeepSeek says these names will be deprecated in the future:
31+
# deepseek-chat maps to deepseek-v4-flash non-thinking mode, and deepseek-reasoner
32+
# maps to deepseek-v4-flash thinking mode.
533
[deepseek-chat]
6-
context_window = 128000
7-
response_headroom = 4000
34+
context_window = 1000000
35+
response_headroom = 384000
36+
default_max_tokens = 384000
837
tokenizer = "deepseek"
938
supports_tools = true
1039
supports_parallel_tools = false
1140
supports_temperature = true
41+
input_price_per_million = 0.14
42+
cache_hit_input_price_per_million = 0.028
43+
output_price_per_million = 0.28
1244

1345
[deepseek-coder]
1446
context_window = 128000
@@ -19,9 +51,13 @@ supports_parallel_tools = false
1951
supports_temperature = true
2052

2153
[deepseek-reasoner]
22-
context_window = 64000
23-
response_headroom = 8000
54+
context_window = 1000000
55+
response_headroom = 384000
56+
default_max_tokens = 384000
2457
tokenizer = "deepseek"
2558
supports_tools = true
2659
supports_parallel_tools = false
2760
supports_temperature = false
61+
input_price_per_million = 0.14
62+
cache_hit_input_price_per_million = 0.028
63+
output_price_per_million = 0.28

packages/cli/src/main-session-persistence.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ function registerSessionPersistenceEvents(bus: EventBus, sessionStore: SessionSt
192192
});
193193
bus.on("message:assistant", (event) => {
194194
const session = event.agentId || event.partial ? null : getActiveSession();
195-
if (session) sessionStore.addMessage(session.id, { role: MessageRole.ASSISTANT, content: event.content, toolCalls: event.toolCalls });
195+
if (session) sessionStore.addMessage(session.id, { role: MessageRole.ASSISTANT, content: event.content, thinking: event.thinking, toolCalls: event.toolCalls });
196196
});
197197
bus.on("message:tool", (event) => {
198198
const session = event.agentId ? null : getActiveSession();

0 commit comments

Comments
 (0)