Test demonstrates the fix for escaped character handling order:
- Escaped negation patterns are treated as literals, not negations
- Real negation patterns properly override ignore rules
- Use correct anchoring logic: only patterns starting with '/' are anchored
- Fix test expectation for negation patterns to match Git behavior
- Apply code formatting
such that FindReferencingSymbolsTool is now also implemented without a direct reference
to the language server
All references to Component.language_server have been removed
adding all necessary related functionality:
* Handling of ignored files
* Enumeration of source files
Functions removed from SolidLanguageServer:
* index_repository
* request_parsed_files
* search_files_for_pattern
Implement SearchForPatternTool without language server
Summary
Fixes X11/XCB crash when running serena-mcp-server in directories without source files
Adds headless environment detection to prevent GUI operations in SSH/WSL/Docker environments
Improves error messages to provide clear guidance when no source files are found
Problem
When running serena-mcp-server --context ide-assistant --project /empty/dir in a headless environment (SSH, WSL, Docker), the application would crash with X11/XCB errors:
[xcb] Unknown sequence number while appending request
[xcb] You called XInitThreads, this is not your fault
[xcb] Aborting, sorry about that.
python: ../../src/xcb_io.c:157: append_pending_request: Assertion `\!xcb_xlib_unknown_seq_number' failed.
Root Cause
Empty directories cause ProjectConfig.autogenerate() to raise a ValueError
The exception handler attempts to show a GUI error dialog using tkinter
In headless environments, tkinter crashes with X11/XCB errors
Solution
Headless Detection: Added is_headless_environment() to detect when running without a display
Skip GUI in Headless: Modified show_fatal_exception_safe() to skip GUI attempts in headless environments
Better Error Messages: Improved the error message for empty projects with clear instructions
* In addition to exclusion, support notion of "optional tools" that
are disabled by default and enabled only upon request
* Unify the handling of inclusions/exclusions across
- SerenaConfig
- ProjectConfig
- SerenaAgentContext
- SerenaAgentMode
* Make ToolRegistry a singleton and simplify all related operations
The lib/ directory was being ignored by the root .gitignore Python packaging rule.
This caused CI failures because test files like models.ex, services.ex, etc. were
missing from the repository.
- Add exception to .gitignore for test/resources/repos/elixir/test_repo/lib
- Add all missing Elixir source files:
- examples.ex (example functions and data structures)
- models.ex (User struct and related functions)
- services.ex (UserService module)
- test_repo.ex (main module)
- utils.ex (utility functions)
- ignored_dir/ignored_module.ex (for testing directory filtering)
These files are essential for Elixir language server tests to function properly.
- Add Elixir/Erlang setup to pytest.yml using erlef/setup-beam@v1
- Configure Elixir 1.18.4 and OTP 26.1 for CI compatibility
- Fix codespell false positive for '*cripts' glob pattern with ignore comment
- Resolves CI test failures for Elixir language server integration
Now when the language server starts, the initialisation will scan for solution or project files, and then pass them to the language server instructing it to open them. Which in-turn should give us all the nice context since the code is actually being 'loaded' up properly now.