Add Copilot-only lsp frontmatter support with schema, codegen, engine guardrails, and LSP instructions (experimental)#41777
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
lsp frontmatter support with schema, codegen, and engine guardrails
There was a problem hiding this comment.
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
lspto the main workflow JSON schema and wires typed parsing intoFrontmatterConfig/WorkflowData. - Introduces an
LSPManagerto normalize/validate LSP config, generate Copilot-compatiblelspServers, and emit LSP dependency install steps. - Enforces engine compatibility via compiler validation (reject
lspunless engine resolves tocopilot) 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
| 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} | ||
| } |
|
@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>
Added the TypeScript LSP server to |
|
@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>
Created |
|
@copilot please run the
|
…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>
lsp frontmatter support with schema, codegen, and engine guardrailslsp frontmatter support with schema, codegen, engine guardrails, and LSP instructions
|
📰 BREAKING: Smoke Copilot - AOAI (Entra) is now investigating this pull request. Sources say the story is developing... |
Agent Container Tool Check
Result: 12/12 tools available ✅ Overall Status: PASS
|
Smoke Test Results: Gemini - 28298688250
Overall Status: FAIL Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
Comment MemoryNote This comment is managed by comment memory.It stores persistent context for this thread in the code block at the top of this comment.
|
💥 Smoke Test: Claude — Run 28298688284Core #1-12: ✅ all passed Overall: PARTIAL (all executed tests passed; #19 skipped) Warning Firewall blocked 6 domainsThe following domains were blocked by the firewall during workflow execution:
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.
|
There was a problem hiding this comment.
💥 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.comandroid.clients.google.comclients2.google.comcontentautofill.googleapis.comsafebrowsingohttpgateway.googleapis.comwww.google.com
To allow these domains, add them to the
network.allowedlist 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 { |
There was a problem hiding this comment.
Consider documenting the early-return contract for nil/empty LSP config here.
| if engineID == "" { | ||
| engineID = "copilot" | ||
| } | ||
|
|
There was a problem hiding this comment.
Nice guardrail — restricting lsp to the copilot engine is clear and well-scoped.
|
Smoke Test Results:
|
There was a problem hiding this comment.
Smoke test review complete.
📰 BREAKING: Report filed by Smoke Copilot - AOAI (apikey) · 62.7 AIC · ⌖ 8.85 AIC · ⊞ 17.9K
|
Trigger PR: Add Copilot-only Warning Firewall blocked 6 domainsThe following domains were blocked by the firewall during workflow execution:
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.
|
Comment MemoryNote This comment is managed by comment memory.It stores persistent context for this thread in the code block at the top of this comment. Warning Firewall blocked 6 domainsThe following domains were blocked by the firewall during workflow execution:
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.
|
There was a problem hiding this comment.
Smoke test review completed.
Warning
Firewall blocked 6 domains
The following domains were blocked by the firewall during workflow execution:
accounts.google.comandroid.clients.google.comclients2.google.comcontentautofill.googleapis.comsafebrowsingohttpgateway.googleapis.comwww.google.com
To allow these domains, add them to the
network.allowedlist 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
|
Smoke tests: Warning Firewall blocked 6 domainsThe following domains were blocked by the firewall during workflow execution:
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.
|
There was a problem hiding this comment.
Me review done.
Warning
Firewall blocked 6 domains
The following domains were blocked by the firewall during workflow execution:
accounts.google.comandroid.clients.google.comclients2.google.comcontentautofill.googleapis.comsafebrowsingohttpgateway.googleapis.comwww.google.com
To allow these domains, add them to the
network.allowedlist 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
This change adds first-class
lspfrontmatter support so workflows can declare language-server configuration and have Copilot CLI receive generatedlspServersconfig plus required server dependencies in agent setup. The feature is explicitly gated to Copilot; non-Copilot engines now fail fast whenlspis present. Thelspfield is marked experimental and emits a compile-time warning.Frontmatter + schema surface
lspschema inmain_workflow_schema.jsonwith an experimental description.commandargsfileExtensionsWorkflowData.LSP manager (normalization + generation)
lspentries,lspServerspayload,runtimes.node.run-install-scripts(default:--ignore-scriptsfor supply-chain protection) andruntimes.node.cooldownsettings, consistent with the runtime manager.Runtime manager integration
RuntimeRequirementvalues fed into the standardDetectRuntimeRequirements/GenerateRuntimeSetupStepsflow, which emits properly SHA-pinned setup actions (e.g.actions/setup-go,ruby/setup-ruby).Copilot code generation integration
~/.copilot/settings.jsonwith both:builtInAgents.rubberDuck=falselspServers(from frontmatter).Engine compatibility enforcement
lspunless the resolved engine iscopilot, with explicit error messaging.ResolveEngineIDhelper for engine ID resolution to avoid future drift.lspis used.LSP instructions file
.github/aw/lsp.mddocumenting thelspfrontmatter syntax, built-in server table with auto-injected install commands, per-language examples, network requirements, and compile-time validation rules.jsweep workflow
jsweep.mdcovering.js,.cjs,.mjs,.ts, and.tsxextensions to enable full language-server support while the agent works on JavaScript files.smoke-copilot workflow
smoke-copilot.mdwithlsp.typescriptfrontmatter and Node.js v20 runtime.actions/setup/js/safe_output_helpers.cjsand reports pass/fail.Example
✨ 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.comandroid.clients.google.comclients2.google.comcontentautofill.googleapis.comsafebrowsingohttpgateway.googleapis.comwww.google.comSee Network Configuration for more information.