mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-25 08:48:08 +02:00
fix: warn on claude-code prompt caching during setup
This commit is contained in:
parent
ea3c606b28
commit
daca268fa8
4 changed files with 87 additions and 11 deletions
|
|
@ -9,6 +9,11 @@ import type {
|
|||
KtxProjectLlmConfig,
|
||||
} from '@ktx/context/project';
|
||||
import type { PostgresPgssProbeResult } from '@ktx/context/ingest';
|
||||
import {
|
||||
formatClaudeCodePromptCachingFix,
|
||||
formatClaudeCodePromptCachingWarning,
|
||||
ignoredClaudeCodePromptCachingFields,
|
||||
} from './claude-code-prompt-caching.js';
|
||||
import type { DoctorCheck } from './doctor.js';
|
||||
import { KTX_NEXT_STEP_DIRECT_COMMANDS } from './next-steps.js';
|
||||
|
||||
|
|
@ -509,13 +514,6 @@ function buildPipelineStatus(config: KtxProjectConfig): PipelineStatus {
|
|||
};
|
||||
}
|
||||
|
||||
function ignoredClaudeCodePromptCachingFields(config: KtxProjectLlmConfig): string[] {
|
||||
if (config.provider.backend !== 'claude-code' || !config.promptCaching) {
|
||||
return [];
|
||||
}
|
||||
return Object.keys(config.promptCaching).map((key) => `llm.promptCaching.${key}`);
|
||||
}
|
||||
|
||||
function buildStorageStatus(config: KtxProjectConfig): StorageStatus {
|
||||
return {
|
||||
state: config.storage.state,
|
||||
|
|
@ -603,11 +601,11 @@ function buildWarnings(
|
|||
});
|
||||
}
|
||||
|
||||
const ignored = ignoredClaudeCodePromptCachingFields(config.llm);
|
||||
if (ignored.length > 0) {
|
||||
const warning = formatClaudeCodePromptCachingWarning(ignoredClaudeCodePromptCachingFields(config.llm));
|
||||
if (warning) {
|
||||
warnings.push({
|
||||
message: `claude-code ignores ${ignored.join(', ')} because the Claude Agent SDK does not expose KTX prompt-cache TTL, tool, or history markers.`,
|
||||
fix: 'Remove those promptCaching fields or use anthropic, vertex, or gateway when those cache knobs are required.',
|
||||
message: warning,
|
||||
fix: formatClaudeCodePromptCachingFix(),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue