Skip to content

Remove typed ProcessMessageAsync methods#1132

Open
christothes wants to merge 3 commits intoopenai:mainfrom
christothes:chriss/cleanup
Open

Remove typed ProcessMessageAsync methods#1132
christothes wants to merge 3 commits intoopenai: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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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; }
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

2 participants