Fix/openclaude diagnostics settings (#483)

* fix: use openclaude paths in diagnostics and settings

* fix: strip leaked reasoning from assistant output

* fix: preserve legacy claude config compatibility

* fix: tighten path and reasoning compatibility

* fix: buffer streamed reasoning leak preambles

* test: cover openclaude migration and reasoning fixes

* test: isolate execFileNoThrow from cross-file mocks
This commit is contained in:
Kevin Codex
2026-04-09 20:42:51 +08:00
committed by GitHub
parent 32fbd0c7b4
commit 42b121bd0d
23 changed files with 934 additions and 101 deletions

View File

@@ -41,7 +41,7 @@ import { logForDebugging } from '../debug.js'
import { getCurrentInstallationType } from '../doctorDiagnostic.js'
import { env } from '../env.js'
import { envDynamic } from '../envDynamic.js'
import { isEnvTruthy } from '../envUtils.js'
import { getClaudeConfigHomeDir, isEnvTruthy } from '../envUtils.js'
import { errorMessage, getErrnoCode, isENOENT, toError } from '../errors.js'
import { execFileNoThrowWithCwd } from '../execFileNoThrow.js'
import { getShellType } from '../localInstaller.js'
@@ -1688,19 +1688,23 @@ export async function cleanupNpmInstallations(): Promise<{
}
}
// Check for local installation at ~/.claude/local
const localInstallDir = join(homedir(), '.claude', 'local')
// Preserve compatibility with pre-migration installs under ~/.claude/local.
const localInstallDirs = Array.from(
new Set([join(getClaudeConfigHomeDir(), 'local'), join(homedir(), '.claude', 'local')]),
)
try {
await rm(localInstallDir, { recursive: true })
removed++
logForDebugging(`Removed local installation at ${localInstallDir}`)
} catch (error) {
if (!isENOENT(error)) {
errors.push(`Failed to remove ${localInstallDir}: ${error}`)
logForDebugging(`Failed to remove local installation: ${error}`, {
level: 'error',
})
for (const localInstallDir of localInstallDirs) {
try {
await rm(localInstallDir, { recursive: true })
removed++
logForDebugging(`Removed local installation at ${localInstallDir}`)
} catch (error) {
if (!isENOENT(error)) {
errors.push(`Failed to remove ${localInstallDir}: ${error}`)
logForDebugging(`Failed to remove local installation: ${error}`, {
level: 'error',
})
}
}
}