Skip to content

chore: remove deprecated AI Explain surface from llm package - #178

Draft
pasiunaite wants to merge 1 commit into
mainfrom
chore/remove-deprecated-ai-explain
Draft

chore: remove deprecated AI Explain surface from llm package#178
pasiunaite wants to merge 1 commit into
mainfrom
chore/remove-deprecated-ai-explain

Conversation

@pasiunaite

Copy link
Copy Markdown
Contributor

Description

Follow-up cleanup to #150. Agent Fix populates explanation on every fix it returns and the client passes it through on AutofixUnifiedDiffSuggestion.Explanation, so the AI Explain client in the llm package has no remaining purpose.

Removed:

  • ExplainWithOptions, Explain, ExplainResult, AIRequest
  • runExplain, explainRequestBody, prepareDiffs, getOrderedResponse, defaultEndpointURL
  • ExplainOptions, Explanations, explainResponse, explainVulnerabilityRequest, explainFixRequest, explanationLength and its SHORT/MEDIUM/LONG constants
  • the SnykLLMBindings interface and its PublishIssues, which panicked with implement me and only existed to model the LLM/explain era
  • binding_smoke_test.go, which only exercised Explain

DeepCodeLLMBinding is now just GetAutofixDiffs + SubmitAutofixFeedback.

OutputFormat, its constants and WithOutputFormat are deliberately kept. They no longer affect behaviour, but snyk-ls and remy-cli-extension still pass llm.WithOutputFormat(llm.HTML), and removing them would force a simultaneous change in both. They can go in a later pass once consumers drop the option.

Blocked on

Do not merge until snyk-ls has removed its AI Explain path (IDE-2487). snyk-ls main is the only remaining consumer, at infrastructure/code/ai_fix_handler.go (EnrichWithExplain calling ExplainWithOptions). An org-wide code search for ExplainWithOptions and llm.ExplainOptions returns that single call site and nothing else.

This is a breaking change to a v1 module, so it also needs a call on how to release it — every consumer is first-party, so a minor bump may be acceptable, but that is worth an explicit decision rather than an assumption.

Checklist

  • Tests added and all succeed
  • Linted
  • README.md updated, if user-facing — no mentions of explain in README or docs

gofmt, golangci-lint (0 issues), go build ./..., go vet ./llm/... and go test ./... all pass. go mod tidy produces no drift. No generated mocks reference the removed interfaces.

Agent Fix returns an explanation per fix and code-client-go passes it
through on AutofixUnifiedDiffSuggestion.Explanation, so the AI Explain
client is no longer needed by any consumer.

Removes ExplainWithOptions, Explain, runExplain, explainRequestBody,
prepareDiffs, ExplainOptions, Explanations and the request/response types,
along with the SnykLLMBindings interface and its panicking PublishIssues,
which only existed to model the LLM/explain era.

OutputFormat and WithOutputFormat are kept: they are inert now, but
consumers still pass them and dropping them would force a simultaneous
change on their side.
@snyk-io

snyk-io Bot commented Aug 19, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues
Secrets 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@snyk-io

snyk-io Bot commented Aug 19, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@pasiunaite
pasiunaite requested a review from fsargent August 19, 2026 12:00
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.

1 participant