Skip to content

feat: add provider_name column to aibridge interceptions#23960

Merged
ssncferreira merged 2 commits intomainfrom
ssncf/feat-provider-name-column
Apr 2, 2026
Merged

feat: add provider_name column to aibridge interceptions#23960
ssncferreira merged 2 commits intomainfrom
ssncf/feat-provider-name-column

Conversation

@ssncferreira
Copy link
Copy Markdown
Contributor

@ssncferreira ssncferreira commented Apr 2, 2026

Description

Adds provider_name to aibridge interceptions to store the provider instance name alongside the provider type. This allows distinguishing between multiple instances of the same provider type (e.g. copilot vs copilot-business).

Changes

  • Add provider_name column to aibridge_interceptions table with backfill from provider.
  • Add provider_name field to the proto RecordInterceptionRequest message.
  • Add ProviderName to the codersdk.AIBridgeInterception API response.

Disclaimer: initially produced by Claude Opus 4.6, modified and reviewed by @ssncferreira .

@github-actions github-actions bot added the community Pull Requests and issues created by the community. label Apr 2, 2026
Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ssncferreira ssncferreira marked this pull request as ready for review April 2, 2026 08:19
@ssncferreira ssncferreira removed the community Pull Requests and issues created by the community. label Apr 2, 2026
Copy link
Copy Markdown
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but needs a test please to validate that the recorded value is actually inserted into the db.

COMMENT ON COLUMN aibridge_interceptions.provider_name IS 'The provider instance name which may differ from provider when multiple instances of the same provider type exist.';

-- Backfill existing records with the provider type as the provider name.
UPDATE aibridge_interceptions SET provider_name = provider WHERE provider_name = '';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think WHERE clause is not needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed internally, this is not needed, but keeping this as an extra safety measure.

@ssncferreira ssncferreira force-pushed the ssncf/feat-provider-name-column branch from b06cd80 to 65f14c1 Compare April 2, 2026 09:19
Copy link
Copy Markdown
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ssncferreira ssncferreira force-pushed the ssncf/feat-provider-name-column branch from 65f14c1 to 96cd2b0 Compare April 2, 2026 09:42
@ssncferreira ssncferreira merged commit fb78853 into main Apr 2, 2026
32 checks passed
@ssncferreira ssncferreira deleted the ssncf/feat-provider-name-column branch April 2, 2026 09:58
@github-actions github-actions bot locked and limited conversation to collaborators Apr 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants