fix: queryGateway 工具未返回明确的外部调用 URL,导致评测系统使用错误主机名触发 SSL 证书不匹配#685
fix: queryGateway 工具未返回明确的外部调用 URL,导致评测系统使用错误主机名触发 SSL 证书不匹配#685
Conversation
…书不匹配 (issue_mojgqzg4_otl94f)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 07057c42e5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const defaultUrl = (accessList.APISet || []).length > 0 | ||
| ? `https://${defaultDomain}${normalizeAccessPath(accessList.APISet[0].Path)}` |
There was a problem hiding this comment.
Guard defaultUrl when default domain is missing
In queryGateway(action=getAccess), defaultUrl is now built whenever APISet is non-empty, but it does not verify that DefaultDomain exists. If an environment has routes but the default domain is not initialized/returned, this produces an invalid URL like https://undefined/...; downstream callers that prioritize defaultUrl will then fail requests despite valid entries in urls. Build defaultUrl only when defaultDomain is truthy (or fall back to a known valid URL).
Useful? React with 👍 / 👎.
Attribution post-PR evaluation
Cases
|
Attribution issue
Automation summary
queryGatewaytool'sgetAccessaction returned multiple domains and URLs without explicitly indicating which one is the "external" URL to use. This caused evaluation systems to potentially pick the wrong hostname (e.g., a custom domain without proper SSL certificate), leading to SSL certificate mismatch errors.defaultDomainfield tolistDomains,listCustomDomains,listRoutes, andgetRouteactions to explicitly indicate the default domain.customDomainsfield tolistDomainsandgetAccessactions to list only custom domains separately.defaultUrlfield togetAccessaction - this provides a clear, explicit external call URL using the default domain (DefaultDomain) which is guaranteed to have SSL configured by CloudBase.defaultUrlfield that returns a URL like ` using the CloudBase-provided default domain. This ensures evaluators and users can cleaChanged files
mcp/src/tools/gateway.test.tsmcp/src/tools/gateway.ts