🧪 Add missing non-PDF filename test for FilePartFromBase64#94
Conversation
Co-authored-by: matdev83 <211248003+matdev83@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds scripts/fuzz-run.sh to wrap go test fuzz invocations and tolerate spurious "context deadline exceeded" failures at fuzztime expiry, wires an OS-conditional FUZZ_WRAPPER variable into the Makefile's test-fuzz target, and adds a new test for non-PDF filename handling in FilePartFromBase64. ChangesFuzz test flake tolerance
FilePartFromBase64 non-PDF test
Estimated code review effort: 2 (Simple) | ~10 minutes Related PRs: None specified. Suggested labels: testing, build, ci Suggested reviewers: None specified.
🚥 Pre-merge checks | ✅ 7 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (7 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The Go fuzz engine (golang/go#75804, Go 1.25-1.26.x) intermittently emits `--- FAIL: FuzzX / context deadline exceeded` with no file:line and no corpus entry when -fuzztime expires, blocking CI on unrelated PRs. Add scripts/fuzz-run.sh: runs `go test -fuzz=...` and treats that bare deadline message as success, while still failing on real findings ("Failing input written to"), real assertion/panic failures (*.go:line), or any other non-zero exit. Route test-fuzz through it on non-Windows; Windows keeps `go test` direct (local smoke is short, bash may be absent). Unblocks PRs whose qa run fails on this flake (e.g. FuzzJSONRoundTrip, FuzzParseSnapshot) without masking real fuzz discoveries. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Makefile`:
- Around line 71-101: The test-fuzz target in the Makefile is too repetitive and
exceeds the checkmake limit because each invocation only varies by fuzz function
and package path. Refactor the body of test-fuzz to use a data-driven loop or
target list so the shared FUZZ_WRAPPER, -fuzztime, and -run flags are defined
once and each fuzz case is just an item. Keep the existing fuzz names and
package paths from test-fuzz, but make adding or removing entries a one-line
change instead of duplicating full commands.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 414b4d2b-83e8-4333-9a8f-ae6f9bb99aa1
📒 Files selected for processing (3)
Makefileinternal/plugins/frontends/openaiwire/parts_test.goscripts/fuzz-run.sh
📜 Review details
🧰 Additional context used
📓 Path-based instructions (5)
internal/plugins/frontends/**/*.go
📄 CodeRabbit inference engine (AGENTS.md)
In
internal/plugins/frontends/, implement OpenAI Responses, OpenAI legacy, Anthropic, and Gemini frontends.
Files:
internal/plugins/frontends/openaiwire/parts_test.go
**/*.go
📄 CodeRabbit inference engine (Custom checks)
**/*.go: For server, CLI, worker, or network Go code, ensurecontext.Contextis propagated correctly, cancellation is respected, and new goroutines cannot leak indefinitely.
Do not make accidental public API breaks in Go code: underpkg/**or anywhere exported Go identifiers are changed, warn if the PR changes exported types, function signatures, error behavior, JSON fields, CLI flags, config keys, or documented behavior without clearly explaining the compatibility impact.
Files:
internal/plugins/frontends/openaiwire/parts_test.go
⚙️ CodeRabbit configuration file
**/*.go: Review as production Go code. Prioritize correctness, race conditions, goroutine leaks, context cancellation, timeout handling, error wrapping, nil-pointer risks, resource cleanup, defer placement, API compatibility, interface design, dependency boundaries, and testability. Avoid generic style comments when gofmt/golangci-lint already covers the issue.
Files:
internal/plugins/frontends/openaiwire/parts_test.go
**/*
📄 CodeRabbit inference engine (Custom checks)
Do not introduce hardcoded credentials, API keys, tokens, private keys, passwords, production secrets, or sensitive internal URLs.
Files:
internal/plugins/frontends/openaiwire/parts_test.goscripts/fuzz-run.shMakefile
internal/**
⚙️ CodeRabbit configuration file
internal/**: Focus on package boundaries, hidden coupling, unexported API design, concurrency safety, deterministic behavior, and whether logic belongs in this internal package.
Files:
internal/plugins/frontends/openaiwire/parts_test.go
**/*_test.go
⚙️ CodeRabbit configuration file
**/*_test.go: Review tests for meaningful assertions, table-driven coverage, race-prone tests, t.Parallel misuse, nondeterminism, leaked goroutines, real network or filesystem dependencies, fragile sleeps, and missing edge cases. Prefer testing observable behavior over implementation details.
Files:
internal/plugins/frontends/openaiwire/parts_test.go
🪛 checkmake (0.3.2)
Makefile
[warning] 71-71: Target body for "test-fuzz" exceeds allowed length of 5 lines (30).
(maxbodylength)
🔇 Additional comments (4)
internal/plugins/frontends/openaiwire/parts_test.go (1)
54-63: LGTM!scripts/fuzz-run.sh (2)
1-54: LGTM!Failure classification order (corpus file → source-location → deadline) correctly avoids masking real failures that happen to co-occur with the deadline message, and the
mktemp/trapcleanup is solid.
2-4: 📐 Maintainability & Code QualityNo change needed
Makefile (1)
62-70: LGTM!OS-conditional wrapper selection mirrors the existing
test-racepattern and the tradeoff for Windows is clearly documented.
| test-fuzz: | ||
| @echo "Fuzz smoke (FUZZTIME=$(FUZZTIME)) one target per line" | ||
| $(GO) test -fuzz=FuzzJSONRoundTrip$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/testkit | ||
| $(GO) test -fuzz=FuzzParseSnapshot$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/infra/modelcatalog/modelsdev | ||
| $(GO) test -fuzz=FuzzParseSelector$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/core/routing | ||
| $(GO) test -fuzz=FuzzParseSelectorFromBytes$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/core/routing | ||
| $(GO) test -fuzz=FuzzDecodeCreateRequest$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/openairesponses | ||
| $(GO) test -fuzz=FuzzDecodeMessageRequest$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/anthropic | ||
| $(GO) test -fuzz=FuzzDecodeGenerateContentRequest$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/gemini | ||
| $(GO) test -fuzz=FuzzDecodeChatRequest$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/openailegacy | ||
| $(GO) test -fuzz=FuzzWriteNonStreamJSON_toolArguments$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/anthropic | ||
| $(GO) test -fuzz=FuzzBuildGenerateContentResponse_toolJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/gemini | ||
| $(GO) test -fuzz=FuzzCallValidateJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./pkg/lipapi | ||
| $(GO) test -fuzz=FuzzMergeRouteQueryGenerationOptions$$ -fuzztime=$(FUZZTIME) -run=^$$ ./pkg/lipapi | ||
| $(GO) test -fuzz=FuzzCollectWithLimitsProgram$$ -fuzztime=$(FUZZTIME) -run=^$$ ./pkg/lipapi | ||
| $(GO) test -fuzz=FuzzStableCallIdentity$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/core/diag | ||
| $(GO) test -fuzz=FuzzParamsForCall$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/openairesponses | ||
| $(GO) test -fuzz=FuzzHandleResponseStreamUnion$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/openairesponses | ||
| $(GO) test -fuzz=FuzzBuildToolsParametersJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/openairesponses | ||
| $(GO) test -fuzz=FuzzHandleMessageStreamEventUnion$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/protocols/anthropicmessages | ||
| $(GO) test -fuzz=FuzzToolInputSchemaParametersJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/protocols/anthropicmessages | ||
| $(GO) test -fuzz=FuzzHandleChatCompletionChunk$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/openailegacy | ||
| $(GO) test -fuzz=FuzzBuildChatToolsParametersJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/openailegacy | ||
| $(GO) test -fuzz=FuzzHandleGenerateContentResponse$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/protocols/geminigenerate | ||
| $(GO) test -fuzz=FuzzBuildToolsParametersJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/protocols/geminigenerate | ||
| $(GO) test -fuzz=FuzzMessageToContentToolResultJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/protocols/geminigenerate | ||
| $(GO) test -fuzz=FuzzAssistantPartsToContentBlocksJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/bedrock | ||
| $(GO) test -fuzz=FuzzParseNDJSONLine$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/acp | ||
| $(GO) test -fuzz=FuzzMapSessionUpdateToEvents$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/acp | ||
| $(GO) test -fuzz=FuzzMergeHandshakeProfileExtensions$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/acp | ||
| $(GO) test -fuzz=FuzzHookMutationValidators$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/core/hooks | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzJSONRoundTrip$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/testkit | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzParseSnapshot$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/infra/modelcatalog/modelsdev | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzParseSelector$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/core/routing | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzParseSelectorFromBytes$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/core/routing | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzDecodeCreateRequest$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/openairesponses | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzDecodeMessageRequest$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/anthropic | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzDecodeGenerateContentRequest$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/gemini | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzDecodeChatRequest$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/openailegacy | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzWriteNonStreamJSON_toolArguments$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/anthropic | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzBuildGenerateContentResponse_toolJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/gemini | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzCallValidateJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./pkg/lipapi | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzMergeRouteQueryGenerationOptions$$ -fuzztime=$(FUZZTIME) -run=^$$ ./pkg/lipapi | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzCollectWithLimitsProgram$$ -fuzztime=$(FUZZTIME) -run=^$$ ./pkg/lipapi | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzStableCallIdentity$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/core/diag | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzParamsForCall$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/openairesponses | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzHandleResponseStreamUnion$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/openairesponses | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzBuildToolsParametersJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/openairesponses | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzHandleMessageStreamEventUnion$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/protocols/anthropicmessages | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzToolInputSchemaParametersJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/protocols/anthropicmessages | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzHandleChatCompletionChunk$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/openailegacy | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzBuildChatToolsParametersJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/openailegacy | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzHandleGenerateContentResponse$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/protocols/geminigenerate | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzBuildToolsParametersJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/protocols/geminigenerate | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzMessageToContentToolResultJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/protocols/geminigenerate | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzAssistantPartsToContentBlocksJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/bedrock | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzParseNDJSONLine$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/acp | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzMapSessionUpdateToEvents$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/acp | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzMergeHandshakeProfileExtensions$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/acp | ||
| $(FUZZ_WRAPPER) -fuzz=FuzzHookMutationValidators$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/core/hooks |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
Consider collapsing the repetitive fuzz invocations into a data-driven loop.
checkmake flags test-fuzz's body as exceeding the max line length (30 lines); every line differs only by fuzz name and package path. A list + loop would shrink the target and make adding/removing fuzz targets a one-line change.
♻️ Proposed data-driven refactor
+FUZZ_TARGETS := \
+ FuzzJSONRoundTrip:./internal/testkit \
+ FuzzParseSnapshot:./internal/infra/modelcatalog/modelsdev \
+ FuzzParseSelector:./internal/core/routing \
+ FuzzParseSelectorFromBytes:./internal/core/routing \
+ FuzzDecodeCreateRequest:./internal/plugins/frontends/openairesponses \
+ FuzzDecodeMessageRequest:./internal/plugins/frontends/anthropic \
+ FuzzDecodeGenerateContentRequest:./internal/plugins/frontends/gemini \
+ FuzzDecodeChatRequest:./internal/plugins/frontends/openailegacy \
+ FuzzWriteNonStreamJSON_toolArguments:./internal/plugins/frontends/anthropic \
+ FuzzBuildGenerateContentResponse_toolJSON:./internal/plugins/frontends/gemini \
+ FuzzCallValidateJSON:./pkg/lipapi \
+ FuzzMergeRouteQueryGenerationOptions:./pkg/lipapi \
+ FuzzCollectWithLimitsProgram:./pkg/lipapi \
+ FuzzStableCallIdentity:./internal/core/diag \
+ FuzzParamsForCall:./internal/plugins/backends/openairesponses \
+ FuzzHandleResponseStreamUnion:./internal/plugins/backends/openairesponses \
+ FuzzBuildToolsParametersJSON:./internal/plugins/backends/openairesponses \
+ FuzzHandleMessageStreamEventUnion:./internal/plugins/backends/protocols/anthropicmessages \
+ FuzzToolInputSchemaParametersJSON:./internal/plugins/backends/protocols/anthropicmessages \
+ FuzzHandleChatCompletionChunk:./internal/plugins/backends/openailegacy \
+ FuzzBuildChatToolsParametersJSON:./internal/plugins/backends/openailegacy \
+ FuzzHandleGenerateContentResponse:./internal/plugins/backends/protocols/geminigenerate \
+ FuzzBuildToolsParametersJSON:./internal/plugins/backends/protocols/geminigenerate \
+ FuzzMessageToContentToolResultJSON:./internal/plugins/backends/protocols/geminigenerate \
+ FuzzAssistantPartsToContentBlocksJSON:./internal/plugins/backends/bedrock \
+ FuzzParseNDJSONLine:./internal/plugins/backends/acp \
+ FuzzMapSessionUpdateToEvents:./internal/plugins/backends/acp \
+ FuzzMergeHandshakeProfileExtensions:./internal/plugins/backends/acp \
+ FuzzHookMutationValidators:./internal/core/hooks
+
test-fuzz:
`@echo` "Fuzz smoke (FUZZTIME=$(FUZZTIME)) one target per line"
- $(FUZZ_WRAPPER) -fuzz=FuzzJSONRoundTrip$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/testkit
- $(FUZZ_WRAPPER) -fuzz=FuzzParseSnapshot$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/infra/modelcatalog/modelsdev
- ...
+ `@for` t in $(FUZZ_TARGETS); do \
+ name=$${t%%:*}; pkg=$${t#*:}; \
+ $(FUZZ_WRAPPER) -fuzz=$$name$$ -fuzztime=$(FUZZTIME) -run=^$$ $$pkg || exit $$?; \
+ done📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| test-fuzz: | |
| @echo "Fuzz smoke (FUZZTIME=$(FUZZTIME)) one target per line" | |
| $(GO) test -fuzz=FuzzJSONRoundTrip$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/testkit | |
| $(GO) test -fuzz=FuzzParseSnapshot$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/infra/modelcatalog/modelsdev | |
| $(GO) test -fuzz=FuzzParseSelector$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/core/routing | |
| $(GO) test -fuzz=FuzzParseSelectorFromBytes$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/core/routing | |
| $(GO) test -fuzz=FuzzDecodeCreateRequest$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/openairesponses | |
| $(GO) test -fuzz=FuzzDecodeMessageRequest$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/anthropic | |
| $(GO) test -fuzz=FuzzDecodeGenerateContentRequest$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/gemini | |
| $(GO) test -fuzz=FuzzDecodeChatRequest$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/openailegacy | |
| $(GO) test -fuzz=FuzzWriteNonStreamJSON_toolArguments$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/anthropic | |
| $(GO) test -fuzz=FuzzBuildGenerateContentResponse_toolJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/gemini | |
| $(GO) test -fuzz=FuzzCallValidateJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./pkg/lipapi | |
| $(GO) test -fuzz=FuzzMergeRouteQueryGenerationOptions$$ -fuzztime=$(FUZZTIME) -run=^$$ ./pkg/lipapi | |
| $(GO) test -fuzz=FuzzCollectWithLimitsProgram$$ -fuzztime=$(FUZZTIME) -run=^$$ ./pkg/lipapi | |
| $(GO) test -fuzz=FuzzStableCallIdentity$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/core/diag | |
| $(GO) test -fuzz=FuzzParamsForCall$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/openairesponses | |
| $(GO) test -fuzz=FuzzHandleResponseStreamUnion$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/openairesponses | |
| $(GO) test -fuzz=FuzzBuildToolsParametersJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/openairesponses | |
| $(GO) test -fuzz=FuzzHandleMessageStreamEventUnion$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/protocols/anthropicmessages | |
| $(GO) test -fuzz=FuzzToolInputSchemaParametersJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/protocols/anthropicmessages | |
| $(GO) test -fuzz=FuzzHandleChatCompletionChunk$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/openailegacy | |
| $(GO) test -fuzz=FuzzBuildChatToolsParametersJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/openailegacy | |
| $(GO) test -fuzz=FuzzHandleGenerateContentResponse$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/protocols/geminigenerate | |
| $(GO) test -fuzz=FuzzBuildToolsParametersJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/protocols/geminigenerate | |
| $(GO) test -fuzz=FuzzMessageToContentToolResultJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/protocols/geminigenerate | |
| $(GO) test -fuzz=FuzzAssistantPartsToContentBlocksJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/bedrock | |
| $(GO) test -fuzz=FuzzParseNDJSONLine$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/acp | |
| $(GO) test -fuzz=FuzzMapSessionUpdateToEvents$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/acp | |
| $(GO) test -fuzz=FuzzMergeHandshakeProfileExtensions$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/acp | |
| $(GO) test -fuzz=FuzzHookMutationValidators$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/core/hooks | |
| $(FUZZ_WRAPPER) -fuzz=FuzzJSONRoundTrip$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/testkit | |
| $(FUZZ_WRAPPER) -fuzz=FuzzParseSnapshot$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/infra/modelcatalog/modelsdev | |
| $(FUZZ_WRAPPER) -fuzz=FuzzParseSelector$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/core/routing | |
| $(FUZZ_WRAPPER) -fuzz=FuzzParseSelectorFromBytes$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/core/routing | |
| $(FUZZ_WRAPPER) -fuzz=FuzzDecodeCreateRequest$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/openairesponses | |
| $(FUZZ_WRAPPER) -fuzz=FuzzDecodeMessageRequest$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/anthropic | |
| $(FUZZ_WRAPPER) -fuzz=FuzzDecodeGenerateContentRequest$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/gemini | |
| $(FUZZ_WRAPPER) -fuzz=FuzzDecodeChatRequest$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/openailegacy | |
| $(FUZZ_WRAPPER) -fuzz=FuzzWriteNonStreamJSON_toolArguments$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/anthropic | |
| $(FUZZ_WRAPPER) -fuzz=FuzzBuildGenerateContentResponse_toolJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/frontends/gemini | |
| $(FUZZ_WRAPPER) -fuzz=FuzzCallValidateJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./pkg/lipapi | |
| $(FUZZ_WRAPPER) -fuzz=FuzzMergeRouteQueryGenerationOptions$$ -fuzztime=$(FUZZTIME) -run=^$$ ./pkg/lipapi | |
| $(FUZZ_WRAPPER) -fuzz=FuzzCollectWithLimitsProgram$$ -fuzztime=$(FUZZTIME) -run=^$$ ./pkg/lipapi | |
| $(FUZZ_WRAPPER) -fuzz=FuzzStableCallIdentity$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/core/diag | |
| $(FUZZ_WRAPPER) -fuzz=FuzzParamsForCall$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/openairesponses | |
| $(FUZZ_WRAPPER) -fuzz=FuzzHandleResponseStreamUnion$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/openairesponses | |
| $(FUZZ_WRAPPER) -fuzz=FuzzBuildToolsParametersJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/openairesponses | |
| $(FUZZ_WRAPPER) -fuzz=FuzzHandleMessageStreamEventUnion$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/protocols/anthropicmessages | |
| $(FUZZ_WRAPPER) -fuzz=FuzzToolInputSchemaParametersJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/protocols/anthropicmessages | |
| $(FUZZ_WRAPPER) -fuzz=FuzzHandleChatCompletionChunk$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/openailegacy | |
| $(FUZZ_WRAPPER) -fuzz=FuzzBuildChatToolsParametersJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/openailegacy | |
| $(FUZZ_WRAPPER) -fuzz=FuzzHandleGenerateContentResponse$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/protocols/geminigenerate | |
| $(FUZZ_WRAPPER) -fuzz=FuzzBuildToolsParametersJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/protocols/geminigenerate | |
| $(FUZZ_WRAPPER) -fuzz=FuzzMessageToContentToolResultJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/protocols/geminigenerate | |
| $(FUZZ_WRAPPER) -fuzz=FuzzAssistantPartsToContentBlocksJSON$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/bedrock | |
| $(FUZZ_WRAPPER) -fuzz=FuzzParseNDJSONLine$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/acp | |
| $(FUZZ_WRAPPER) -fuzz=FuzzMapSessionUpdateToEvents$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/acp | |
| $(FUZZ_WRAPPER) -fuzz=FuzzMergeHandshakeProfileExtensions$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/plugins/backends/acp | |
| $(FUZZ_WRAPPER) -fuzz=FuzzHookMutationValidators$$ -fuzztime=$(FUZZTIME) -run=^$$ ./internal/core/hooks | |
| FUZZ_TARGETS := \ | |
| FuzzJSONRoundTrip:./internal/testkit \ | |
| FuzzParseSnapshot:./internal/infra/modelcatalog/modelsdev \ | |
| FuzzParseSelector:./internal/core/routing \ | |
| FuzzParseSelectorFromBytes:./internal/core/routing \ | |
| FuzzDecodeCreateRequest:./internal/plugins/frontends/openairesponses \ | |
| FuzzDecodeMessageRequest:./internal/plugins/frontends/anthropic \ | |
| FuzzDecodeGenerateContentRequest:./internal/plugins/frontends/gemini \ | |
| FuzzDecodeChatRequest:./internal/plugins/frontends/openailegacy \ | |
| FuzzWriteNonStreamJSON_toolArguments:./internal/plugins/frontends/anthropic \ | |
| FuzzBuildGenerateContentResponse_toolJSON:./internal/plugins/frontends/gemini \ | |
| FuzzCallValidateJSON:./pkg/lipapi \ | |
| FuzzMergeRouteQueryGenerationOptions:./pkg/lipapi \ | |
| FuzzCollectWithLimitsProgram:./pkg/lipapi \ | |
| FuzzStableCallIdentity:./internal/core/diag \ | |
| FuzzParamsForCall:./internal/plugins/backends/openairesponses \ | |
| FuzzHandleResponseStreamUnion:./internal/plugins/backends/openairesponses \ | |
| FuzzBuildToolsParametersJSON:./internal/plugins/backends/openairesponses \ | |
| FuzzHandleMessageStreamEventUnion:./internal/plugins/backends/protocols/anthropicmessages \ | |
| FuzzToolInputSchemaParametersJSON:./internal/plugins/backends/protocols/anthropicmessages \ | |
| FuzzHandleChatCompletionChunk:./internal/plugins/backends/openailegacy \ | |
| FuzzBuildChatToolsParametersJSON:./internal/plugins/backends/openailegacy \ | |
| FuzzHandleGenerateContentResponse:./internal/plugins/backends/protocols/geminigenerate \ | |
| FuzzBuildToolsParametersJSON:./internal/plugins/backends/protocols/geminigenerate \ | |
| FuzzMessageToContentToolResultJSON:./internal/plugins/backends/protocols/geminigenerate \ | |
| FuzzAssistantPartsToContentBlocksJSON:./internal/plugins/backends/bedrock \ | |
| FuzzParseNDJSONLine:./internal/plugins/backends/acp \ | |
| FuzzMapSessionUpdateToEvents:./internal/plugins/backends/acp \ | |
| FuzzMergeHandshakeProfileExtensions:./internal/plugins/backends/acp \ | |
| FuzzHookMutationValidators:./internal/core/hooks | |
| test-fuzz: | |
| `@echo` "Fuzz smoke (FUZZTIME=$(FUZZTIME)) one target per line" | |
| `@for` t in $(FUZZ_TARGETS); do \ | |
| name=$${t%%:*}; pkg=$${t#*:}; \ | |
| $(FUZZ_WRAPPER) -fuzz=$$name$$ -fuzztime=$(FUZZTIME) -run=^$$ $$pkg || exit $$?; \ | |
| done |
🧰 Tools
🪛 checkmake (0.3.2)
[warning] 71-71: Target body for "test-fuzz" exceeds allowed length of 5 lines (30).
(maxbodylength)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Makefile` around lines 71 - 101, The test-fuzz target in the Makefile is too
repetitive and exceeds the checkmake limit because each invocation only varies
by fuzz function and package path. Refactor the body of test-fuzz to use a
data-driven loop or target list so the shared FUZZ_WRAPPER, -fuzztime, and -run
flags are defined once and each fuzz case is just an item. Keep the existing
fuzz names and package paths from test-fuzz, but make adding or removing entries
a one-line change instead of duplicating full commands.
Source: Linters/SAST tools
…part-12817100451533195064 Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # internal/plugins/frontends/openaiwire/parts_test.go
🎯 What: The testing gap addressed: added test case for
FilePartFromBase64when the provided filename does not have a.pdfextension.📊 Coverage: What scenarios are now tested: Covers the default flow where mime type should be assigned as
application/octet-streamfor arbitrary extensions or files without an extension.✨ Result: The improvement in test coverage: Assures that the
FilePartFromBase64default mime fallback works correctly and guards against accidental changes.PR created automatically by Jules for task 12817100451533195064 started by @matdev83