fix(cargo-agent): include file:line in diagnostics#7
Merged
Conversation
Enable location info in compiler diagnostics so agents can navigate directly to the source of errors.
There was a problem hiding this comment.
Cadence PR Review
Goal
Enable file:line location info in cargo-agent's check and clippy diagnostic output so agents can navigate directly to errors, by flipping an existing parameter from 0 to 1 in two call sites.
Key Decisions
- The
extract_compiler_diagsfunction already supported location output via itsinclude_locationparameter — no new parsing logic was needed, just toggling the flag. - The
awk '!seen[$0]++'deduplication works per-line, which remains correct since locations now produce an additional-->line per diagnostic.
Review Focus
| Area | Why |
|---|---|
| skills/cargo-agent/scripts/cargo-agent.sh (lines 277, 318) | Both run_check and run_clippy changed from 0 to 1. Verify the extract_compiler_diags function's location format (especially the \n in jq output) produces clean multi-line output and that the per-line dedup via awk doesn't accidentally suppress location lines that are identical across different diagnostics. |
Risk
Minimal risk — two single-character changes to an existing, tested code path. All four cargo-agent scenarios pass. Only concern is whether identical --> location lines for different errors could be deduped by awk, but this is unlikely in practice since the file:line will usually differ.
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.
Summary
extract_compiler_diagsfunction already supported this via itsinclude_locationparameter — just needed to pass1instead of0Before:
After:
Test plan
tests/run-scenarios.sh cargo-agent)issuesscenario log includes-->location lines