fix(i18n): propagate language field in AI-Infra-Scan and MCP-Scan task creation#330
Open
fix(i18n): propagate language field in AI-Infra-Scan and MCP-Scan task creation#330
Conversation
added 2 commits
April 20, 2026 09:24
…and mcp_scan Fixes #324: scan reports were always displayed in Chinese even after switching the language to English via the UI. Root cause: - AIInfraScanTaskRequest struct was missing the Language field entirely - Both 'ai_infra_scan' and 'mcp_scan' cases in SubmitTask() built TaskCreateRequest without setting CountryIsoCode, so the language preference was silently dropped before reaching the task executor Fix: - Add Language field to AIInfraScanTaskRequest - Set CountryIsoCode: req.Language in TaskCreateRequest for both 'mcp_scan' and 'ai_infra_scan' cases
Fixes #324 (web path for AI-Infra-Scan): executeScan() built options.Options without setting the Language field, so the runner always loaded Chinese vuln descriptions from data/vuln/ and triggered zh-only code paths regardless of the language the user selected in the UI. Root cause: the 'language' variable resolved from request.Language existed in Execute() but was never visible inside executeScan(). executeScan() read request.Language independently but never passed it to options.Options. Fix: derive language from request.Language inside executeScan() and pass it as opts.Language, so runner.go correctly loads data/vuln_en/ and uses English templates when language=en.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Collaborator
Author
|
Friendly ping @boy-hack @pythoncheng — this PR has been open for 14+ days with all CI checks passing (CodeQL ✅, Go ✅, Python ✅, Actions ✅) and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #324
Re-submission of the language fix after rebasing onto current main (the original PR #325 was closed due to a CodeQL alert that was caused by a stale TLS code path — no longer present in main after PR #306 simplified TLS handling).
Root Causes Fixed
Bug 1 — API path:
languagefield not propagatedWhen creating tasks via the REST API (
SubmitTaskhandler):AIInfraScanTaskRequeststruct was missing theLanguagefield entirelyai_infra_scanandmcp_scancases inSubmitTask()builtTaskCreateRequestwithout settingCountryIsoCode, so the language preference was silently dropped before reaching the task executorBug 2 — Web path: executeScan() ignores language
executeScan()builtoptions.Optionswithout setting theLanguagefield, so the runner always loaded Chinese vuln descriptions fromdata/vuln/regardless of user language selection.Changes
common/websocket/api.go: AddLanguagefield toAIInfraScanTaskRequest; setCountryIsoCode: req.LanguageinTaskCreateRequestfor bothmcp_scanandai_infra_scancasescommon/agent/tasks.go: Derive language fromrequest.LanguageinsideexecuteScan()and pass it asopts.LanguageTesting
go build ./common/websocket/... ./common/agent/...)openCAFilepath-injection taint is not present in this branch — it was resolved in PR fix(tls): support InsecureSkipVerify and custom CA file for HTTPS model endpoints #306 by simplifying TLS to always-skip mode)