codeep 2.8.0 → 2.9.0
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/README.md +1 -1
- package/dist/api/index.js +4 -2
- package/dist/config/providers.d.ts +1 -0
- package/dist/config/providers.js +13 -3
- package/dist/utils/agentChat.js +7 -3
- package/dist/utils/tokenTracker.js +2 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -50,7 +50,7 @@ custom slash commands, lifecycle hooks, checkpoints, `/cost`,
|
|
|
50
50
|
### Multi-Provider Support
|
|
51
51
|
- **Z.AI (ZhipuAI)** — GLM models (Coding Plan & pay-per-use API, international & China)
|
|
52
52
|
- **OpenAI** — GPT models (flagship, Mini, Nano)
|
|
53
|
-
- **Anthropic** — Claude models (Opus, Sonnet, Haiku)
|
|
53
|
+
- **Anthropic** — Claude models (Fable, Opus, Sonnet, Haiku)
|
|
54
54
|
- **DeepSeek** — DeepSeek models (Pro, Flash)
|
|
55
55
|
- **Google AI** — Gemini models (Pro, Flash)
|
|
56
56
|
- **MiniMax** — MiniMax models (Coding Plan & pay-per-use API, international & China)
|
package/dist/api/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import * as http from 'node:http';
|
|
|
2
2
|
import * as https from 'node:https';
|
|
3
3
|
import { config, getApiKey, resolveBaseUrl } from '../config/index.js';
|
|
4
4
|
import { withRetry, isNetworkError } from '../utils/retry.js';
|
|
5
|
-
import { getProvider, getProviderBaseUrl, getProviderAuthHeader, usesMaxCompletionTokens, requiresDefaultTemperature } from '../config/providers.js';
|
|
5
|
+
import { getProvider, getProviderBaseUrl, getProviderAuthHeader, usesMaxCompletionTokens, requiresDefaultTemperature, modelRejectsSamplingParams } from '../config/providers.js';
|
|
6
6
|
import { logApiRequest, logApiResponse } from '../utils/logger.js';
|
|
7
7
|
import { loadProjectIntelligence, generateContextFromIntelligence } from '../utils/projectIntelligence.js';
|
|
8
8
|
import { loadProjectRules } from '../utils/agent.js';
|
|
@@ -655,7 +655,9 @@ async function chatAnthropic(message, history, model, apiKey, onChunk, abortSign
|
|
|
655
655
|
model,
|
|
656
656
|
messages,
|
|
657
657
|
max_tokens: maxTokens,
|
|
658
|
-
temperature
|
|
658
|
+
// Fable 5 / Opus 4.7+ reject temperature with a 400 — omit it there
|
|
659
|
+
// (omission means API default on every Claude model).
|
|
660
|
+
...(modelRejectsSamplingParams(model) ? {} : { temperature }),
|
|
659
661
|
stream,
|
|
660
662
|
...cachedSystem,
|
|
661
663
|
}),
|
|
@@ -68,6 +68,7 @@ export declare function usesMaxCompletionTokens(providerId: string): boolean;
|
|
|
68
68
|
* (e.g. OpenAI GPT-5+ only accepts the default of 1).
|
|
69
69
|
*/
|
|
70
70
|
export declare function requiresDefaultTemperature(providerId: string): boolean;
|
|
71
|
+
export declare function modelRejectsSamplingParams(model: string): boolean;
|
|
71
72
|
/**
|
|
72
73
|
* Returns the effective max output tokens for a provider, capped by the provider's limit.
|
|
73
74
|
* Falls back to the requested value if no provider limit is set.
|
package/dist/config/providers.js
CHANGED
|
@@ -243,9 +243,8 @@ export const PROVIDERS = {
|
|
|
243
243
|
},
|
|
244
244
|
},
|
|
245
245
|
models: [
|
|
246
|
-
{ id: 'claude-
|
|
247
|
-
{ id: 'claude-opus-4-
|
|
248
|
-
{ id: 'claude-opus-4-6', name: 'Claude Opus 4.6', description: 'Older generation Opus' },
|
|
246
|
+
{ id: 'claude-fable-5', name: 'Claude Fable 5', description: 'Most powerful — new tier above Opus' },
|
|
247
|
+
{ id: 'claude-opus-4-8', name: 'Claude Opus 4.8', description: 'Most capable Opus model' },
|
|
249
248
|
{ id: 'claude-sonnet-4-6', name: 'Claude Sonnet', description: 'Best balance of speed and intelligence' },
|
|
250
249
|
{ id: 'claude-haiku-4-5-20251001', name: 'Claude Haiku', description: 'Fastest and most affordable' },
|
|
251
250
|
],
|
|
@@ -448,6 +447,17 @@ export function usesMaxCompletionTokens(providerId) {
|
|
|
448
447
|
export function requiresDefaultTemperature(providerId) {
|
|
449
448
|
return PROVIDERS[providerId]?.requiresDefaultTemperature ?? false;
|
|
450
449
|
}
|
|
450
|
+
/**
|
|
451
|
+
* Models that reject sampling parameters (temperature/top_p/top_k) with a 400.
|
|
452
|
+
* Anthropic removed them on Fable 5 and Opus 4.7+; older Claude models still
|
|
453
|
+
* accept them, so this must be a MODEL-level check, not a provider-level one
|
|
454
|
+
* (requiresDefaultTemperature can't express it). Omitting the field is always
|
|
455
|
+
* safe — the API treats omission as default.
|
|
456
|
+
*/
|
|
457
|
+
const SAMPLING_PARAMS_REJECTED = ['claude-fable-5', 'claude-opus-4-8', 'claude-opus-4-7'];
|
|
458
|
+
export function modelRejectsSamplingParams(model) {
|
|
459
|
+
return SAMPLING_PARAMS_REJECTED.some(id => model === id || model.startsWith(`${id}-`));
|
|
460
|
+
}
|
|
451
461
|
/**
|
|
452
462
|
* Returns the effective max output tokens for a provider, capped by the provider's limit.
|
|
453
463
|
* Falls back to the requested value if no provider limit is set.
|
package/dist/utils/agentChat.js
CHANGED
|
@@ -17,7 +17,7 @@ import { createHash } from 'crypto';
|
|
|
17
17
|
import { config, getApiKey, resolveBaseUrl } from '../config/index.js';
|
|
18
18
|
import { loadProjectIntelligence, generateContextFromIntelligence } from './projectIntelligence.js';
|
|
19
19
|
import { syncProgress, generateProjectId } from './codeepCloud.js';
|
|
20
|
-
import { getProviderAuthHeader, supportsNativeTools, getEffectiveMaxTokens, usesMaxCompletionTokens, requiresDefaultTemperature, isNoApiKeyProvider } from '../config/providers.js';
|
|
20
|
+
import { getProviderAuthHeader, supportsNativeTools, getEffectiveMaxTokens, usesMaxCompletionTokens, requiresDefaultTemperature, modelRejectsSamplingParams, isNoApiKeyProvider } from '../config/providers.js';
|
|
21
21
|
import { recordTokenUsage, extractOpenAIUsage, extractAnthropicUsage } from './tokenTracker.js';
|
|
22
22
|
import { parseOpenAIToolCalls, parseAnthropicToolCalls, parseToolCalls } from './toolParsing.js';
|
|
23
23
|
import { formatToolDefinitions, getOpenAITools, getAnthropicTools } from './tools.js';
|
|
@@ -357,7 +357,9 @@ additionalTools) {
|
|
|
357
357
|
let endpoint;
|
|
358
358
|
let body;
|
|
359
359
|
const useStreaming = Boolean(onChunk);
|
|
360
|
-
|
|
360
|
+
// Provider-level guard (OpenAI GPT-5+) OR model-level guard — Anthropic's
|
|
361
|
+
// Fable 5 / Opus 4.7+ reject temperature with a 400; omission is safe.
|
|
362
|
+
const tempParam = (requiresDefaultTemperature(providerId) || modelRejectsSamplingParams(model)) ? {} : { temperature: config.get('temperature') };
|
|
361
363
|
if (protocol === 'openai') {
|
|
362
364
|
const maxTok = getEffectiveMaxTokens(providerId, Math.max(config.get('maxTokens'), 16384));
|
|
363
365
|
const tokParam = usesMaxCompletionTokens(providerId) ? { max_completion_tokens: maxTok } : { max_tokens: maxTok };
|
|
@@ -549,7 +551,9 @@ export async function agentChatFallback(messages, systemPrompt, onChunk, abortSi
|
|
|
549
551
|
try {
|
|
550
552
|
let endpoint;
|
|
551
553
|
let body;
|
|
552
|
-
|
|
554
|
+
// Provider-level guard (OpenAI GPT-5+) OR model-level guard — Anthropic's
|
|
555
|
+
// Fable 5 / Opus 4.7+ reject temperature with a 400; omission is safe.
|
|
556
|
+
const tempParam = (requiresDefaultTemperature(providerId) || modelRejectsSamplingParams(model)) ? {} : { temperature: config.get('temperature') };
|
|
553
557
|
if (protocol === 'openai') {
|
|
554
558
|
const maxTok = getEffectiveMaxTokens(providerId, Math.max(config.get('maxTokens'), 16384));
|
|
555
559
|
const tokParam = usesMaxCompletionTokens(providerId) ? { max_completion_tokens: maxTok } : { max_tokens: maxTok };
|
|
@@ -16,9 +16,8 @@ const MODEL_CONTEXT_WINDOWS = {
|
|
|
16
16
|
'gpt-5.4-mini': 400_000,
|
|
17
17
|
'gpt-5.4-nano': 400_000,
|
|
18
18
|
// Anthropic
|
|
19
|
+
'claude-fable-5': 1_000_000,
|
|
19
20
|
'claude-opus-4-8': 1_000_000,
|
|
20
|
-
'claude-opus-4-7': 1_000_000,
|
|
21
|
-
'claude-opus-4-6': 1_000_000,
|
|
22
21
|
'claude-sonnet-4-6': 1_000_000,
|
|
23
22
|
'claude-haiku-4-5-20251001': 200_000,
|
|
24
23
|
// DeepSeek
|
|
@@ -52,9 +51,8 @@ const MODEL_PRICING = {
|
|
|
52
51
|
'gpt-5.4-mini': { inputPer1M: 0.75, outputPer1M: 4.50 },
|
|
53
52
|
'gpt-5.4-nano': { inputPer1M: 0.20, outputPer1M: 1.25 },
|
|
54
53
|
// Anthropic
|
|
54
|
+
'claude-fable-5': { inputPer1M: 10.00, outputPer1M: 50.00 },
|
|
55
55
|
'claude-opus-4-8': { inputPer1M: 5.00, outputPer1M: 25.00 },
|
|
56
|
-
'claude-opus-4-7': { inputPer1M: 5.00, outputPer1M: 25.00 },
|
|
57
|
-
'claude-opus-4-6': { inputPer1M: 5.00, outputPer1M: 25.00 },
|
|
58
56
|
'claude-sonnet-4-6': { inputPer1M: 3.00, outputPer1M: 15.00 },
|
|
59
57
|
'claude-haiku-4-5-20251001': { inputPer1M: 1.00, outputPer1M: 5.00 },
|
|
60
58
|
// DeepSeek (cache-miss input pricing)
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "2.
|
|
1
|
+
export declare const VERSION = "2.9.0";
|
package/dist/version.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// AUTO-GENERATED by scripts/gen-version.js — do not edit by hand.
|
|
2
2
|
// Baked from package.json at build time so the bun-compiled binary reports
|
|
3
3
|
// the right version (it has no package.json on disk to read at runtime).
|
|
4
|
-
export const VERSION = '2.
|
|
4
|
+
export const VERSION = '2.9.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeep",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "AI-powered coding assistant built for the terminal. Multiple LLM providers, project-aware context, and a seamless development workflow.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|