* fix(kuna): reject dangling cache roots in doctor Treat a cache path as creatable only when no directory entry occupies it. A dangling symbolic link, including one hidden by a trailing separator, fails the cache check and clears provider availability while the installation check and caller-selected registration settings remain. Fixes #5554 Fixes #5105 Co-authored-by: morluto <morluto@users.noreply.github.com> * fix(doctor): admit the same settings native analysis rejects Project parseConfig failures into scoped engine readiness. Invalid provider preferences, startup timeouts, and other shared settings now fail the selected provider and the full audit, while a JEB-only timeout stays outside that admission. Fixes #5454 Co-authored-by: morluto <morluto@users.noreply.github.com> * fix(doctor): report an invalid log level from doctor The dispatcher rejected REA_LOG_LEVEL before every command, so doctor never emitted its readiness check. Doctor now runs and names that setting; other commands still stop before execution. Co-authored-by: morluto <morluto@users.noreply.github.com> * fix(doctor): require log-level failures in every scope An invalid REA_LOG_LEVEL stops the executable and MCP server before a client or skill can run, so those scopes now fail readiness too. Other native admission failures stay limited to a selected provider. Co-authored-by: morluto <morluto@users.noreply.github.com> * fix(kuna): strip only the platform cache separator On Darwin and Linux a trailing backslash is a filename character. Doctor now removes only the selected platform separator before inspecting the cache path. Co-authored-by: morluto <morluto@users.noreply.github.com> * fix(doctor): fail every provider on an invalid Hopper timeout REA_HOPPER_STARTUP_TIMEOUT_MS is rejected before any native engine starts. A selected non-Hopper provider now includes the existing timeout check. Co-authored-by: morluto <morluto@users.noreply.github.com> * style(doctor): format the Hopper timeout regression Co-authored-by: morluto <morluto@users.noreply.github.com> * fix(doctor): fail client scopes on MCP startup errors A registered client starts the MCP server, and parseConfig rejects every native admission failure before that server starts. Client readiness now includes those failures, not only REA_LOG_LEVEL. Co-authored-by: morluto <morluto@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: morluto <morluto@users.noreply.github.com>
61 lines
2.0 KiB
TypeScript
61 lines
2.0 KiB
TypeScript
import { expect } from "vitest";
|
|
|
|
import { cliTest } from "../../support/cli/cliFixture.js";
|
|
|
|
const invalidLogLevelMessage =
|
|
'REA configuration is invalid: REA_LOG_LEVEL: Invalid option: expected one of "trace"|"debug"|"info"|"warn"|"error"|"fatal"|"silent".\n';
|
|
|
|
for (const level of ["loud", "INFO"])
|
|
cliTest(
|
|
`reports REA_LOG_LEVEL=${level} as invalid configuration`,
|
|
async ({ cli }) => {
|
|
const help = await cli.run({
|
|
arguments: ["--help"],
|
|
environment: { REA_LOG_LEVEL: level },
|
|
});
|
|
expect(help.exitCode).toBe(1);
|
|
expect(help.stdout).toBe("");
|
|
expect(help.stderr).toBe(invalidLogLevelMessage);
|
|
|
|
const doctor = await cli.run({
|
|
arguments: ["--json", "doctor", "--provider", "hopper"],
|
|
environment: { REA_LOG_LEVEL: level },
|
|
});
|
|
expect(doctor.exitCode, doctor.stderr).toBe(1);
|
|
expect(doctor.stderr).toBe("");
|
|
expect(doctor.json).toMatchObject({
|
|
healthy: false,
|
|
scope_checks: expect.arrayContaining([
|
|
expect.objectContaining({
|
|
name: "runtime-configuration:REA_LOG_LEVEL",
|
|
ok: false,
|
|
classification: "config_drift",
|
|
detail: expect.stringContaining("REA_LOG_LEVEL"),
|
|
}),
|
|
]),
|
|
});
|
|
|
|
const client = await cli.run({
|
|
arguments: ["--json", "doctor", "--client", "codex"],
|
|
environment: { REA_LOG_LEVEL: level },
|
|
});
|
|
expect(client.exitCode, client.stderr).toBe(1);
|
|
expect(client.stderr).toBe("");
|
|
expect(client.json).toMatchObject({
|
|
healthy: false,
|
|
scope: { mode: "explicit", clients: ["codex"], providers: [] },
|
|
scope_checks: expect.arrayContaining([
|
|
expect.objectContaining({
|
|
name: "runtime-configuration:REA_LOG_LEVEL",
|
|
ok: false,
|
|
}),
|
|
]),
|
|
informational_checks: expect.not.arrayContaining([
|
|
expect.objectContaining({
|
|
name: "runtime-configuration:REA_LOG_LEVEL",
|
|
}),
|
|
]),
|
|
});
|
|
},
|
|
);
|