Skip to content

LLM Wiki is a cross-platform desktop application that turns your documents into an organized, interlinked knowledge base — automatically. Instead of traditional RAG (retrieve-and-answer from scratch every time), the LLM incrementally builds and maintains a persistent wiki from your sources。

TypeScript

fix: preserve Claude CLI provider test arguments

nash_su70e5e57422d9
diff --git a/src-tauri/src/commands/claude_cli.rs b/src-tauri/src/commands/claude_cli.rs
index cc43a93a..de6ac53d 100644
--- a/src-tauri/src/commands/claude_cli.rs
+++ b/src-tauri/src/commands/claude_cli.rs
@@ -444,11 +444,6 @@ fn build_claude_cli_args(model: &str, isolate_local_config: bool) -> Vec<String>
args.extend([
"--setting-sources".to_string(),
"project".to_string(),
- "--strict-mcp-config".to_string(),
- "--mcp-config".to_string(),
- // Claude's strict MCP config expects the top-level mcpServers key
- // even when the isolated server set is intentionally empty.
- ISOLATED_MCP_CONFIG.to_string(),
"--disable-slash-commands".to_string(),
"--tools".to_string(),
"".to_string(),
@@ -459,6 +454,16 @@ fn build_claude_cli_args(model: &str, isolate_local_config: bool) -> Vec<String>
}
args.extend(["--model".to_string(), model.to_string()]);
+ if isolate_local_config {
+ // `--mcp-config` accepts multiple space-separated values. Keep its
+ // inline JSON last so Claude's argument parser cannot consume later
+ // flags as additional config paths, especially through Windows shims.
+ args.extend([
+ "--strict-mcp-config".to_string(),
+ "--mcp-config".to_string(),
+ ISOLATED_MCP_CONFIG.to_string(),
+ ]);
+ }
args
}
@@ -644,6 +649,10 @@ mod tests {
assert!(args
.windows(2)
.any(|pair| pair[0] == "--prompt-suggestions" && pair[1] == "false"));
+ assert_eq!(
+ &args[args.len() - 3..],
+ ["--strict-mcp-config", "--mcp-config", ISOLATED_MCP_CONFIG]
+ );
}
#[tokio::test]
diff --git a/src/lib/connection-tests.test.ts b/src/lib/connection-tests.test.ts
index b3075599..02404a36 100644
--- a/src/lib/connection-tests.test.ts
+++ b/src/lib/connection-tests.test.ts
@@ -124,7 +124,7 @@ describe("provider connection tests", () => {
["Codex CLI", "codex-cli", "functional", false],
["Codex CLI", "codex-cli", "functional", undefined],
] as const)(
- "isolates local CLI configuration during %s %s tests",
+ "preserves local CLI isolation during %s %s tests",
async (_label, provider, kind, initialIsolation) => {
streamChatMock.mockImplementationOnce(async (_cfg, _messages, callbacks) => {
callbacks.onToken(kind === "functional" ? "LLM_WIKI_TEST_OK" : "OK")
@@ -142,7 +142,7 @@ describe("provider connection tests", () => {
expect(result.ok).toBe(true)
expect(streamChatMock).toHaveBeenCalledWith(
- expect.objectContaining({ provider, localCliIsolation: true }),
+ cfg,
expect.any(Array),
expect.any(Object),
undefined,
diff --git a/src/lib/connection-tests.ts b/src/lib/connection-tests.ts
index f2593afd..9c71587a 100644
--- a/src/lib/connection-tests.ts
+++ b/src/lib/connection-tests.ts
@@ -9,13 +9,6 @@ export interface ProviderTestResult {
export const LLM_PROVIDER_TEST_MAX_TOKENS = 512
-function configForProviderTest(cfg: LlmConfig): LlmConfig {
- if (cfg.provider === "claude-code" || cfg.provider === "codex-cli") {
- return { ...cfg, localCliIsolation: true }
- }
- return cfg
-}
-
export async function testEmbeddingConnection(cfg: EmbeddingConfig): Promise<ProviderTestResult> {
if (!cfg.endpoint.trim()) {
return { ok: false, message: "Embedding endpoint is empty." }
@@ -71,12 +64,11 @@ export async function testEmbeddingFunction(cfg: EmbeddingConfig): Promise<Provi
export async function testLlmConnection(cfg: LlmConfig): Promise<ProviderTestResult> {
const started = performance.now()
- const testCfg = configForProviderTest(cfg)
let content = ""
let errorMessage: string | null = null
await streamChat(
- testCfg,
+ cfg,
[
{ role: "system", content: "You are a connection checker. Reply briefly." },
{ role: "user", content: "Reply with one short word." },
@@ -99,12 +91,11 @@ export async function testLlmConnection(cfg: LlmConfig): Promise<ProviderTestRes
}
export async function testLlmFunction(cfg: LlmConfig): Promise<ProviderTestResult> {
- const testCfg = configForProviderTest(cfg)
let content = ""
let errorMessage: string | null = null
await streamChat(
- testCfg,
+ cfg,
[
{
role: "system",