agent-orchestrator icon indicating copy to clipboard operation
agent-orchestrator copied to clipboard

bug(files): only one inline review comment can be drafted at a time — starting a second discards the first

Open homeshrawat opened this issue 3 months ago • 3 comments

Summary

In the Files Changed diff review panel, only one inline comment could exist at a time. Starting a comment on a second line silently discarded the first unsent draft. There was no way to stage several comments and submit them together, so reviewing a multi-file diff meant comment → send, comment → send, one at a time — each sent immediately as its own message to the agent.

Expected: GitHub-style pending review — draft comments on several lines, each visible and editable, then one "Submit review" that sends them all together.

Status

Fixed in PR #3632 (fix/batch-pending-review-comments).

  • Batching: pending collection + "Submit review (N)" combined send
  • Follow-up fixes from manual QA: staged comments survive inspector tab unmounts; inspector and maximized Files views share one collection; Discard / Remove comment while editing a staged draft; line-based keys so refetch row shifts do not reattach comments
  • Verification: unit tests + hand-tested in the isolated desktop app (127.0.0.1:3002, session with multi-file diffs) — staging, tab switch, maximize, discard/remove, and submit all worked

Root cause (historical)

frontend/src/renderer/components/SessionFilesView.tsx held a single shared state triple for the entire panel rather than a per-line collection, so beginAnnotation overwrote the prior draft and submitAnnotation immediately POSTed one message with no pending batch.

Steps to reproduce (pre-fix)

  1. Open a session with a multi-file diff and switch to Files Changed.
  2. Hover a diff line, click +, and type a comment — do not send it.
  3. Hover a different line (same file or another file) and click +.
  4. The first comment's text is gone. Only the newly opened composer exists.

Related

  • PR #3632

homeshrawat avatar Aug 05 '26 23:08 homeshrawat

Update after PR #3632 follow-up + manual QA:

  • Batching from the original PR is in place.
  • Additional fixes: staged comments persist across inspector tab switches; inspector and maximized panels share state; Discard / Remove while editing; line-based annotation keys.
  • Hand-verified in the isolated desktop app — flow worked end-to-end including Submit review.

PR body updated with Closes #3641 so merge should close this issue.

homeshrawat avatar Aug 06 '26 10:08 homeshrawat

Thanks for contributing to Agent Orchestrator.

This issue is being picked up by the current external contributor on-call pair:

  • @illegalcall
  • @somewherelostt

If someone is already working on this, please continue as usual. The on-call pair is added for visibility, tracking, and support, not to take over the work. If you need help with review, direction, reproduction, or next steps, please tag @illegalcall and @somewherelostt here.

For faster context or live questions, you can also join the AO Discord.

Join the session here: https://discord.gg/H6ZDcUXmq

Come by if you want to see what is being built, ask questions, or just hang around with the community.

somewherelostt avatar Aug 06 '26 15:08 somewherelostt

@homeshrawat Thanks for raising the issue! This has been worked upon, hope you can hop on to some new issue :)

Vaibhaav-Tiwari avatar Sep 04 '26 21:09 Vaibhaav-Tiwari