Skip to content

fix(cargo-agent): include file:line in diagnostics#7

Merged
codesoda merged 1 commit intomainfrom
fix/cargo-agent-diag-location
Mar 10, 2026
Merged

fix(cargo-agent): include file:line in diagnostics#7
codesoda merged 1 commit intomainfrom
fix/cargo-agent-diag-location

Conversation

@codesoda
Copy link
Copy Markdown
Owner

Summary

  • Enable file and line location in check/clippy diagnostic output so agents can navigate directly to errors
  • The extract_compiler_diags function already supported this via its include_location parameter — just needed to pass 1 instead of 0

Before:

error: this function has too many arguments (8/7)

After:

error: this function has too many arguments (8/7)
  --> src/lib.rs:42

Test plan

  • All 4 cargo-agent scenarios pass (tests/run-scenarios.sh cargo-agent)
  • Verified issues scenario log includes --> location lines

Enable location info in compiler diagnostics so agents can navigate
directly to the source of errors.
@codesoda codesoda marked this pull request as ready for review March 10, 2026 07:43
Copy link
Copy Markdown

@cadence cadence bot left a comment

Choose a reason for hiding this comment

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

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_diags function already supported location output via its include_location parameter — 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.


View private review in Cadence

@codesoda codesoda merged commit 78770b7 into main Mar 10, 2026
8 checks passed
@codesoda codesoda deleted the fix/cargo-agent-diag-location branch March 10, 2026 08:25
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