feat(lsp): implement functional LSP runtime #1044

Merged
hamza.khyari merged 1 commits from feature/lsp-functional-runtime into master 2026-03-24 13:17:44 +00:00
Member

Summary

Implement the functional LSP runtime, replacing local-mode stubs with real LSP protocol support.

New files

  • lsp/transport.pyStdioTransport for subprocess JSON-RPC over stdin/stdout
  • lsp/client.pyLspClient implementing LSP protocol (initialize/shutdown/diagnostics/completions)
  • lsp/lifecycle.pyLspLifecycleManager with reference-counted instances, health checks, crash restart
  • lsp/discovery.pyLanguageDiscovery with 4-layer detection (extension, shebang, UKO, project config)
  • features/lsp_functional_runtime.feature — 27 Behave BDD scenarios
  • robot/lsp_functional_runtime.robot — 6 Robot integration tests

Modified files

  • lsp/runtime.py — Replaced stubs with real LSP calls via lifecycle manager
  • lsp/tool_adapter.py — Runtime-delegating handlers with local-mode fallback
  • lsp/__init__.py — Updated exports
  • features/consolidated_misc.feature — Updated runtime test assertions
  • features/steps/lsp_registry_steps.py — Updated error handling for new runtime

Quality Gates

Session Result
nox -s lint PASS
nox -s typecheck PASS (0 errors)
nox -s unit_tests -- features/lsp_functional_runtime.feature PASS (27 scenarios)
nox -s unit_tests -- features/consolidated_misc.feature PASS (250 scenarios)
nox -s unit_tests -- features/lsp_cli_new_coverage.feature PASS (20 scenarios)

Closes #826

## Summary Implement the functional LSP runtime, replacing local-mode stubs with real LSP protocol support. ### New files - `lsp/transport.py` — `StdioTransport` for subprocess JSON-RPC over stdin/stdout - `lsp/client.py` — `LspClient` implementing LSP protocol (initialize/shutdown/diagnostics/completions) - `lsp/lifecycle.py` — `LspLifecycleManager` with reference-counted instances, health checks, crash restart - `lsp/discovery.py` — `LanguageDiscovery` with 4-layer detection (extension, shebang, UKO, project config) - `features/lsp_functional_runtime.feature` — 27 Behave BDD scenarios - `robot/lsp_functional_runtime.robot` — 6 Robot integration tests ### Modified files - `lsp/runtime.py` — Replaced stubs with real LSP calls via lifecycle manager - `lsp/tool_adapter.py` — Runtime-delegating handlers with local-mode fallback - `lsp/__init__.py` — Updated exports - `features/consolidated_misc.feature` — Updated runtime test assertions - `features/steps/lsp_registry_steps.py` — Updated error handling for new runtime ### Quality Gates | Session | Result | |---|---| | `nox -s lint` | PASS | | `nox -s typecheck` | PASS (0 errors) | | `nox -s unit_tests -- features/lsp_functional_runtime.feature` | PASS (27 scenarios) | | `nox -s unit_tests -- features/consolidated_misc.feature` | PASS (250 scenarios) | | `nox -s unit_tests -- features/lsp_cli_new_coverage.feature` | PASS (20 scenarios) | Closes #826
hamza.khyari added the
Type
Feature
label 2026-03-18 04:38:05 +00:00
hamza.khyari self-assigned this 2026-03-18 11:43:52 +00:00
hamza.khyari added the
State
In Review
label 2026-03-18 11:43:56 +00:00
hamza.khyari added this to the v3.6.0 milestone 2026-03-18 11:44:03 +00:00
freemo approved these changes 2026-03-19 04:55:39 +00:00
Dismissed
freemo left a comment
Owner

Code Review — PR #1044 feat(lsp): implement functional LSP runtime

The largest of the three hamza.khyari PRs at +2,336 lines, but the architecture justifies the scope. Clean separation: StdioTransport (process I/O) → LspClient (protocol) → LspLifecycleManager (reference counting + health) → LspRuntime (orchestration). The LanguageDiscovery module with 4-layer detection (extension map, shebang, UKO, project config) and 70+ language mappings is thorough.

27 Behave BDD scenarios + 6 Robot integration tests provide strong coverage. The replacement of LspNotAvailableError stubs with real LSP calls is a significant capability upgrade.

Approved. No issues found.

## Code Review — PR #1044 `feat(lsp): implement functional LSP runtime` The largest of the three hamza.khyari PRs at +2,336 lines, but the architecture justifies the scope. Clean separation: `StdioTransport` (process I/O) → `LspClient` (protocol) → `LspLifecycleManager` (reference counting + health) → `LspRuntime` (orchestration). The `LanguageDiscovery` module with 4-layer detection (extension map, shebang, UKO, project config) and 70+ language mappings is thorough. 27 Behave BDD scenarios + 6 Robot integration tests provide strong coverage. The replacement of `LspNotAvailableError` stubs with real LSP calls is a significant capability upgrade. **Approved.** No issues found.
freemo requested review from freemo 2026-03-19 05:16:57 +00:00
freemo requested review from brent.edwards 2026-03-19 05:16:57 +00:00
Owner

Day 43 Review — Rebase Required

This PR has merge conflicts with master and cannot be merged in its current state. This is one of 9 Hamza PRs in the resource/LSP domain (v3.5.0-v3.6.0) that all have conflicts. These PRs likely share a common dependency chain and should be rebased sequentially.

@hamza.khyari: Please rebase onto current master. If multiple PRs depend on each other, start with the base PR in the chain and work upward.

Rebase priority: HIGH — these PRs represent significant feature work that is blocked by merge conflicts. Every day they remain conflicted is a day they cannot be reviewed or merged.

**Day 43 Review — Rebase Required** This PR has merge conflicts with `master` and cannot be merged in its current state. This is one of 9 Hamza PRs in the resource/LSP domain (v3.5.0-v3.6.0) that all have conflicts. These PRs likely share a common dependency chain and should be rebased sequentially. @hamza.khyari: Please rebase onto current `master`. If multiple PRs depend on each other, start with the base PR in the chain and work upward. **Rebase priority**: HIGH — these PRs represent significant feature work that is blocked by merge conflicts. Every day they remain conflicted is a day they cannot be reviewed or merged.
hamza.khyari force-pushed feature/lsp-functional-runtime from 8b19d4a737 to 773815cf97 2026-03-24 12:26:56 +00:00 Compare
hamza.khyari dismissed freemo's review 2026-03-24 12:26:56 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

hamza.khyari force-pushed feature/lsp-functional-runtime from 773815cf97 to f185c74ea5 2026-03-24 12:53:57 +00:00 Compare
hamza.khyari force-pushed feature/lsp-functional-runtime from f185c74ea5 to 4ff075e0da 2026-03-24 13:01:23 +00:00 Compare
hamza.khyari merged commit e07b68221a into master 2026-03-24 13:17:44 +00:00
hamza.khyari deleted branch feature/lsp-functional-runtime 2026-03-24 13:17:54 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cleveragents/cleveragents-core#1044