Skip to content

Comment on diff to give agent context#1003

Open
maskdotdev wants to merge 6 commits intopingdotgg:mainfrom
maskdotdev:diff-context-comments
Open

Comment on diff to give agent context#1003
maskdotdev wants to merge 6 commits intopingdotgg:mainfrom
maskdotdev:diff-context-comments

Conversation

@maskdotdev
Copy link
Contributor

@maskdotdev maskdotdev commented Mar 13, 2026

I'm aware that this is a large PR, and a big no no per the Contributing.md..., will be opening anyways since it may serve as a basis as Julius mentioned 🫡 .

closes #79

Here's a video of how it would work:

t3code-diff-context.mp4

This PR would cover:

  • Select lines in the diff panel and attach draft comments to a specific file and line range.
  • Those pending diff comments show up in the composer as attached context, just like we do with images.
  • Sending a message includes the diff comments as structured prompt context for the model, with line range, file path, etc.
  • The chat timeline hides that raw structured block and shows it as a compact "comments attached" indicator instead.
  • Pending diff comments can be edited or deleted from the diff view before send.
  • Draft comments persist in composer draft state and recover correctly across failed sends.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included a video for animation/interaction changes

Note

Add diff-context comments to agent chat turns

  • Users can select lines in the diff panel to create, edit, and delete pending diff-context comments, which appear as inline annotations on the diff.
  • Pending comments are tracked in the composer draft store with full CRUD support and are persisted across sessions.
  • When sending a message, pending diff-context comments are serialized as a <diff_context_comments> block appended to the outgoing message text; a message consisting solely of diff comments can be sent.
  • The composer shows a summary pill (ComposerPendingDiffComments.tsx) for pending comments with a clear-all control.
  • User message bubbles in the timeline strip the serialized block and show a count indicator with tooltip instead; copy and height estimation also exclude the block.

Macroscope summarized fac67c6.

@coderabbitai
Copy link

coderabbitai bot commented Mar 13, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c360ff53-5d7c-4ce8-aa62-4499dd48d815

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

@github-actions github-actions bot added size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 13, 2026
@maskdotdev maskdotdev changed the title Add draft diff context comments for turn diffs Comment on diff to give agent context Mar 13, 2026
maskdotdev and others added 5 commits March 12, 2026 20:46
Co-authored-by: macroscopeapp[bot] <170038800+macroscopeapp[bot]@users.noreply.github.com>
Co-authored-by: macroscopeapp[bot] <170038800+macroscopeapp[bot]@users.noreply.github.com>
@maskdotdev maskdotdev force-pushed the diff-context-comments branch from 21614f6 to 37918a0 Compare March 13, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Comment on diff to give agent context

1 participant