fix: honor --stream true for nullable request flags - #31
Conversation
|
@codex review |
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. |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ee56d7d659
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| fmt.Fprint(w, "data: [DONE]\n\n") | ||
| flusher.Flush() | ||
| })) | ||
| defer server.Close() |
There was a problem hiding this comment.
Release the blocked handler before closing its server
If this subtest fails after the request reaches the channel receive—for example, due to the 15-second timeout or the JSON assertion—FailNow runs defers in LIFO order, so server.Close() executes before the earlier cleanup can close releaseResponse. Since httptest.Server.Close waits for active handlers and this handler remains blocked on <-releaseResponse, the test hangs until the outer CI timeout instead of reporting the failure. Arrange cleanup so the channel is closed before the server, or make the handler also select on the request context.
Useful? React with 👍 / 👎.
Problem
Ten streaming commands model the request field as requestflag.Flag[*bool] so they can represent unset, true, false, and null. The command branch used cli.Command.Bool, which only recognizes a concrete bool. As a result, passing --stream true still selected the non-streaming SDK method.
The two response retrieval commands use concrete boolean flags and are unaffected.
Fix
Coverage
Validation