Skip to content

Suggest to enhance into issue when initiate language server (terraform, python)#871

Open
phuongvm wants to merge 9 commits intooraios:mainfrom
phuongvm:main
Open

Suggest to enhance into issue when initiate language server (terraform, python)#871
phuongvm wants to merge 9 commits intooraios:mainfrom
phuongvm:main

Conversation

@phuongvm
Copy link

Dear Team,

I would be happy if I could contribute my fixes into this project. Please review and let me know of your comments.

This is great project and I love it.

--
Regards,

Phuong Lambert

@opcode81
Copy link
Contributor

@phuongvm thanks, but this PR is contributing several unrelated things. Please submit one per PR per meaningful change instead.
For the parts that are indeed fixes, please state very clearly which issues are being resolved (ideally referencing an issue, if present).

# Conflicts:
#	src/solidlsp/language_servers/terraform_ls.py
1. Enhance SearchForPatternTool UX & Context Efficiency

- Lowered default_max_tool_answer_chars from 150,000 to 50,000. 150k is too large, causing LLM context dilution (lost in the middle) and wasting tokens. 50k is a much safer sweet spot.

- When a search result exceeds the max limit, instead of throwing a generic error, the tool now parses the results and returns a smart summary containing the total matches and the 'Top 10 files with the most matches'. This actively guides the AI Agent to iteratively refine its search query rather than hitting a dead end.

2. Clean up noisy logs and suppress misleading errors

- asyncio / Windows: Added a custom exception handler to the main event loop to silently suppress ConnectionResetError [WinError 10054] and pipe transport errors. These happen naturally when clients/language servers close connections but were polluting the logs with scary tracebacks on Windows.

- tools_base.py: Standard AI argument errors like ValueError and FileNotFoundError are now logged as simple WARNINGs instead of full ERROR stack traces.

- TypeScript LS: Added a dummy handler for the $/typescriptVersion notification to eliminate the Unhandled method warning on startup.

3. Fix Terraform Language Server crash

- Initialized self.completions_available = threading.Event() inside TerraformLS.__init__. Previously, the server would crash with an AttributeError when trying to call .set() on this missing attribute.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants