Skip to content

refactor: separate provider and interceptor configs #266

@ssncferreira

Description

@ssncferreira

Description

Currently, provider config structs (config.OpenAI, config.Anthropic, config.Copilot) serve as both provider and interceptor configs. This means interceptors receive fields they don't use (e.g. CircuitBreaker), and providers carry fields only interceptors need (e.g. SendActorHeaders, ExtraHeaders). For example, the Copilot provider builds a full config.OpenAI with unused fields just to pass to the interceptors.

This lack of separation makes it unclear which fields belong to which layer, and makes it easy to accidentally couple provider-level concerns with interceptor behavior. As more providers share the same interceptor format (e.g. Copilot using OpenAI interceptors), keeping the configs separate ensures each layer only has access to what it needs.

We should introduce separate interceptor config structs that contain only what interceptors need. The provider constructs the interceptor config in CreateInterceptor(), passing only the relevant fields.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions