OpenProgram Docs

Language server tools

Three tools ask a language server what a type checker knows about the working tree as it stands, without running tests.

ToolArgumentsAnswers
lsp_diagnosticsfileErrors and warnings for that file
lsp_referencesfile, line, columnEvery use of the symbol at that position
lsp_definitionfile, line, columnWhere that symbol is declared

file is absolute. line and column are 1-based, as read and tracebacks show, and must point at the symbol itself. Long results stop at 50 entries with a count of the rest; narrow the question.

runner.py: 2 diagnostics
14:5 warning: "requests" is not accessed [pyright]
27:12 error: "widget" is not defined [pyright]
3 references
openprogram/runtime/agent/loop/loop.py:88:9   result = dispatch(call)
openprogram/runtime/agent/loop/loop.py:140:5  dispatch(retry)
tests/unit/test_loop.py:31:11    monkeypatch.setattr(loop, "dispatch", fake)

lsp_definition has the same path:line:column form. Paths are relative to the workspace root.

Install a server

LanguageExtensionsBinaryInstall
Python.py, .pyipyright-langservernpm install -g pyright
TypeScript / JavaScript.ts, .tsx, .js, .jsx, .mts, .ctstypescript-language-servernpm install -g typescript-language-server typescript

The tools are always registered. Without a server they answer unavailable: install … with the command. Other extensions get a result saying so.

How servers run

  • One server per language per workspace. The workspace is the nearest ancestor holding pyproject.toml, setup.py, package.json, tsconfig.json or .git.
  • Starts on first use, stays cached for the process, shuts down when OpenProgram exits.
  • The configured sandbox applies. sandbox.mode defaults to off, so a server is unconfined unless a conversation turns Sandbox on. Under workspace-write, it reads the workspace and writes nothing outside it.

Compared to grep and CodeGraph

ToolFindsMisses or adds
grepTextReports same-named strings in comments; misses calls through an alias
lsp_referencesResolved symbolsNeither mistake
CodeGraphPre-built index of a whole codebase, best for reading unfamiliar code top downLanguage servers add live diagnostics against the file on disk
Last updated · 2026-11-25