Conversation
…e model namespacing
Address two blocking issues from PR review:
- Auth file now named vertex-{prefix}-{project}.json so importing the
same project with different prefixes no longer overwrites credentials
- Prefix containing "/" is rejected at import time instead of being
silently ignored at runtime
- Add prefix to in-memory metadata map for consistency
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Feat(vertex): add prefix field
feat: 升级反重力 (antigravity) UA 版本为 1.21.9
There was a problem hiding this comment.
Code Review
This pull request updates the Antigravity User-Agent version to 1.21.9, adds common development directories to .gitignore, and introduces a prefix flag for Vertex AI credential imports to support model namespacing. A review comment identifies a consistency issue where the prefix is sanitized for the filename but stored in its raw form in the metadata, recommending uniform sanitization.
| prefix = strings.TrimSpace(prefix) | ||
| prefix = strings.Trim(prefix, "/") | ||
| if prefix != "" && strings.Contains(prefix, "/") { | ||
| log.Errorf("vertex-import: prefix must be a single segment (no '/' allowed): %q", prefix) | ||
| return | ||
| } | ||
|
|
||
| // Include prefix in filename so importing the same project with different | ||
| // prefixes creates separate credential files instead of overwriting. | ||
| baseName := sanitizeFilePart(projectID) | ||
| if prefix != "" { | ||
| baseName = sanitizeFilePart(prefix) + "-" + baseName | ||
| } |
There was a problem hiding this comment.
The prefix is sanitized for the filename but stored unsanitized in the credential storage and metadata. This can lead to inconsistencies, such as a prefix with spaces being stored as-is but appearing with hyphens in the filename. It is recommended to sanitize the prefix before storing it to ensure it is a valid identifier for model namespacing and consistent across the system.
prefix = strings.TrimSpace(prefix)
prefix = strings.Trim(prefix, "/")
if prefix != "" {
if strings.Contains(prefix, "/") {
log.Errorf("vertex-import: prefix must be a single segment (no '/' allowed): %q", prefix)
return
}
// Sanitize prefix to ensure it's a valid identifier for model namespacing
prefix = sanitizeFilePart(prefix)
}
// Include prefix in filename so importing the same project with different
// prefixes creates separate credential files instead of overwriting.
baseName := sanitizeFilePart(projectID)
if prefix != "" {
baseName = prefix + "-" + baseName
}
No description provided.