Repository navigation
Refresh all FineTuningJob properties in UpdateStatus(RequestOptions) - #1456
codewithfourtix wants to merge 1 commit into
Conversation
The UpdateStatus and UpdateStatusAsync overrides that take RequestOptions read only the status field. They set HasCompleted, but Status, Value, ResultFileIds and the other job properties kept the old values. The CancellationToken overloads copy the full job. Copy the full job in both overrides with CopyLocalParameters. With ClientErrorBehaviors.NoThrow the response can be an error with no job, so keep the job properties and update only the raw response.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f5de0eead
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| return; | ||
| } | ||
|
|
||
| CopyLocalParameters(response, (InternalFineTuningJob)ClientResult.FromResponse(response)); |
There was a problem hiding this comment.
Refresh BillableTrainedTokenCount too
When a running job later returns a completed payload with a non-null trained_tokens value, this full-refresh path still leaves BillableTrainedTokenCount at its old value (normally 0): CopyLocalParameters in OpenAI/src/Custom/FineTuning/FineTuningJob.cs copies the other deserialized fields but never assigns job.BillableTrainedTokenCount. The changed overloads therefore still do not refresh all exposed job properties; add that assignment and include trained_tokens in the regression response.
Useful? React with 👍 / 👎.
FineTuningJob.UpdateStatus(RequestOptions)andUpdateStatusAsync(RequestOptions)read only thestatusfield. After a job finishes,HasCompletedistrue, butStatusis stillRunning,Value(the fine-tuned model) is stillnull, andResultFileIdsis empty. TheCancellationTokenoverloads do not have this problem, because they copy the full job.Both overrides now use
CopyLocalParameters, the same as theCancellationTokenoverloads. WithClientErrorBehaviors.NoThrow, an error response has no job in it, so the job properties stay as they are and only the raw response changes. Before, that case threwKeyNotFoundException.Tests in
FineTuningJobMockTestscover both cases, sync and async.