Skip to content

Add Copilot-only lsp frontmatter support with schema, codegen, engine guardrails, and LSP instructions (experimental)#41777

Merged
pelikhan merged 17 commits into
mainfrom
copilot/add-lsp-compiler-support
Jun 27, 2026
Merged

Add Copilot-only lsp frontmatter support with schema, codegen, engine guardrails, and LSP instructions (experimental)#41777
pelikhan merged 17 commits into
mainfrom
copilot/add-lsp-compiler-support

Conversation

Copilot AI commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

This change adds first-class lsp frontmatter support so workflows can declare language-server configuration and have Copilot CLI receive generated lspServers config plus required server dependencies in agent setup. The feature is explicitly gated to Copilot; non-Copilot engines now fail fast when lsp is present. The lsp field is marked experimental and emits a compile-time warning.

  • Frontmatter + schema surface

    • Adds top-level lsp schema in main_workflow_schema.json with an experimental description.
    • Supports per-language entries with:
      • command
      • args
      • fileExtensions
    • Wires typed parsing into workflow/frontmatter models and WorkflowData.
  • LSP manager (normalization + generation)

    • Introduces a dedicated LSP manager to:
      • normalize/validate lsp entries,
      • build Copilot-compatible lspServers payload,
      • emit install steps for known server ecosystems.
    • Includes lightweight diagnostics for ignored/invalid keys during normalization/parsing.
    • Input keys are sorted before normalization so duplicate keys that collapse to the same lowercase value resolve deterministically (lexicographically first wins); collisions are logged explicitly.
    • npm install steps respect runtimes.node.run-install-scripts (default: --ignore-scripts for supply-chain protection) and runtimes.node.cooldown settings, consistent with the runtime manager.
  • Runtime manager integration

    • LSP servers that require Go, Ruby, or Node.js declare RuntimeRequirement values fed into the standard DetectRuntimeRequirements / GenerateRuntimeSetupSteps flow, which emits properly SHA-pinned setup actions (e.g. actions/setup-go, ruby/setup-ruby).
  • Copilot code generation integration

    • Extends Copilot settings generation to write ~/.copilot/settings.json with both:
      • builtInAgents.rubberDuck=false
      • lspServers (from frontmatter).
    • Extends Copilot installation flow to append LSP dependency install steps in the agent job.
  • Engine compatibility enforcement

    • Adds compiler validation that rejects lsp unless the resolved engine is copilot, with explicit error messaging.
    • Uses the shared ResolveEngineID helper for engine ID resolution to avoid future drift.
    • Emits an experimental compile-time warning whenever lsp is used.
  • LSP instructions file

    • Adds .github/aw/lsp.md documenting the lsp frontmatter syntax, built-in server table with auto-injected install commands, per-language examples, network requirements, and compile-time validation rules.
    • Registered in the agentic-workflows skill so it is loaded when relevant.
  • jsweep workflow

    • Adds TypeScript LSP server to jsweep.md covering .js, .cjs, .mjs, .ts, and .tsx extensions to enable full language-server support while the agent works on JavaScript files.
  • smoke-copilot workflow

  • Example

    engine: copilot
    tools:
      github: {}
    lsp:
      typescript:
        command: typescript-language-server
        args: ["--stdio"]
        fileExtensions:
          ".ts": typescript
          ".tsx": typescriptreact


✨ PR Review Safe Output Test - Run 28298688284

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

💥 [THE END] — Illustrated by Smoke Claude · 67.1 AIC · ⌖ 9.36 AIC · ⊞ 8.7K ·

Copilot AI and others added 2 commits June 26, 2026 18:31
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Add Copilot-only LSP frontmatter support Add Copilot-only lsp frontmatter support with schema, codegen, and engine guardrails Jun 26, 2026
Copilot AI requested a review from pelikhan June 26, 2026 18:36
@pelikhan pelikhan marked this pull request as ready for review June 26, 2026 19:06
Copilot AI review requested due to automatic review settings June 26, 2026 19:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new top-level lsp frontmatter field to agentic workflows, enabling workflows running on the Copilot engine to generate Copilot CLI ~/.copilot/settings.json with lspServers and to install known LSP dependencies during setup, while rejecting lsp for non-Copilot engines.

Changes:

  • Adds lsp to the main workflow JSON schema and wires typed parsing into FrontmatterConfig / WorkflowData.
  • Introduces an LSPManager to normalize/validate LSP config, generate Copilot-compatible lspServers, and emit LSP dependency install steps.
  • Enforces engine compatibility via compiler validation (reject lsp unless engine resolves to copilot) and updates Copilot engine codegen + tests to include the settings payload and install steps.
Show a summary per file
File Description
pkg/workflow/workflow_builder.go Extracts lsp from typed frontmatter (or raw frontmatter fallback) into WorkflowData.
pkg/workflow/lsp_validation.go Adds compiler validation to gate lsp to Copilot and validate lsp config.
pkg/workflow/lsp_validation_test.go Adds unit coverage for lsp gating + validation errors.
pkg/workflow/lsp_manager.go Adds normalization/validation plus Copilot payload generation and install-step generation.
pkg/workflow/lsp_manager_test.go Adds tests for LSPManager validation and install-step generation behavior.
pkg/workflow/frontmatter_types.go Extends typed frontmatter model with lsp field.
pkg/workflow/copilot_home_expansion_test.go Updates tests for new buildCopilotSettingsSetup signature.
pkg/workflow/copilot_engine_test.go Adds tests asserting Copilot settings include lspServers and install steps are appended.
pkg/workflow/copilot_engine_installation.go Appends LSP dependency install steps to Copilot installation steps.
pkg/workflow/copilot_engine_execution.go Generates Copilot settings JSON dynamically (default + lspServers) and writes it during setup.
pkg/workflow/compiler_types.go Adds WorkflowData.LSP field to carry parsed LSP configuration.
pkg/workflow/compiler_orchestrator_workflow.go Integrates validateLSPSupport into engine-setting validation ordering.
pkg/workflow/compiler_orchestrator_workflow_test.go Adds test ensuring non-Copilot engine rejects workflows with lsp.
pkg/parser/schemas/main_workflow_schema.json Adds JSON schema definition for top-level lsp frontmatter.
pkg/parser/schema_test.go Adds schema validation test for a valid lsp frontmatter configuration.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 15/15 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment on lines +26 to +39
func NewLSPManager(servers map[string]LSPServerConfig) *LSPManager {
normalized := make(map[string]LSPServerConfig, len(servers))
for key, value := range servers {
language := strings.TrimSpace(strings.ToLower(key))
if language == "" {
lspManagerLog.Printf("Skipping invalid LSP language key: %q", key)
continue
}
config := value
config.Command = strings.TrimSpace(config.Command)
normalized[language] = config
}
return &LSPManager{servers: normalized}
}
Comment thread pkg/workflow/lsp_validation.go Outdated
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot Add the TypeScript LSP server to agentic-workflows to enable workflows that operate on JavaScript code, similar to JS Sweep.

…pt code intelligence

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Add the TypeScript LSP server to agentic-workflows to enable workflows that operate on JavaScript code, similar to JS Sweep.

Added the TypeScript LSP server to jsweep.md in commit feat(jsweep): add TypeScript LSP server. The configuration covers .js, .cjs, .mjs, .ts, and .tsx file extensions so the Copilot agent gets full TypeScript language server support while working on the JavaScript files in that workflow.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot generate an instructions file on how to use LSPs. .github/aw/lsp.md

…ation

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@copilot generate an instructions file on how to use LSPs. .github/aw/lsp.md

Created .github/aw/lsp.md in the latest commit. It covers the frontmatter syntax, required vs optional fields, the full table of built-in servers with their auto-injected install commands, per-language examples (TypeScript, Python, Go, multi-language, and custom servers), network requirements per ecosystem, and compile-time validation rules.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, update this branch from main (it is behind by 15 commits), address any remaining review feedback, and rerun checks after the branch refresh.

Generated by 👨‍🍳 PR Sous Chef · 83.6 AIC · ⌖ 0.993 AIC · ⊞ 17.2K ·

Copilot AI and others added 3 commits June 26, 2026 23:42
…ler-support

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
…ter lsp.md in skill

- lsp_manager.go: sort input keys before normalizing so duplicate keys
  (e.g. 'TypeScript' vs 'typescript') always resolve to the same winner
  deterministically; log collisions explicitly instead of silently losing entries.
- lsp_validation.go: replace inline engine-ID resolution with the shared
  ResolveEngineID helper to avoid future drift.
- lsp_manager_test.go: add TestLSPManagerDuplicateKeyNormalization.
- pkg/cli/data/agentic_workflows_fallback_aw_files.json: add lsp.md.
- .github/skills/agentic-workflows/SKILL.md: regenerate to include lsp.md.

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot AI changed the title Add Copilot-only lsp frontmatter support with schema, codegen, and engine guardrails Add Copilot-only lsp frontmatter support with schema, codegen, engine guardrails, and LSP instructions Jun 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot - AOAI (Entra) is now investigating this pull request. Sources say the story is developing...

@github-actions

Copy link
Copy Markdown
Contributor

Agent Container Tool Check

Tool Status Version
bash 5.2.21
sh available
git 2.54.0
jq 1.7
yq v4.53.3
curl 8.5.0
gh 2.95.0
node v22.23.0
python3 3.11.15 (PyPy 7.3.23)
go 1.24.13
java 21.0.11
dotnet 10.0.301

Result: 12/12 tools available ✅

Overall Status: PASS

🔧 Tool validation by Agent Container Smoke Test · 15.5 AIC · ⌖ 6.49 AIC · ⊞ 5.4K ·

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results: Gemini - 28298688250

  • GitHub MCP: ✅
  • Web Fetch: ✅
  • File Writing: ✅
  • Bash Tool: ✅
  • Build gh-aw: ❌

Overall Status: FAIL

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • localhost

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "localhost"

See Network Configuration for more information.

Smoke Gemini — Powered by Gemini ·

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Smoke test lights the path
Silent tools, still the work moves
Results wait in code

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔮 The oracle has spoken through Smoke Codex · 13.9 AIC · ⊞ 10.8K ·

@github-actions

Copy link
Copy Markdown
Contributor

💥 Smoke Test: Claude — Run 28298688284

Core #1-12: ✅ all passed
PR review #13-18: ✅ all passed | #19: ⚠️ skipped (no safe PR)

Overall: PARTIAL (all executed tests passed; #19 skipped)

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

💥 [THE END] — Illustrated by Smoke Claude · 67.1 AIC · ⌖ 9.36 AIC · ⊞ 8.7K ·

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💥 Automated smoke test review - all systems nominal!

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

💥 [THE END] — Illustrated by Smoke Claude · 67.1 AIC · ⌖ 9.36 AIC · ⊞ 8.7K


import "fmt"

func (c *Compiler) validateLSPSupport(workflowData *WorkflowData) error {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider documenting the early-return contract for nil/empty LSP config here.

if engineID == "" {
engineID = "copilot"
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice guardrail — restricting lsp to the copilot engine is clear and well-scoped.

@github-actions github-actions Bot removed the smoke label Jun 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results:
Test1:❌ Test2:❌ Test3:❌ Test4:❌ Test5:✅ Test6:✅ Test7:❌ Test8:✅
Overall: FAIL

📰 BREAKING: Report filed by Smoke Copilot - AOAI (apikey) · 62.7 AIC · ⌖ 8.85 AIC · ⊞ 17.9K ·

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smoke test review complete.

📰 BREAKING: Report filed by Smoke Copilot - AOAI (apikey) · 62.7 AIC · ⌖ 8.85 AIC · ⊞ 17.9K

@github-actions

Copy link
Copy Markdown
Contributor

Trigger PR: Add Copilot-only lsp frontmatter support with schema, codegen, engine guardrails, and LSP instructions (experimental)
Merged PRs: [docs] Consolidate developer specifications: v9.19 maintenance tone scan
Merged PRs: fix(log_parser_bootstrap): guard Claude guardrail with safeOutputEntriesCount escape hatch
Results: 1❌ 2✅ 3✅ 4✅ 5❌ 6✅ 7✅ 8✅ 9✅ 10✅ 11✅ 12✅ 13✅ 14❌ 15✅ 16✅
Overall: FAIL
Author: app/copilot-swe-agent | Assignees: pelikhan, Copilot

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

📰 BREAKING: Report filed by Smoke Copilot · 221.5 AIC · ⌖ 22.3 AIC · ⊞ 19.7K ·

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Circuits hum at dawn
Bots tap keys through graphite mist
Green checks bloom at dusk

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

📰 BREAKING: Report filed by Smoke Copilot · 221.5 AIC · ⌖ 22.3 AIC · ⊞ 19.7K ·

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smoke test review completed.

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

📰 BREAKING: Report filed by Smoke Copilot · 221.5 AIC · ⌖ 22.3 AIC · ⊞ 19.7K

@github-actions

Copy link
Copy Markdown
Contributor

Smoke tests:
1 ok,2 ok,3 fail,4 ok,5 ok,6 ok,7 ok,8 ok,9 fail,10 ok,11 fail,12 ok,13 fail,14 fail,15 ok
Overall FAIL.
@app/copilot-swe-agent @pelikhan @Copilot

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

📰 BREAKING: Report filed by Smoke Copilot - AOAI (Entra) · 245.6 AIC · ⌖ 6.55 AIC · ⊞ 17.9K ·

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me review done.

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

📰 BREAKING: Report filed by Smoke Copilot - AOAI (Entra) · 245.6 AIC · ⌖ 6.55 AIC · ⊞ 17.9K

@pelikhan pelikhan merged commit a2f65f9 into main Jun 27, 2026
216 of 217 checks passed
@pelikhan pelikhan deleted the copilot/add-lsp-compiler-support branch June 27, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants