[HIGH] summary/core.py: prompt.format(diff=diff) crashes on diffs containing curly braces #11
Labels
No labels
bug
code-review
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
foravo/mesh-review-comment-proof-20260519044241#11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from GitHub issue
M00C1FER/mesh-review#2.Source: https://github.com/M00C1FER/mesh-review/issues/2
Original author: @M00C1FER
Original state: closed
Finding 1 — HIGH
File:
src/mesh_review/summary/core.pyFunction:
_shell_runner()→ innerrun()closureCommit fixing this: 834f8d8441226ac383868a9cb8ac5c69b650581e (PR #1)
Description
The default summary prompt template contains
{diff}and is expanded using:Any diff that contains a literal curly-brace sequence (e.g.,
{HEAD}in git conflict markers, JSON payloads, Python f-strings, shell variable expansions) causes Python'sstr.format()to raiseKeyErrororValueError, crashing the summarization run for all configured CLIs.Impact
mesh-review summaryrun on a diff containing{or}raises an unhandled exception and exits with a traceback, producing no output.{}, JSON responses, f-strings, etc.Fix Applied
Switched to
prompt.replace("{diff}", diff)which is a literal string substitution and does not interpret{...}tokens in the diff.References
review/core.py:_shell_runneralready used.replace()correctly — this was an inconsistency between the two mirrors.Imported from GitHub issue comment
M00C1FER/mesh-review#2:4362220270.Source: https://github.com/M00C1FER/mesh-review/issues/2#issuecomment-4362220270
Original author: @M00C1FER
Fixed by merged PR #1.