# v0.31.1 — Strict-LSP diagnostics, Windows doctor UX, Pi grep that doesn't hang

A patch release with two focused fixes: `lsp_diagnostics` now works correctly against strict LSP servers like tsgo, and `aft doctor` handles Windows setup gaps that used to produce silent dead ends.

## `lsp_diagnostics` against tsgo and other strict servers (#63)

AFT was sending `identifier: null` and `previousResultId: null` in pull-diagnostics requests when those fields had no value, because the upstream `lsp-types` crate at 0.97 omits the `skip_serializing_if = "Option::is_none"` annotation on them. The LSP 3.17 spec defines those fields as string-or-absent, not string-or-null. Permissive servers like `typescript-language-server` accept the null and return diagnostics anyway; strict servers like `tsgo` reject the request with `InvalidParams (-32602)`, and AFT then waited for push diagnostics that never came from a pull-only server. The user-visible symptom was `lsp_diagnostics` silently returning empty results for files that genuinely had type errors.

Fixed by introducing AFT-local `AftDocumentDiagnosticParams` and `AftWorkspaceDiagnosticParams` types with the missing serde annotations, sent through `AftDocumentDiagnosticRequest` / `AftWorkspaceDiagnosticRequest` using the same `textDocument/diagnostic` and `workspace/diagnostic` method strings as upstream. No behavior change for servers that accept either shape; tsgo now returns diagnostics correctly. Thanks to `@null-axiom` for the precise diagnosis.

## `aft doctor` no longer hides Windows setup problems (#64)

Five related Windows / setup-UX fixes for `aft doctor` and `aft doctor --fix`:

- **Plugin/CLI version skew is now a visible issue.** Running `npx @cortexkit/aft@latest doctor --fix` against an installation with an older plugin (for example CLI v0.30.3 against `@cortexkit/aft-opencode@0.29.1`) used to silently download the newer binary into the cache, where the plugin would then ignore it because of strict protocol pinning. Doctor now detects the skew, surfaces a high-severity issue with remediation, and `--fix` prompts before downloading the binary instead of silently caching one that won't be used. `--yes` proceeds; `--ci` and non-TTY environments skip the download cleanly.

- **Windows ONNX detection now scans `PATH`.** Users who install ONNX Runtime via Scoop or a manual zip on Windows typically put the `onnxruntime.dll` directory on `PATH`. The previous detector only looked in fixed locations and missed those installs. The new path adds `PATH` entries on Windows with conservative guards: absolute paths only, no current directory or null bytes, case-insensitive filename match. Mac and Linux detection is unchanged.

- **Storage "not created" no longer reads as a failure.** When AFT hasn't yet spawned a bridge in a session, the storage directory doesn't exist on disk — that's expected lazy behavior, not a problem. Doctor now says so explicitly, and `aft doctor --fix` opportunistically creates the directory for registered plugins so the next session starts clean.

- **Doctor output has an "Issues found" summary.** The previous output was a wall of green checkmarks with any real warnings buried inline. The markdown report now leads with an `Issues found` block — severity (HIGH/MEDIUM/LOW), scope, message, and remediation — for any non-zero findings. The full per-harness diagnostic stays below for context. Renders the same on TTY, CI, and `--issue` bug reports.

- **`bg-notifications` log noise.** The plugin used to log `WARN [aft-plugin] Live OpenCode HTTP listener unreachable, falling back to in-process promptAsync` on every wake delivery in non-`--port 0` TUI sessions, which is the expected fallback path. The fallback transition is now DEBUG-level; the WARN level is reserved for cases where no wake transport actually delivers. Thanks to `@Zireael` for the detailed bug report.

## Acknowledgements

`@cortexkit/aft-bridge`, `@cortexkit/aft-opencode`, `@cortexkit/aft-pi`, `@cortexkit/aft`, `agent-file-tools`, `aft-tokenizer`, and the platform binary packages all ship at `v0.31.1`.

Join us on Discord: https://discord.gg/DSa65w8wuf
