<feed xmlns='http://www.w3.org/2005/Atom'>
<title>go-x-pkgsite/doc/pkginfo.md, branch main</title>
<subtitle>Fork of golang.org/x/pkgsite with my patches.</subtitle>
<id>http://git.kilabit.info/go-x-pkgsite/atom?h=main</id>
<link rel='self' href='http://git.kilabit.info/go-x-pkgsite/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-pkgsite/'/>
<updated>2026-04-13T18:42:30Z</updated>
<entry>
<title>internal/api: improve ambiguous package path resolution</title>
<updated>2026-04-13T18:42:30Z</updated>
<author>
<name>Hana Kim</name>
<email>hyangah@gmail.com</email>
</author>
<published>2026-04-13T02:10:16Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-pkgsite/commit/?id=aca48c6d9dcc4892027cdad3243527882201358b'/>
<id>urn:sha1:aca48c6d9dcc4892027cdad3243527882201358b</id>
<content type='text'>
Instead of falling back to UnknownModulePath, we now:

1. Query all candidate module paths.
2. Filter out candidates where the database fell back to a different module path (preventing false positives like google.golang.org).
3. Filter out deprecated or retracted candidates if at least one good candidate exists.
4. Return 400 if ambiguity remains among good candidates.

This commit fixes the issue where /v1/package/google.golang.org/adk/agent was returning HTTP 400 because all candidate module paths matched:

```
{
 "code":400,
 "message":"ambiguous package path",
 "candidates":[
  {"modulePath":"google.golang.org/adk/agent","packagePath":"google.golang.org/adk/agent"},
  {"modulePath":"google.golang.org/adk","packagePath":"google.golang.org/adk/agent"},
  {"modulePath":"google.golang.org","packagePath":"google.golang.org/adk/agent"}]
}
```

Change-Id: I3ea24bca5144d536490019efd85fb597da214029
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/766380
kokoro-CI: kokoro &lt;noreply+kokoro@google.com&gt;
Reviewed-by: Jonathan Amsterdam &lt;jba@google.com&gt;
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
</content>
</entry>
</feed>
