Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 6, 2025

Adds abstraction layer for delegating LSP requests (completion, hover, definition) to cloud-based code intelligence services with automatic fallback to local LSP servers.

Changes

  • Cloud agent interface (server/src/cloud/agent.ts)

    • ICloudAgent interface with HTTP implementation
    • Configurable via environment variables (CLOUD_AGENT_ENABLED, CLOUD_AGENT_ENDPOINT, CLOUD_AGENT_API_KEY)
    • Timeout handling and automatic fallback on errors
  • LSP proxy delegation (server/src/lsp/proxy.ts)

    • Optional cloudAgent parameter added to constructor
    • Request handlers try cloud agent first, fall back to local LSP
    // Try cloud agent first if available
    if (this.cloudAgent) {
      const cloudResult = await this.cloudAgent.completion(params);
      if (cloudResult !== null) return cloudResult;
    }
    // Fall back to local LSP
    const client = await this.lsManager.getOrCreateClient(file.languageId);
  • Configuration integration (server/src/index.ts)

    • Load cloud agent config from environment
    • Conditionally instantiate and pass to LSP proxy instances

Testing

  • 11 unit tests covering enabled/disabled states, success/failure paths, and fallback behavior
  • No security vulnerabilities (CodeQL)

Backward Compatibility

Cloud agent is optional and disabled by default. Zero impact on existing deployments.

Original prompt

Delegate: "Delegate to cloud agent"

Created from VS Code via the GitHub Pull Request extension.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Delegate functionality to cloud agent Add optional cloud agent delegation for LSP requests Dec 6, 2025
Copilot AI requested a review from Lewin671 December 6, 2025 11:01
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.

2 participants