Repository navigation
fix: make buf lint pass with an explicit DiffPromptResponse exception - #7
Merged
Merged
Conversation
DiffPrompt and DiffCommits both return DiffPromptResponse, which trips RPC_REQUEST_RESPONSE_UNIQUE (and RPC_RESPONSE_STANDARD_NAME on DiffCommits). Splitting the response into a new DiffCommitsResponse would be wire-compatible, but it changes the Go API the server and CLI compile against and fails `buf breaking` (FILE: RPC_SAME_RESPONSE_TYPE). Keep the shared type and record the exception with targeted buf:lint:ignore comments on the two RPCs, regenerate the stubs (comment-only change), and run `buf lint` in CI. Fixes #3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
buf lintexited 100 on main becauseDiffPromptResponseis the response of bothDiffPromptandDiffCommits:The fix
I kept the shared type and added targeted
// buf:lint:ignorecomments on the two RPCs (RPC_REQUEST_RESPONSE_UNIQUEon both,RPC_RESPONSE_STANDARD_NAMEonDiffCommits), with a one-line reason.I also tried the other option the issue mentions, a dedicated
DiffCommitsResponse { repeated Change changes = 1; }. It is wire-compatible, but:DiffCommits(...) (*pb.DiffPromptResponse, error)and its shareddiff()helper would stop compiling on the next proto bump.buf breaking(FILE rules) rejects it:With the lint exception, wire format and the Go API stay the same. Regenerated stubs (pinned
protocolbuffers/go:v1.36.12,grpc/go:v1.6.2, which match the committed headers) differ only in doc comments inprompt_grpc.pb.go.prompt.pb.gois byte-identical.CI gets a new
bufjob that runsbuf lint.Evidence
Fixes #3
🤖 Generated with Claude Code