You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(chunk): use hash-based file IDs in SearchChunks resource names (#328)
**Because**
- The `SearchChunks` endpoint was returning resource names with file
UUIDs (e.g., `files/550e8400-e29b-41d4-a716-446655440000`) instead of
hash-based IDs (e.g., `files/file-abc123`)
- This caused citation URLs to be invalid since the API expects
hash-based file IDs per AIP-122 naming convention
- The `agent:collection:{id}` tags were documented using UID
terminology, which was inconsistent with the actual hash-based ID format
used by agent-backend (e.g., `col-xxx`)
**This commit**
- Updates `SearchChunks` in `pkg/handler/chunk.go` to:
- Fetch the hash-based file ID along with file UID and display name
- Build `fileUIDMapID` to map file UIDs to their canonical hash-based
IDs
- Use hash-based file IDs in chunk and file resource names returned in
the response
- Add fallback to UUID for legacy data that may not have hash-based IDs
- Add debug logging to help trace resource name construction
- Renames `extractCollectionUIDs` to `extractCollectionIDs` in
`pkg/handler/converter.go` to reflect that these are hash-based IDs, not
UUIDs
- Updates comments and documentation to clarify the
`agent:collection:{id}` tag format uses hash-based collection IDs (e.g.,
`col-xxx`)
- Updates integration tests to use hash-based ID format (e.g.,
`col-fake-id-123`) instead of UID format
- Updates protobuf comments to document the correct ID format
0 commit comments