Feature hasn't been suggested before.
Describe the enhancement you want to request
Summary
Allow users to configure the minimum severity level for LSP diagnostics shown to the AI agent. Currently, only Error (severity 1) diagnostics are displayed after file edits. Warning (severity 2) and lower severity diagnostics are silently filtered out, preventing the AI agent from seeing and acting on style violations and linting issues.
Problem
Many LSP servers report style guide violations, best practices, and linting issues as Warnings rather than Errors. Since OpenCode filters these out, the AI agent cannot:
- Follow documentation and code style guides
- Proactively fix linting issues
- Ensure clean, consistent code
Example 1: ubCode LSP (Sphinx-Needs / ReStructuredText)
The ubCode LSP provides linting for .rst files and Sphinx-Needs directives. After configuring it in OpenCode:
{
"lsp": {
"ubcode": {
"command": ["/path/to/ubcode-lsp/python", "-m", "ubcode_lsp.cli"],
"extensions": [".rst"]
}
}
}
The LSP process starts and connects correctly (verified via ps aux), but no diagnostics are shown to the AI agent after editing .rst files—even when introducing obvious errors like malformed title underlines or unknown directives. This is because ubCode reports all issues as Warnings (severity 2).
Example 2: markdownlint-lsp
The markdownlint-lsp server reports all markdown style violations as Warnings by default. The only workaround is to manually patch the npm package source code.
In lib/server.mjs (line 477):
const diagnostic = Diagnostic.create(
{ /* range */ },
`${issue.ruleDescription} (${issue.ruleNames.join("/")})`,
DiagnosticSeverity.Warning, // <-- Must manually change to .Error
issue.ruleNames[0],
"markdownlint",
);
This workaround is fragile and breaks on every package update.
Justification
AI agents should see all relevant diagnostics to:
- Follow style guides — Style violations are typically reported as warnings
- Write clean code — Agents can proactively fix issues before they accumulate
- Maintain consistency — Documentation style rules (RST, Markdown) are enforced via warnings
- Reduce manual review — Users shouldn't have to manually check for issues the LSP already detected
Proposed Solution
Add a configuration option to control the minimum severity level:
Option A: Global setting
Option B: Per-LSP setting
{
"lsp": {
"ubcode": {
"command": ["..."],
"extensions": [".rst"],
"minSeverity": 2
},
"markdownlint": {
"command": ["..."],
"extensions": [".md"],
"minSeverity": 2
}
}
}
Severity levels (per LSP spec)
| Value |
Name |
Description |
| 1 |
Error |
Current default (only these are shown) |
| 2 |
Warning |
Style violations, linting issues |
| 3 |
Information |
Informational messages |
| 4 |
Hint |
Suggestions |
Related Issues
Environment
- OpenCode version: latest
- OS: Linux (Ubuntu 22.04)
- Affected LSP servers: ubCode, markdownlint-lsp, likely many others that report warnings
Feature hasn't been suggested before.
Describe the enhancement you want to request
Summary
Allow users to configure the minimum severity level for LSP diagnostics shown to the AI agent. Currently, only Error (severity 1) diagnostics are displayed after file edits. Warning (severity 2) and lower severity diagnostics are silently filtered out, preventing the AI agent from seeing and acting on style violations and linting issues.
Problem
Many LSP servers report style guide violations, best practices, and linting issues as Warnings rather than Errors. Since OpenCode filters these out, the AI agent cannot:
Example 1: ubCode LSP (Sphinx-Needs / ReStructuredText)
The ubCode LSP provides linting for
.rstfiles and Sphinx-Needs directives. After configuring it in OpenCode:{ "lsp": { "ubcode": { "command": ["/path/to/ubcode-lsp/python", "-m", "ubcode_lsp.cli"], "extensions": [".rst"] } } }The LSP process starts and connects correctly (verified via
ps aux), but no diagnostics are shown to the AI agent after editing.rstfiles—even when introducing obvious errors like malformed title underlines or unknown directives. This is because ubCode reports all issues as Warnings (severity 2).Example 2: markdownlint-lsp
The
markdownlint-lspserver reports all markdown style violations as Warnings by default. The only workaround is to manually patch the npm package source code.In
lib/server.mjs(line 477):This workaround is fragile and breaks on every package update.
Justification
AI agents should see all relevant diagnostics to:
Proposed Solution
Add a configuration option to control the minimum severity level:
Option A: Global setting
{ "lsp": { "minSeverity": 2 // 2 = warning } }Option B: Per-LSP setting
{ "lsp": { "ubcode": { "command": ["..."], "extensions": [".rst"], "minSeverity": 2 }, "markdownlint": { "command": ["..."], "extensions": [".md"], "minSeverity": 2 } } }Severity levels (per LSP spec)
Related Issues
Environment