Skip to content

🧪 Add missing non-PDF filename test for FilePartFromBase64#94

Merged
matdev83 merged 3 commits into
mainfrom
add-non-pdf-test-filepart-12817100451533195064
Jul 1, 2026
Merged

🧪 Add missing non-PDF filename test for FilePartFromBase64#94
matdev83 merged 3 commits into
mainfrom
add-non-pdf-test-filepart-12817100451533195064

Conversation

@matdev83

@matdev83 matdev83 commented Jul 1, 2026

Copy link
Copy Markdown
Owner

🎯 What: The testing gap addressed: added test case for FilePartFromBase64 when the provided filename does not have a .pdf extension.
📊 Coverage: What scenarios are now tested: Covers the default flow where mime type should be assigned as application/octet-stream for arbitrary extensions or files without an extension.
Result: The improvement in test coverage: Assures that the FilePartFromBase64 default mime fallback works correctly and guards against accidental changes.


PR created automatically by Jules for task 12817100451533195064 started by @matdev83

Co-authored-by: matdev83 <211248003+matdev83@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@matdev83, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8d041afa-6020-4e82-8b68-379b82455541

📥 Commits

Reviewing files that changed from the base of the PR and between fbe90cb and f4d8cd1.

📒 Files selected for processing (1)
  • internal/plugins/frontends/openaiwire/parts_test.go
📝 Walkthrough

Walkthrough

Adds 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.

Changes

Fuzz test flake tolerance

Layer / File(s) Summary
Fuzz wrapper script implementation
scripts/fuzz-run.sh
New script runs go test, captures output to a temp file, and classifies non-zero exits as clean, real failure (findings/panics), tolerated deadline flake, or other error, propagating status accordingly.
Makefile wrapper wiring
Makefile
Adds an OS-conditional FUZZ_WRAPPER variable (direct go test on Windows, bash scripts/fuzz-run.sh otherwise) and updates all fuzz invocations in test-fuzz to use it.

FilePartFromBase64 non-PDF test

Layer / File(s) Summary
Non-PDF filename test case
internal/plugins/frontends/openaiwire/parts_test.go
Adds TestFilePartFromBase64_nonPdfFilename asserting FileMIME is application/octet-stream and Kind is lipapi.PartFileRef for non-PDF filenames.

Estimated code review effort: 2 (Simple) | ~10 minutes

Related PRs: None specified.

Suggested labels: testing, build, ci

Suggested reviewers: None specified.

A fuzzer twitches at deadline's edge,
the script now knows a false alarm from a real ledge,
a rabbit checks each PDF and plain-text name,
wrapping flaky tests in a calmer frame. 🐇⏱️

🚥 Pre-merge checks | ✅ 7 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (7 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the new non-PDF filename test added for FilePartFromBase64.
Description check ✅ Passed The description directly matches the added test coverage and fallback MIME behavior changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No Secrets ✅ Passed Changed files contain no hardcoded credentials or private keys; scans found only a public golangci-lint URL in existing Makefile text.
Context Propagation ✅ Passed The PR only changes a Makefile target, a bash fuzz wrapper, and a unit test; none add context-bearing server/CLI/worker/network code or goroutines.
No Accidental Public Api Break ✅ Passed Changes are test-only plus fuzz-wrapper tooling; no exported types, signatures, JSON/CLI/config, or documented behavior were altered.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 96d7ab5 and fbe90cb.

📒 Files selected for processing (3)
  • Makefile
  • internal/plugins/frontends/openaiwire/parts_test.go
  • scripts/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, ensure context.Context is propagated correctly, cancellation is respected, and new goroutines cannot leak indefinitely.
Do not make accidental public API breaks in Go code: under pkg/** 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.go
  • scripts/fuzz-run.sh
  • Makefile
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/trap cleanup is solid.


2-4: 📐 Maintainability & Code Quality

No change needed

Makefile (1)

62-70: LGTM!

OS-conditional wrapper selection mirrors the existing test-race pattern and the tradeoff for Windows is clearly documented.

Comment thread Makefile
Comment on lines 71 to +101
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 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.

Suggested change
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
@matdev83 matdev83 merged commit 571397b into main Jul 1, 2026
2 checks passed
@matdev83 matdev83 deleted the add-non-pdf-test-filepart-12817100451533195064 branch July 1, 2026 16:32
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