Skip to content

P7 follow-up: GptService 6-arg ctor binary compat + ImageQuality "high" telemetry hardcoding #98

Description

@cyberprophet

Background

Follow-ups from PR #97 review (Codex narrowing, both P2 — non-blocking).

1. 6-arg GptService(ILogger, string, OpenAIClientOptions, string?, string?, string) constructor binary compatibility

Before 0.16.4, the custom-endpoint constructor had this signature (6 source params, 3 with defaults). 0.16.4 widened it to 7 params by adding an optional imageGenerationModel = null at the end. C# treats optional params as the same source signature, but emits a different IL token — assemblies compiled against ≤0.16.2 that explicitly call the 6-arg overload would hit MissingMethodException at runtime when loaded with 0.16.4-0.16.6.

Current real-world impact: none. The only external NuGet consumer is P5 (creative-server), and P5 always recompiles against the latest pinned reference, so the 6-arg IL token is never sought. Filed as belt-and-braces in case a future external consumer adopts ShareInvest.Agency.

Fix sketch: add an explicit 6-arg overload that delegates to the 7-arg with imageGenerationModel: null. May require removing the default on imageGenerationModel in the 7-arg overload to disambiguate; verify P5 call sites first (only Server/Extensions.Services.cs:155 and a couple of test files use new GptService(...) and they take the 2-arg form, so widening is safe).

Reference: PR #97 review by Codex on commit fda8414d87 — comment ID 3135 series.

2. ApiUsageEvent telemetry hardcodes ImageQuality: \"high\" for StudioMint

Even though 0.16.6 removed ImageEditOptions.Quality (so the edit endpoint now uses its default auto tier), GenerateSingleShotAsync still emits new ApiUsageEvent(... ImageQuality: \"high\" ...) for every successful shot. Telemetry / billing analytics are wrong by exactly one tier for the affected period.

Fix sketch: drop the \"high\" hardcode and pass the actual configured quality (or null while we're on the SDK workaround). When the OpenAI .NET SDK gets a fix for the quality serialization bug and we restore the option, this can flip back to a real value.

Reference: PR #97 review by Codex on commit fda8414d87 — comment on agency/OpenAI/GptService.StudioMint.cs:107.

Severity

Both P3 — no user-visible bug. Can ride the next non-urgent Agency bump (0.17.0).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions