Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(claude): keep last good slash commands after a failed probe #7175

Closedmaslinedwin(GitHub profile, opens in a new tab)wants to merge 6 commits intomain fromrefs/pull/7175/headopened View on GitHub

Showing 3 changed files with 99 additions and 0 deletions.

x
0 of 3 viewed, 3 left
4 additions and 0 deletionsapps/server/src/provider/Drivers/ClaudeDriver.tsModified
View file
@@ -19,6 +19,7 @@
import * as Effect from "effect/Effect";
import * as FileSystem from "effect/FileSystem";
import * as Path from "effect/Path";
+import * as Ref from "effect/Ref";
import * as Schema from "effect/Schema";
import { HttpClient } from "effect/unstable/http";
import { ChildProcessSpawner } from "effect/unstable/process";
@@ -28,6 +29,7 @@
import { ServerConfig } from "../../config.ts";
import { ServerSettingsService } from "../../serverSettings.ts";
import { ProviderDriverError } from "../Errors.ts";
+import { rememberClaudeSlashCommands } from "./ClaudeSlashCommands.ts";
import { makeClaudeAdapter } from "../Layers/ClaudeAdapter.ts";
import {
checkClaudeProviderStatus,
@@ -163,12 +165,14 @@
});
const capabilitiesCacheKey = yield* makeClaudeCapabilitiesCacheKey(effectiveConfig, cwd);
​
+ const lastGoodSlashCommands = yield* Ref.make<ServerProvider["slashCommands"]>([]);
const checkProvider = checkClaudeProviderStatus(
effectiveConfig,
() => Cache.get(capabilitiesProbeCache, capabilitiesCacheKey),
processEnv,
cwd,
).pipe(
+ Effect.flatMap((snapshot) => rememberClaudeSlashCommands(lastGoodSlashCommands, snapshot)),