mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: rename user-facing AI Bridge strings to AI Gateway (#26700)
Rename user-facing "AI Bridge" strings to "AI Gateway" in deployment config, RBAC display names, log messages, error strings, docs style guide, and Grafana dashboard README. Deprecated option names and descriptions (the `--aibridge-*` block) are intentionally kept as "AI Bridge". The `Name` field cannot be renamed because `serpent` uses it as a unique key during JSON serialization; duplicating names causes `UnmarshalJSON` failures (e.g. in the support bundle). Descriptions also stay as "AI Bridge" to avoid confusion between the deprecated and primary options. Refs https://linear.app/codercom/issue/AIGOV-226 > Generated with the assistance of Coder Agents (@ssncferreira)
This commit is contained in:
@@ -143,7 +143,7 @@ func SeedAIProvidersFromEnv(
|
||||
if existingHash == dp.Hash {
|
||||
continue
|
||||
}
|
||||
return xerrors.Errorf("AI provider %q already exists in the database and differs from the current environment configuration; update the provider through the API or remove the CODER_AIBRIDGE_* env vars to stop seeding it", dp.Name)
|
||||
return xerrors.Errorf("AI provider %q already exists in the database and differs from the current environment configuration; update the provider through the API or remove the CODER_AIBRIDGE_* (legacy) / CODER_AI_GATEWAY_* env vars to stop seeding it", dp.Name)
|
||||
}
|
||||
|
||||
row, err := tx.InsertAIProvider(sysCtx, database.InsertAIProviderParams{
|
||||
|
||||
+1
-1
@@ -625,7 +625,7 @@ func New(options *Options) *API {
|
||||
// Seed the AI Bridge model price table from the embedded price book.
|
||||
//nolint:gocritic // Startup seeder needs to run as aibridge context.
|
||||
if err := prices.Seed(dbauthz.AsAIBridged(ctx), options.Database); err != nil {
|
||||
options.Logger.Error(ctx, "failed to seed AI Bridge prices; cost tracking may use stale prices", slog.Error(err))
|
||||
options.Logger.Error(ctx, "failed to seed AI Gateway prices; cost tracking may use stale prices", slog.Error(err))
|
||||
}
|
||||
|
||||
// AGPL uses a no-op build usage checker as there are no license
|
||||
|
||||
@@ -638,12 +638,12 @@ var (
|
||||
// See aibridged package.
|
||||
subjectAibridged = rbac.Subject{
|
||||
Type: rbac.SubjectAibridged,
|
||||
FriendlyName: "AI Bridge Daemon",
|
||||
FriendlyName: "AI Gateway Daemon",
|
||||
ID: uuid.Nil.String(),
|
||||
Roles: rbac.Roles([]rbac.Role{
|
||||
{
|
||||
Identifier: rbac.RoleIdentifier{Name: "aibridged"},
|
||||
DisplayName: "AI Bridge Daemon",
|
||||
DisplayName: "AI Gateway Daemon",
|
||||
Site: rbac.Permissions(map[string][]policy.Action{
|
||||
rbac.ResourceUser.Type: {
|
||||
policy.ActionRead, // Required to validate API key owner is active.
|
||||
|
||||
@@ -774,7 +774,7 @@ func (r *remoteReporter) createSnapshot() (*Snapshot, error) {
|
||||
eg.Go(func() error {
|
||||
summaries, err := r.generateAIBridgeInterceptionsSummaries(ctx)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("generate AI Bridge interceptions telemetry summaries: %w", err)
|
||||
return xerrors.Errorf("generate AI Gateway interceptions telemetry summaries: %w", err)
|
||||
}
|
||||
snapshot.AIBridgeInterceptionsSummaries = summaries
|
||||
return nil
|
||||
@@ -878,7 +878,7 @@ func (r *remoteReporter) generateAIBridgeInterceptionsSummaries(ctx context.Cont
|
||||
return nil, nil
|
||||
}
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("insert AI Bridge interceptions telemetry lock (period_ending_at=%q): %w", endedAtBefore, err)
|
||||
return nil, xerrors.Errorf("insert AI Gateway interceptions telemetry lock (period_ending_at=%q): %w", endedAtBefore, err)
|
||||
}
|
||||
|
||||
// List the summary categories that need to be calculated.
|
||||
@@ -887,7 +887,7 @@ func (r *remoteReporter) generateAIBridgeInterceptionsSummaries(ctx context.Cont
|
||||
EndedAtBefore: endedAtBefore, // exclusive
|
||||
})
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("list AI Bridge interceptions telemetry summaries (startedAtAfter=%q, endedAtBefore=%q): %w", endedAtAfter, endedAtBefore, err)
|
||||
return nil, xerrors.Errorf("list AI Gateway interceptions telemetry summaries (startedAtAfter=%q, endedAtBefore=%q): %w", endedAtAfter, endedAtBefore, err)
|
||||
}
|
||||
|
||||
// Calculate and convert the summaries for all categories.
|
||||
@@ -906,7 +906,7 @@ func (r *remoteReporter) generateAIBridgeInterceptionsSummaries(ctx context.Cont
|
||||
EndedAtBefore: endedAtBefore,
|
||||
})
|
||||
if err != nil {
|
||||
return xerrors.Errorf("calculate AI Bridge interceptions telemetry summary (provider=%q, model=%q, client=%q, startedAtAfter=%q, endedAtBefore=%q): %w", category.Provider, category.Model, category.Client, endedAtAfter, endedAtBefore, err)
|
||||
return xerrors.Errorf("calculate AI Gateway interceptions telemetry summary (provider=%q, model=%q, client=%q, startedAtAfter=%q, endedAtBefore=%q): %w", category.Provider, category.Model, category.Client, endedAtAfter, endedAtBefore, err)
|
||||
}
|
||||
|
||||
// Double check that at least one interception was found in the
|
||||
|
||||
Reference in New Issue
Block a user