Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove typed ProcessMessageAsync methods#1132

Merged
christothes merged 5 commits into
openai:mainfrom
christothes:chriss/cleanup
May 7, 2026
Merged

Remove typed ProcessMessageAsync methods#1132
christothes merged 5 commits into
openai:mainfrom
christothes:chriss/cleanup

Conversation

@christothes

Copy link
Copy Markdown
Collaborator

fixes #1116

Copilot AI review requested due to automatic review settings April 29, 2026 16:03

Copilot AI left a comment

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.

Pull request overview

Removes the client-typed ProcessMessage<TClient> / ProcessMessageAsync<TClient> pipeline extension methods and standardizes error message formatting across feature areas, addressing #1116.

Changes:

  • Deleted the typed ProcessMessage<TClient> / ProcessMessageAsync<TClient> overloads and switched custom protocol code to call the non-generic ProcessMessage APIs.
  • Updated TypeSpec + generated models to include param and type in Responses/Evals error shapes.
  • Added mock tests ensuring formatted error messages consistently surface type/code/param and don’t swallow type-only payloads.

Reviewed changes

Copilot reviewed 18 out of 23 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Miscellaneous/ErrorHandlingMockTests.cs Adds regression tests validating consistent formatted error messages across feature areas.
src/Generated/OpenAIModelFactory.cs Updates factory for ResponseError to accept param and kind (type).
src/Generated/Models/Responses/ResponseError.cs Adds Param and Kind properties to the public Responses error model.
src/Generated/Models/Responses/ResponseError.Serialization.cs Updates (de)serialization to read/write param and type.
src/Generated/Models/Evals/InternalEvalApiError.cs Adds Param and Kind to the internal Evals error model.
src/Generated/Models/Evals/InternalEvalApiError.Serialization.cs Updates Evals error (de)serialization for param and type.
src/Custom/Responses/ResponsesClient.cs Removes generic typed pipeline processing call sites.
src/Custom/Moderations/ModerationClient.Protocol.cs Removes generic typed pipeline processing call sites.
src/Custom/Internal/ClientPipelineExtensions.cs Deletes typed overloads and consolidates error parsing/formatting in the non-generic path.
src/Custom/FineTuning/Internal/Pagination/FineTuningJobCollectionResult.cs Removes generic typed pipeline processing call sites.
src/Custom/FineTuning/Internal/Pagination/AsyncFineTuningJobCollectionResult.cs Removes generic typed pipeline processing call sites.
src/Custom/FineTuning/FineTuningJob.cs Removes generic typed pipeline processing call sites.
src/Custom/FineTuning/FineTuningJob.Protocol.cs Removes generic typed pipeline processing call sites.
src/Custom/FineTuning/FineTuningClient.Protocol.cs Removes generic typed pipeline processing call sites.
src/Custom/Files/OpenAIFileClient.Protocol.cs Removes generic typed pipeline processing call sites.
src/Custom/Evals/EvaluationClient.Protocol.cs Removes generic typed pipeline processing call sites.
src/Custom/Batch/CreateBatchOperation.Protocol.cs Removes generic typed pipeline processing call sites.
src/Custom/Batch/BatchClient.Protocol.cs Removes generic typed pipeline processing call sites.
src/Custom/Assistants/Internal/InternalAssistantThreadClient.Protocol.cs Removes generic typed pipeline processing call sites.
src/Custom/Assistants/Internal/InternalAssistantRunClient.Protocol.cs Removes generic typed pipeline processing call sites.
src/Custom/Assistants/Internal/InternalAssistantMessageClient.Protocol.cs Removes generic typed pipeline processing call sites.
specification/base/typespec/responses/models.tsp Adds param and type to ResponseError schema.
specification/base/typespec/evals/models.tsp Adds param and type to EvalApiError schema.

Comment on lines +46 to +48
public string Param { get; }

public string Kind { get; }
/// </summary>
[Parallelizable(ParallelScope.All)]
[Category("Smoke")]
public class ErrorHandlingMockTests : ClientTestBase

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice! Thank you for adding these tests!

Copilot AI review requested due to automatic review settings May 7, 2026 18:52
@christothes christothes enabled auto-merge (squash) May 7, 2026 18:52
@christothes christothes merged commit 9c02a59 into openai:main May 7, 2026
6 checks passed

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 21 out of 26 changed files in this pull request and generated 1 comment.

Comment on lines +84 to +92
if (Optional.IsDefined(Param) && !Patch.Contains("$.param"u8))
{
writer.WritePropertyName("param"u8);
writer.WriteStringValue(Param);
}
else
{
writer.WriteNull("param"u8);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate generator support for client-typed ProcessMessage<TClient> calls

3 participants