Add Copilot-only lsp frontmatter support with schema, codegen, engine guardrails, and LSP instructions (experimental)#41777
Add Copilot-only lsp frontmatter support with schema, codegen, engine guardrails, and LSP instructions (experimental)#41777Copilot wants to merge 17 commits into
lsp frontmatter support with schema, codegen, engine guardrails, and LSP instructions (experimental)#41777Conversation
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
|
@copilot the packages of each languages should be pinned to releases and the frontmatter should allow to configuration the version |
- Change engine from codex to copilot with copilot-sdk: true to enable LSP support (LSP is Copilot-only per compiler validation) - Add lsp.typescript frontmatter with typescript-language-server covering .js, .cjs, .mjs, .ts, .tsx extensions - Add Node.js runtime (v20) required by the TypeScript LSP server - Add test #11: use LSP document symbols to count functions in actions/setup/js/safe_output_helpers.cjs and report >=1 as pass - Update issue body reference to include test #11 in results - Recompile: lock.yml updated with lspServers settings.json payload, npm install --ignore-scripts typescript typescript-language-server, and NPM_CONFIG_MIN_RELEASE_AGE cooldown env var Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Add Version field to LSPServerConfig for per-language version override - Add NpmPackageVersions map to lspInstallSpec for default pinned npm versions - Add DefaultVersion to go/ruby specs for pinned non-npm installs - Update GenerateInstallSteps to emit versioned install commands - Strip leading v prefix from user-provided version to avoid double-v - Add version field to JSON schema - Update .github/aw/lsp.md docs with version column and override note - Add tests for default pinning, version override, and v-prefix handling - Recompile lock files to pick up new pinned versions Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot Revert codex changes and update smoke-copilot instead |
🤖 PR Triage (updated)
Score breakdown: Impact 38 + Urgency 13 + Quality 10 = 61 Assessment: Large change (+984/-29, 21 files) adding first-class Run §28298156610
|
|
@copilot please run the
|
…ilot - Revert LSP changes from smoke-codex (engine change from codex to copilot, lsp frontmatter, node runtime v20, test #11 LSP TypeScript) - Add TypeScript LSP server to smoke-copilot with lsp frontmatter and node runtime v20 - Add test #16 LSP TypeScript to smoke-copilot to count functions in actions/setup/js/safe_output_helpers.cjs - Recompile both workflows Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
🥧 Pi initializing... Smoke Pi begins on this pull request... |
|
🔮 The ancient spirits stir... Smoke Codex awakens to divine this pull request... |
|
🚀 Smoke Antigravity MISSION COMPLETE! Antigravity has spoken. ✨ |
|
✨ Gemini awakens... Smoke Gemini begins its journey on this pull request... |
|
✅ All tools validated successfully! Agent Container Smoke Test confirms agent container is ready. |
|
💥 WHOOSH! Smoke Claude springs into action on this pull request! [Panel 1 begins...] |
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
📰 BREAKING: Smoke Copilot - AOAI (apikey) is now investigating this pull request. Sources say the story is developing... |
|
📰 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
|
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