deepccc 0.1.16 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +17 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -276,6 +276,17 @@ export class ChatSession {
|
|
|
276
276
|
const skills = await scanSkillsDirs(this.skillDirs);
|
|
277
277
|
const system = this.buildSystemPrompt(skills);
|
|
278
278
|
this.systemPrompt = system;
|
|
279
|
+
// effort 按协议映射:
|
|
280
|
+
// - OpenAI 兼容:providerOptions.deepseek.reasoningEffort 由 @ai-sdk/openai-compatible
|
|
281
|
+
// 自动映射为请求体 reasoning_effort 字段(DeepSeek 原生支持);
|
|
282
|
+
// - Anthropic:providerOptions.anthropic.effort 由 @ai-sdk/anthropic 组装为请求体
|
|
283
|
+
// output_config.effort(官方 Effort API,见 platform.claude.com/docs/en/build-with-claude/effort)
|
|
284
|
+
let effortProviderOptions;
|
|
285
|
+
if (this.effort) {
|
|
286
|
+
effortProviderOptions = this.provider === "openai"
|
|
287
|
+
? { deepseek: { reasoningEffort: this.effort } }
|
|
288
|
+
: { anthropic: { effort: this.effort } };
|
|
289
|
+
}
|
|
279
290
|
const generationOptions = {
|
|
280
291
|
model: this.model,
|
|
281
292
|
system,
|
|
@@ -283,11 +294,7 @@ export class ChatSession {
|
|
|
283
294
|
tools: createBuiltinFileTools(this.cwd, { permissionGate: this.permissionGate }),
|
|
284
295
|
stopWhen: maxSteps !== undefined ? stepCountIs(maxSteps) : isLoopFinished(),
|
|
285
296
|
abortSignal: signal,
|
|
286
|
-
|
|
287
|
-
// 由 @ai-sdk/openai-compatible 自动映射为请求体 reasoning_effort 字段
|
|
288
|
-
...(this.provider === "openai" && this.effort
|
|
289
|
-
? { providerOptions: { deepseek: { reasoningEffort: this.effort } } }
|
|
290
|
-
: {}),
|
|
297
|
+
...(effortProviderOptions ? { providerOptions: effortProviderOptions } : {}),
|
|
291
298
|
};
|
|
292
299
|
let stream;
|
|
293
300
|
if (appConfig.streaming) {
|
|
@@ -431,6 +438,11 @@ export class ChatSession {
|
|
|
431
438
|
messages: [{ role: "user", content: buildSummaryPrompt(plan) }],
|
|
432
439
|
abortSignal: compactionSignal,
|
|
433
440
|
temperature: 0,
|
|
441
|
+
// 压缩是摘要类任务:显式锁低 effort(OpenAI reasoning_effort=none / Anthropic
|
|
442
|
+
// output_config.effort=low),避免继承主对话的高 effort 拖慢"压缩上下文中"阶段
|
|
443
|
+
providerOptions: this.provider === "openai"
|
|
444
|
+
? { deepseek: { reasoningEffort: "none" } }
|
|
445
|
+
: { anthropic: { effort: "low" } },
|
|
434
446
|
});
|
|
435
447
|
if (!result.text.trim()) {
|
|
436
448
|
throw new Error("Context compaction returned an empty summary");
|