[BUG] Actor compiler ignores spec-defined lsp: YAML binding field — only reads internal lsp_bindings key #9180

Open
opened 2026-04-14 09:31:02 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Commit Message: fix(actor): parse spec-defined lsp: YAML binding field in actor compiler — support explicit, language, and auto-detect modes
  • Branch Name: fix/lsp-actor-binding-compiler

Background and Context

The actor compiler (src/cleveragents/actor/compiler.py) is responsible for translating actor YAML configuration into CompilationMetadata, including lsp_bindings that tell the LSP Runtime which servers to start when an actor activates.

The specification (docs/specification.md §Actor LSP Binding, lines 20729–20803) defines that actors declare LSP dependencies via the lsp: field in their YAML configuration. Three binding modes are supported:

  1. Explicit list: lsp: [local/pyright, local/ruff-lsp] — one LspBinding per server name
  2. Language-based object: lsp: {languages: [python, typescript]} — resolve servers from LSP Registry
  3. Auto-detect object: lsp: {auto: true} — runtime resolves from project resources

The ActorConfigSchema in src/cleveragents/actor/schema.py (line 757) correctly defines the lsp field. However, the compiler's _extract_lsp_bindings() method (lines 158–178) reads node.config.get("lsp_bindings", []) — a low-level internal key that expects a list of dicts with lsp_server_name keys — and never reads the spec-defined lsp: field at all.

Expected Behavior

When an actor YAML contains lsp: [local/pyright], lsp: {languages: [python]}, or lsp: {auto: true}, the actor compiler must parse these into LspBinding objects and include them in CompilationMetadata.lsp_bindings, so the LSP Runtime can start the appropriate servers when the actor activates.

Actual Behavior

src/cleveragents/actor/compiler.py _extract_lsp_bindings() (lines 158–178) reads node.config.get("lsp_bindings", []) — a low-level internal key that expects a list of dicts with lsp_server_name keys. It never reads the spec-defined lsp: field from ActorConfigSchema (defined in src/cleveragents/actor/schema.py line 757). The three spec-defined binding modes (list[str], {languages: [...]}, {auto: true}) are never parsed.

As a result, CompilationMetadata.lsp_bindings is always empty for actors using the spec-defined lsp: field, and the LSP Runtime is never activated for those actors.

Steps to Reproduce

  1. Create an actor YAML with lsp: [local/pyright]
  2. Register the actor: agents actor add --config actor.yaml
  3. Run the actor: agents actor run local/my-actor "check types"
  4. Observe: No LSP server is started; lsp/diagnostics tool is not available to the actor
  5. The actor has no language intelligence despite the lsp: binding being declared

Acceptance Criteria

  • _extract_lsp_bindings() reads ActorConfigSchema.lsp field (not node.config["lsp_bindings"])
  • Explicit list mode lsp: [local/pyright, local/ruff-lsp] produces one LspBinding per server name in CompilationMetadata.lsp_bindings
  • Language-based mode lsp: {languages: [python, typescript]} produces LspBinding objects with language resolution
  • Auto-detect mode lsp: {auto: true} sets auto_detect=True on binding; runtime resolves from project resources
  • Jinja2 dynamic binding mode (spec lines 20782–20803) is deferred to runtime evaluation
  • Per-node lsp_binding (NodeLspBinding) overrides actor-level lsp: for that node
  • All three binding modes have unit tests in the compiler test suite
  • nox (all default sessions) passes with no errors

Subtasks

  • Update _extract_lsp_bindings() in compiler.py to read ActorConfigSchema.lsp field (not node.config["lsp_bindings"])
  • Implement parsing for explicit list mode: lsp: [local/pyright, local/ruff-lsp] → one LspBinding per server name
  • Implement parsing for language-based mode: lsp: {languages: [python, typescript]} → resolve servers from LSP Registry at compile time or defer to runtime
  • Implement parsing for auto-detect mode: lsp: {auto: true} → set auto_detect=True on binding, runtime resolves from project resources
  • Implement parsing for Jinja2 dynamic binding mode (spec lines 20782–20803) — defer to runtime evaluation
  • Ensure per-node lsp_binding (NodeLspBinding) overrides actor-level lsp: for that node
  • Add unit tests for all three binding modes in the compiler
  • Run nox (all default sessions), fix any errors

Definition of Done

All three spec-defined lsp: binding modes are correctly parsed by the actor compiler into LspBinding objects in CompilationMetadata.lsp_bindings. The LSP Runtime activates the correct servers when an actor with lsp: bindings runs. All subtasks checked off, commit on branch fix/lsp-actor-binding-compiler, PR merged to master.


Automated by CleverAgents Bot
Agent: new-issue-creator
Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor

## Metadata - **Commit Message:** `fix(actor): parse spec-defined lsp: YAML binding field in actor compiler — support explicit, language, and auto-detect modes` - **Branch Name:** `fix/lsp-actor-binding-compiler` ## Background and Context The actor compiler (`src/cleveragents/actor/compiler.py`) is responsible for translating actor YAML configuration into `CompilationMetadata`, including `lsp_bindings` that tell the LSP Runtime which servers to start when an actor activates. The specification (`docs/specification.md` §Actor LSP Binding, lines 20729–20803) defines that actors declare LSP dependencies via the `lsp:` field in their YAML configuration. Three binding modes are supported: 1. **Explicit list:** `lsp: [local/pyright, local/ruff-lsp]` — one `LspBinding` per server name 2. **Language-based object:** `lsp: {languages: [python, typescript]}` — resolve servers from LSP Registry 3. **Auto-detect object:** `lsp: {auto: true}` — runtime resolves from project resources The `ActorConfigSchema` in `src/cleveragents/actor/schema.py` (line 757) correctly defines the `lsp` field. However, the compiler's `_extract_lsp_bindings()` method (lines 158–178) reads `node.config.get("lsp_bindings", [])` — a low-level internal key that expects a list of dicts with `lsp_server_name` keys — and never reads the spec-defined `lsp:` field at all. ## Expected Behavior When an actor YAML contains `lsp: [local/pyright]`, `lsp: {languages: [python]}`, or `lsp: {auto: true}`, the actor compiler must parse these into `LspBinding` objects and include them in `CompilationMetadata.lsp_bindings`, so the LSP Runtime can start the appropriate servers when the actor activates. ## Actual Behavior `src/cleveragents/actor/compiler.py` `_extract_lsp_bindings()` (lines 158–178) reads `node.config.get("lsp_bindings", [])` — a low-level internal key that expects a list of dicts with `lsp_server_name` keys. It never reads the spec-defined `lsp:` field from `ActorConfigSchema` (defined in `src/cleveragents/actor/schema.py` line 757). The three spec-defined binding modes (`list[str]`, `{languages: [...]}`, `{auto: true}`) are never parsed. As a result, `CompilationMetadata.lsp_bindings` is always empty for actors using the spec-defined `lsp:` field, and the LSP Runtime is never activated for those actors. ## Steps to Reproduce 1. Create an actor YAML with `lsp: [local/pyright]` 2. Register the actor: `agents actor add --config actor.yaml` 3. Run the actor: `agents actor run local/my-actor "check types"` 4. Observe: No LSP server is started; `lsp/diagnostics` tool is not available to the actor 5. The actor has no language intelligence despite the `lsp:` binding being declared ## Acceptance Criteria - [ ] `_extract_lsp_bindings()` reads `ActorConfigSchema.lsp` field (not `node.config["lsp_bindings"]`) - [ ] Explicit list mode `lsp: [local/pyright, local/ruff-lsp]` produces one `LspBinding` per server name in `CompilationMetadata.lsp_bindings` - [ ] Language-based mode `lsp: {languages: [python, typescript]}` produces `LspBinding` objects with language resolution - [ ] Auto-detect mode `lsp: {auto: true}` sets `auto_detect=True` on binding; runtime resolves from project resources - [ ] Jinja2 dynamic binding mode (spec lines 20782–20803) is deferred to runtime evaluation - [ ] Per-node `lsp_binding` (NodeLspBinding) overrides actor-level `lsp:` for that node - [ ] All three binding modes have unit tests in the compiler test suite - [ ] `nox` (all default sessions) passes with no errors ## Subtasks - [ ] Update `_extract_lsp_bindings()` in `compiler.py` to read `ActorConfigSchema.lsp` field (not `node.config["lsp_bindings"]`) - [ ] Implement parsing for explicit list mode: `lsp: [local/pyright, local/ruff-lsp]` → one `LspBinding` per server name - [ ] Implement parsing for language-based mode: `lsp: {languages: [python, typescript]}` → resolve servers from LSP Registry at compile time or defer to runtime - [ ] Implement parsing for auto-detect mode: `lsp: {auto: true}` → set `auto_detect=True` on binding, runtime resolves from project resources - [ ] Implement parsing for Jinja2 dynamic binding mode (spec lines 20782–20803) — defer to runtime evaluation - [ ] Ensure per-node `lsp_binding` (NodeLspBinding) overrides actor-level `lsp:` for that node - [ ] Add unit tests for all three binding modes in the compiler - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done All three spec-defined `lsp:` binding modes are correctly parsed by the actor compiler into `LspBinding` objects in `CompilationMetadata.lsp_bindings`. The LSP Runtime activates the correct servers when an actor with `lsp:` bindings runs. All subtasks checked off, commit on branch `fix/lsp-actor-binding-compiler`, PR merged to master. --- **Automated by CleverAgents Bot** Agent: new-issue-creator Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor
HAL9000 added this to the v3.2.0 milestone 2026-04-14 17:39:05 +00:00
Author
Owner

Triage Decision [AUTO-OWNR-1]: Verified as a spec compliance bug. The actor compiler ignores the spec-defined lsp: YAML binding field and only reads the internal lsp_bindings key. This breaks actor YAML configuration for LSP bindings. Must Have for v3.2.0.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

✅ **Triage Decision [AUTO-OWNR-1]**: Verified as a spec compliance bug. The actor compiler ignores the spec-defined `lsp:` YAML binding field and only reads the internal `lsp_bindings` key. This breaks actor YAML configuration for LSP bindings. `Must Have` for v3.2.0. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#9180
No description provided.