200 Commits
Author SHA1 Message Date
fei 24068f7b31 Stop a tool-context memory rename from aborting on read-only memories (#2081)
Rename propagation
* `rename_memory_and_propagate_references` enumerated `get_full_list()`, which
  includes the memories matched by `read_only_memory_patterns`.
* Writing one of those raises `PermissionError` in `_check_write_access`, so a
  rename of a memory that was referenced from a read-only memory failed *after*
  `move_memory` had already applied the rename.
* The memory graph was then half-updated: the renamed memory existed under its
  new name while the writable referrers still held `mem:OLD_NAME`, and retrying
  the rename failed with "Memory not found".

Fix
* In a tool context, propagate only into the memories that accept writes, sorted
  to keep the enumeration order that `get_full_list()` provided.
* Outside a tool context nothing changes, so read-only memories are still updated
  when the user renames through the CLI.
* A reference which thereby remains in a read-only memory is still reported as
  stale by `validate_referential_integrity`, so it is not hidden.

Documentation
* `docs/02-usage/045_memories.md` promised that the tool rewrites every reference across all
  memories. That is now only true for the memories the agent may write, so the caveat is stated
  where the promise is made.

Tests
* Add a regression pair: the tool-context rename completes and rewrites both
  occurrences in a writable referrer, while the CLI context additionally rewrites
  the read-only one.
2026-09-21 20:52:22 +02:00
Max ef94ae7e58 docs: explain TypeScript monorepo project references (#1939) (#2053) 2026-09-21 13:58:11 +02:00
Dominik Jain a3322719f1 Add explicit docs page on privacy policy 2026-09-21 13:43:23 +02:00
maxwang 4b726894d0 docs: correct configuration key names and typos 2026-09-21 13:24:58 +02:00
kronosandClaude Sonnet 5 fba5258294 fix(kotlin): update managed Kotlin LSP to 263.4702.0
The previous default, 262.9593.0, is a JetBrains EAP-style build that has
expired: intellij-server exits at startup with "This build of intellij-server
has expired", so every Kotlin symbolic tool fails. 263.4702.0 is the newest
release on Kotlin/kotlin-lsp and starts normally.

Uses the same archive layout and CDN path as 262.9593.0. Hashes regenerated
with scripts/update_downloaded_dependency_hashes.py.

Fixes #2008

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-21 12:12:28 +02:00
Dominik Jain 0b2b4c3b56 Add REPL-specific aspects to the security documentation 2026-09-17 10:58:14 +02:00
Dominik Jain da1accf7e1 Add documentation on the REPL interface
* Tools section: Add REPL interface description, advantages and full list of functions
* Config section: Add information on REPL configuration
2026-09-17 10:58:14 +02:00
Dominik Jain 283140e7ae Refactor external language server registration
* Apply object-oriented design
* Establish common interface via protocol LanguageServerIdLike
* Move all registration concerns to LanguageServerRegistry
2026-09-12 15:15:34 +02:00
Vitaly Ruhl 6000f16680 feat(solidlsp): prototype registrable language server adapters 2026-09-05 12:36:53 +02:00
MaxandYu-0312 6f86ae308e fix(solidity): isolate Hardhat state on macOS (#1910)
* fix(solidity): isolate Hardhat state on macOS

---------

Co-authored-by: Yu-0312 <2.66498311e+08+Yu-0312@users.noreply.github.com>
2026-09-03 15:21:15 +02:00
Amir Fathi 47c0a4bb66 fix(hooks): reset reminder counters after a successful Codex Serena call
Codex's documented hook wiring only routes `serena-hooks remind` through
PreToolUse on the `Bash` matcher, so `ToolUseCounter.update()`'s
reset-on-Serena-tool-use branch is never reached there: it only fires when
`remind` itself is invoked for a `mcp__serena__*` tool name, which the
Bash-only matcher excludes. Reminder counters therefore never clear after a
successful Serena call, and an unrelated grep/read burst afterwards can trip
the deny threshold on state that should have been reset.

Add a `serena-hooks reset` command, wired to PostToolUse on Serena's own
tools, that resets the counters after a successful call. Gated on the call
having succeeded (`tool_response` carrying no `isError: true`, the MCP
`tools/call` result shape) so a failed Serena call does not mask a real
grep/read streak, per the issue's own acceptance criteria. The symbolic-tool
classification is shared with the existing PreToolUse hook via a small
extracted helper so both agree on what counts as a Serena tool.

Fixes #1852
2026-09-02 13:21:42 +02:00
Merlin Hughes a9f99c679b Scala: wait for Metals' reported work, not a fixed 5 seconds (#1859)
Cross-file queries waited 5s after the first file was opened. On a cold Metals
that is long before it has imported the build, indexed, and — crucially —
compiled: references come from SemanticDB, which the build server writes as it
compiles, so a query made in between returns some of the references rather than
none, with nothing to mark it partial. Against a ~700-file Scala 3 build the
first find-references returned 124 of 242.

Metals already reports all of this as work-done progress; Serena did not declare
`window.workDoneProgress`, so none of it arrived. Declare it, track the tokens,
and wait for them before the first cross-file query — the same event-based shape
as TypeScript's indexing wait (#1639), whose hooks this uses.

Readiness is "nothing outstanding for a moment", not "nothing outstanding":
Metals hands off between its phases rather than overlapping them, so the token
set empties for around a second between the import ending and indexing starting,
and a plain drain returns in that gap. Measured on the same build, the first
find-references now returns all 242, taking 32s rather than 22s.
2026-08-13 11:43:24 +02:00
Merlin Hughes 5107b11fb3 Merge pull request #1847 from merlinorg/scala-document-project-root-settings
docs: document the three Scala settings the configuration page omitted
2026-08-12 15:06:48 +02:00
Dominik Jain c9fa15741e Add documentation on prompt templating in Serena 2026-08-08 17:57:21 +02:00
Tyce HerrmanandDominik Jain 217517ecdf feat(kotlin): update language server to 262.9593.0 (#1811)
* feat(kotlin): update language server to 262.9593.0

Note: download URL structure differs depending on version

---------

Co-authored-by: Dominik Jain <dominik.jain@oraios-ai.de>
2026-08-08 16:25:13 +02:00
Tyce Herrman 8364fc5548 fix(java): remove unused IntelliCode integration 2026-08-08 16:19:31 +02:00
Dominik Jain df24c3151f Clarify responsibilities when exposing network services 2026-08-05 21:31:59 +02:00
Tyce Herrman 3ede3cbc33 Docs: use SessionEnd for Codex hook cleanup (#1733)
* Docs: use SessionEnd for Codex hook cleanup

* Docs: note legacy Codex Stop issue
2026-07-29 23:36:41 +02:00
Dominik Jain 21f4b3fe58 Add section on trusted projects 2026-07-29 13:53:03 +02:00
Dominik Jain 466960b12f Remove unmaintainable parts of security documentation 2026-07-29 13:13:06 +02:00
Dominik Jain 68884f1190 Add callout on security advisories 2026-07-24 19:07:43 +02:00
Tyce Herrman d86fd6c0c8 Support nixd ls_path and config_path 2026-07-24 02:22:23 +02:00
Amir Fathi 61ca9ba5de TypeScript: make the tsserver progress-start grace configurable, raise the default
find_referencing_symbols/request_references could return incomplete results on
large TypeScript projects. _wait_for_indexing_start_or_completion waits only
_INDEXING_START_GRACE_S (hardcoded 2.0s) for tsserver to *start* emitting
$/progress after opening files; if nothing has appeared by then, it assumes no
indexing is needed and proceeds immediately. On a large project, tsserver can
take longer than that just to resolve the project graph before it even creates
the first progress token, so the first cross-file reference query can race a
project that is still loading.

Every caller of _wait_for_indexing_start_or_completion (the base TypeScript
path and the Svelte companion) always calls expect_indexing() first, so the
"no progress observed" branch is reached specifically when indexing is already
expected; it cannot distinguish "nothing to do" from "not started yet",
because the two look identical from the client for as long as tsserver stays
quiet. That ambiguity cannot be resolved from client-observable signals alone,
so this makes the grace an ls_specific_settings knob (`indexing_start_grace`),
the same way indexing_timeout and server_ready_timeout already are, and raises
the default from 2.0s to 5.0s.

Fixes #1586
2026-07-24 00:27:36 +02:00
Dr. Dominik Jain ef0e218fb1 Allow language server priorities to be configured in serena_config.yml (#1736) 2026-07-22 17:26:56 +02:00
xormania 9debf7742a Add Grok Build support (context, setup, native hooks)
Adds first-class support for xAI's Grok Build CLI, following the
existing client-integration pattern (Claude Code, CodeBuddy, Codex):

- grok context: single-project, shaped like claude-code.yml, with the
  file-tool exclusions appropriate for a CLI agent that has its own
  read/edit/shell tools. structured_tool_output is left at the auto
  default (as in the codex and codebuddy contexts); claude-code's
  explicit false is a Claude-Code-specific bug workaround that is not
  carried over.
- serena setup grok: registers Serena as a user-scoped MCP server via
  "grok mcp add" after detecting a compatible grok CLI.
- serena-hooks --client=grok: Grok-native PreToolUse output
  ({decision, reason}) instead of the Claude-style hookSpecificOutput
  envelope; grep/read detection extended to Grok's tool names and
  shell payloads (target_file/targetFile path keys, non-string command
  values handled defensively). The payload-parsing refinements live in
  the remind hook's client-agnostic parsing and apply to all hook
  clients: a non-string command value previously raised, and
  target_file/targetFile paths were not recognized.
- Docs (030_clients.md #grok), unit tests for setup/hooks/context, and
  scripts/live_test_grok.py - a zero-inference, state-preserving live
  smoke test against a real grok installation (documented in
  CONTRIBUTING.md). Its M5 check verifies the structured-output wire
  shape: the grok context (auto default) serves an output schema and
  structuredContent for string-returning tools, while the claude-code
  context (explicit false workaround) serves plain text only.
2026-07-21 21:18:16 +02:00
Tyce Herrman 96ee9b65e2 Add BasedPyright as alternative LSP for Python (#1705) 2026-07-21 20:11:32 +02:00
Vasil Boychev f631a4bceb PHP: expose file_filter via ls_specific_settings (#1710) (#1711)
- PHP/Intelephense: expose `file_filter` via `ls_specific_settings["php"]`, so that additional
  extensions containing PHP sources (e.g. Drupal's `.module` / `.install` / `.inc` / `.theme`)
  become visible to the symbol tools and are indexed by the language server
- PHP: treat `.phtml` files as PHP sources by default (all PHP language servers)
2026-07-20 11:47:29 +02:00
18d4cc007b Java (JDT-LS): allow registering additional JRE/JDK runtimes via config (#1715)
* Java (JDT-LS): allow registering additional JRE/JDK runtimes via config

JDT-LS resolves each imported module's JRE_CONTAINER/.../JavaSE-NN/
classpath entry against its own "Installed JREs" list, which Serena
previously hardcoded to a single JavaSE-21 entry pointing at the
bundled JRE. Projects whose source/target level exceeds that bundled
JDK (e.g. sourceCompatibility = VERSION_25) get a container that never
resolves, so every JDK type -- java.lang.Object, java.util.*, etc. --
comes back "cannot be resolved", silently breaking diagnostics and
cross-module resolution. There was no config key to tell JDT-LS about
an installed newer JDK.

Add an optional `runtimes` list under ls_specific_settings.java,
mirroring VS Code's java.configuration.runtimes shape (name, path,
optional default/sources/javadoc). Entries are validated (name+path
required, path must exist) via the new _resolve_configured_runtimes(),
then merged with the bundled JavaSE-21 default: configured runtimes
extend the list; an entry reusing the "JavaSE-21" name overrides the
bundled one; if a configured entry claims `default`, the bundled
runtime's own default flag is cleared so JDT-LS doesn't see two
defaults. The `runtimes` key is also added to the JDTLS workspace-hash
inputs so changing it lands in a fresh workspace instead of reusing a
stale Buildship/Maven import.

Testing: added 14 unit tests in
test/solidlsp/java/test_jdtls_path_resolution.py covering
_resolve_configured_runtimes validation (missing keys, wrong types,
nonexistent paths) and the merge behavior in
_create_base_initialize_params (extension, name-collision override,
default hand-off). Ran `poe format`, `poe type-check`, and
`pytest test/solidlsp/java -m "not java"` (69 passed, 8 deselected
real-JDTLS tests that require a JDK) locally.

Fixes #1478

* docs: document java.runtimes in configuration guide

Address review feedback on #1715 by documenting ls_specific_settings.java.runtimes
in 050_configuration.md (settings table, note, and example).

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: arimu1 <19286898+arimu1@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-19 16:03:25 +02:00
Dominik Jain 96e95c0b5d Adjust Docker compose template (compose.yaml): Expose ports to host only 2026-07-18 13:01:13 +02:00
Michael Panchenko c6029c6fb2 Minor fix in docs claude-desktop -> desktop-app 2026-07-14 10:41:43 +02:00
weiconghe 7b06a67509 Perl: expose file_filter/ignore_dirs via ls_specific_settings (#1449)
Perl::LanguageServer only indexes files whose extension is in its
`perl.fileFilter` and skips directories in `perl.ignoreDirs`. Both were
hardcoded in PerlLanguageServer, so projects whose Perl source uses
non-standard extensions (e.g. .cgi / .psgi web handlers, which can
dominate a mature codebase) had no way to make those files visible to
symbol/reference queries without forking Serena (#1449).

Surface both lists through `ls_specific_settings["perl"]` (keys
`file_filter` and `ignore_dirs`), defaulting to the existing values so
behaviour is unchanged for current projects. The resolution lives in a
pure static method `_resolve_filter_settings` so the config plumbing is
covered by unit tests that don't require a Perl runtime.

Keep Serena's symbol index in sync with the LS (#1449, per review):
`find_symbol` and symbol indexing are driven by
`Language.PERL.get_source_fn_matcher()`, so adding an extension (e.g.
.cgi) to `file_filter` alone would leave the matcher untouched and the
extension's symbols invisible. Since that matcher is now a @cache'd
per-language singleton, add a `FilenameMatcher.add_extensions()` mutator
and call it from `PerlLanguageServer` so the configured extensions also
reach the symbol index, the ignore checks, and language composition.

Avoid cross-project leakage (per review): because the matcher is a
process-wide singleton, extensions added for one project would otherwise
persist into the next. `FilenameMatcher` now snapshots its initial
configuration and exposes `reset()`, and `SolidLanguageServer.__init__`
resets the matcher right after `self.language` is determined, so every
activation starts from the language's defaults before the subclass
re-applies its own `file_filter`.

This complements 860c5841 (which added .t to the default list as a
surface-level fix) by addressing the root configurability gap that the
maintainer acknowledged in #1449.
2026-07-12 13:19:39 +02:00
xormania 9580a6aec7 Svelte + TypeScript: fail loudly on companion TS timeouts; deterministic test fixture
Make the Svelte companion TypeScript server raise on readiness and
indexing timeouts instead of silently proceeding with a partial index,
turning flaky/wrong cross-file results into clear failures:

- TypeScriptLanguageServer: timeout handling factored into overridable
  hooks (_handle_server_ready_timeout, _handle_project_indexing_timeout);
  the base server keeps its historical permissive behavior, so plain
  TypeScript setups are unchanged.
- SvelteTypeScriptServer: both overrides raise TimeoutError; only the
  indexing-timeout error includes describe_indexing_state(), instead of
  serving requests from a cold or partially indexed program.
- Configurable server_ready_timeout / indexing_timeout via
  ls_specific_settings.
- SvelteLanguageServer: file-open failures during companion preparation
  raise SvelteCompanionPreparationError with a count-first file listing
  (capped at 10), chained to the first underlying error so the cause is
  visible without DEBUG logging.

Apply the same fail-loudly principle to the test fixture bootstrap:

- Svelte test repo: npm ci with a committed package-lock.json, removing
  dependency-resolution non-determinism from CI runs.
- Run svelte-kit sync explicitly during fixture setup and fail loudly if
  .svelte-kit/tsconfig.json cannot be generated. The fixture's "prepare"
  script masks sync failures ("svelte-kit sync || echo ''"), and a known
  npm bug (npm/cli#4828) can silently skip platform-specific optional
  dependencies; the result is unresolvable $lib path aliases and
  cross-file tests failing with partial results instead of a clear,
  actionable error.
- codespell: skip third-party fixture repositories, using the anchored
  pattern ./test/resources/repos (codespell matches skip globs against
  the ./-prefixed paths it walks, so an anchor-less pattern never
  matches).

Also add direct regression tests for the timeout-policy split
(test/solidlsp/test_typescript_timeout_policy.py: base stays
permissive, companion raises, settings plumbing and precedence, and
start-or-completion indexing-wait semantics). The tests use no mocking or
patching of any kind; a hand-written call-recording fake drives the companion
guard against real file discovery under a pytest tmp_path. They spawn no LS
process and avoid external readiness races; one wait test uses a real Timer
with a 30s ceiling.

The configuration docs state that the TypeScript table lists both knobs; the
Svelte table lists indexing_timeout, with readiness inheritance documented in
prose.
2026-07-11 18:06:17 -04:00
osmanrafiq 9ccd5f02a2 Fix Java Gradle import JAVA_HOME fallback (#1657) 2026-07-06 00:14:28 +02:00
Dominik Jain 352b3d3fed Allow to overrride entries of initializationOptions via LS-specific settings 2026-07-03 12:49:56 +02:00
Dominik Jain 9157e25671 Improve docs 2026-07-03 12:25:18 +02:00
Dominik Jain 81b664bb32 Merge branch 'main' into ls-init-options
Conflicts:
	src/solidlsp/language_servers/typescript_language_server.py
2026-07-03 11:41:18 +02:00
bymebyu 81b1bc804d TypeScript/VTS: event-based indexing wait and no automatic typing acquisition (#1639)
* TypeScript/VTS: event-based indexing wait, no automatic typing acquisition

- Set disableAutomaticTypingAcquisition in initializationOptions (TS and VTS)
  so tsserver does not download type packages from the network during
  language server initialization.
- Replace the fixed 2-second wait before cross-file reference requests with
  $/progress-based indexing tracking: a pre-open hook arms the tracking
  (expect_indexing) before didOpen, then the request waits until indexing
  progress drains (wait_for_indexing), bounded by a configurable
  'indexing_timeout' (ls_specific_settings, default 30s). If tsserver does
  not start reporting progress within a 2-second grace period (the previous
  fixed wait), the request proceeds — so the fast path is never slower than
  before, while slow indexing is actually awaited instead of guessed at.
2026-07-03 11:38:53 +02:00
Dominik Jain c904efed5e SolidLSP: Allow workspace folders to be flexibly configured across all language servers
that use the newly introduced InitializeParamsBuilder

- Add new configuration option `ls_workspace_folders` to allow indexed source folders to be specified
  explicitly. In monorepos, this allows the set of indexed folders to be restricted to a subset of
  the repository. #1627
- Rename configuration option `additional_workspace_folders` to `ls_additional_workspace_folders`
  and support the option across all language servers that use an InitializeParamsBuilder
  (previously limited strictly to the TypeScript server).
  Moved the option from SolidLSPSettings to LanguageServerConfig, where it belongs.

Apply InitializeParamsBuilder in TypeScriptLanguageServer and its subclasses.
2026-07-03 01:05:40 +02:00
Dominik Jain 8c418dc799 Support ls_base_cmd in LanguageServerDependencyProviderBaseCommand
ls_base_cmd allows the user to override the base command with a
multi-element command (e.g. ["npx", "-y", "/my/local/package"]),
generalising ls_path, which it takes precedence over.
2026-07-02 21:59:46 +02:00
Dominik Jain 60abdd5297 Support ls_args and ls_extra_args centrally in LanguageServerDependencyProviderBaseCommand
* ls_args overrides the internal command builder, fully defining the arguments
* ls_extra_args appends additional arguments to the launch command
2026-07-02 21:59:46 +02:00
Jordan CarneyandDominik Jain dcbd8ce064 Add activation_command to project config (#1623)
Add activation_command to project config

Adds two optional fields to ProjectConfig:
- activation_command: shell command run in the project root before the
  language backend (LSP or JetBrains) initialises
- activation_command_timeout: safety backstop (default 180s); on expiry
  the process tree is killed and activation continues

The command is only executed for trusted projects (trusted_project_path_patterns).
Exit code is the primary completion signal; failures and timeouts are logged
but never abort activation (no return channel to the LLM at that point).

Closes #1606

---------

Co-authored-by: Dominik Jain <dominik.jain@oraios-ai.de>
2026-07-01 18:12:05 +02:00
Devin 68a4af4ac1 Add CodeBuddy agent integration (#1581) 2026-06-28 13:00:41 +02:00
Dominik Jain 5a867ff3fe Consider ls_specific_settings in project configurations only for trusted projects 2026-06-26 13:05:54 +02:00
Dominik Jain d7a2026656 Add notion of trusted projects #1608 2026-06-26 13:05:54 +02:00
Tomi P. Hakala b5b9cc4ffc Fix find_project_root hijacking git worktrees nested under a Serena project (#1550)
* Fix find_project_root hijacking git worktrees nested under a Serena project

find_project_root searched all ancestor levels for .serena/project.yml
before ever looking for .git. A git worktree whose own .git is a pointer
file, nested under a directory that is an explicit Serena project, was
resolved to the ancestor project instead of the worktree. With CLI agents
that launch via --project-from-cwd (Claude Code, Codex, Gemini), this
silently bound the server to the wrong working tree: reads returned stale
symbols and edits landed in the parent repo.

Walk up in a single pass so the nearest project boundary wins, whether it
is a .serena/project.yml or a .git (dir or worktree/submodule pointer
file). Same-level behavior is unchanged. Adds a regression test.

* Document worktree project-root fix in changelog and usage docs
2026-06-07 18:05:01 +02:00
Dominik Jain 1a3943b917 Add configuration option jetbrains_launch_command, allowing Serena to spawn IDE instances automatically
upon project activation

Serena searches for the plugin instance upon project activation, and if the instance is not found
and the setting is configured, launches a new IDE instance based on the command
2026-06-02 17:08:17 +02:00
Dominik Jain a10c3e1c5a Update additional usage pointers
* Remove obsolete/outdated content
* git-worktree:
  - Remove incorrect recommendation to copy the entire .serena folder
    in order to retain the cache (cache contains abs. paths)
  - Recommend to add the .serena folder to version control instead
    (which will not include the cache folder)

Relates to #805
2026-06-02 13:46:36 +02:00
Felix Rath 7b9fc9c5b7 fix(nix): Add Linux-support for the tray manager in AppIndicator trays
Assisted-by: gpt-5.5
2026-06-01 15:17:36 +02:00
Petr Devyaterikov 7bf30080f6 typescript_vts: add initialization_options pass-through (#1507)
* typescript_vts: add initialization_options pass-through

Extends ls_specific_settings["typescript_vts"] with an optional
initialization_options key — a dict forwarded to vtsls via all three
LSP configuration channels:

- the initialize request (initializationOptions field),
- a workspace/didChangeConfiguration notification right after initialize,
- and responses to workspace/configuration pulls, looked up per section
  (e.g. "typescript", "vtsls", "javascript", or dotted paths like
  "typescript.tsdk").

All three channels are necessary because different parts of vtsls read
settings from different places — notably typescript.tsdk, which vtsls
pulls via workspace/configuration rather than reading from
initializationOptions. Without the pull-answer, setting tsdk had no
effect.

Primary use case: Yarn Plug'n'Play projects. Running
`yarn dlx @yarnpkg/sdks vscode` in the project root generates
.yarn/sdks/typescript/lib/tsserver.js, a PnP-aware tsserver. The user
then points vtsls at it with:

    ls_specific_settings:
      typescript_vts:
        initialization_options:
          typescript:
            tsdk: "<...>/.yarn/sdks/typescript/lib"
          vtsls:
            autoUseWorkspaceTsdk: true

autoUseWorkspaceTsdk is required alongside tsdk because, in a headless
LSP context, there is no UI prompt to confirm switching to the
workspace TypeScript version. See yioneko/vtsls#169 for the recipe.

Default behaviour is unchanged — the field is optional, omitted from
the initialize params and didChangeConfiguration when unset or empty,
and workspace/configuration continues to answer empty sections.
2026-05-27 13:31:57 +02:00
Michael Panchenko d0dbed3779 Shorten command in installation instructions
--prerelease=allow is no longer necessary (pythonnet was bumped) and @latest is not needed either (same effect as without it)
2026-05-26 17:10:14 +02:00