Skip to content

fix: honor --stream true for nullable request flags#31

Open
fallintoplace wants to merge 2 commits into
openai:mainfrom
fallintoplace:fix/nullable-stream-flags
Open

fix: honor --stream true for nullable request flags#31
fallintoplace wants to merge 2 commits into
openai:mainfrom
fallintoplace:fix/nullable-stream-flags

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Jul 16, 2026

Copy link
Copy Markdown

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

  • add requestflag.FlagBool to read both bool and *bool values safely
  • route all ten affected create, submit, edit, and generate handlers through it
  • preserve nullable request serialization, including explicit null

Coverage

  • unit coverage for concrete booleans, pointer booleans, nil, and unknown flags
  • end-to-end SSE coverage for every affected command shape
  • explicit --stream null coverage for the non-streaming path
  • a held-open SSE response that verifies the rendered event arrives before the response completes

Validation

  • ./scripts/test
  • go test -race ./internal/requestflag ./pkg/cmd -run "^(TestFlagBool|TestNullableStreamFlags)$" -count=1
  • go vet ./...
  • ./scripts/lint

@fallintoplace
fallintoplace requested a review from a team as a code owner July 16, 2026 04:49
@fallintoplace fallintoplace changed the title fix: enable streaming for nullable boolean flags fix: honor --stream true for nullable request flags Jul 16, 2026
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.

1 participant