feat(session): batch apply live comments for agent reviews#179
Conversation
Greptile SummaryThis PR adds Key changes:
Confidence Score: 5/5Safe to merge; all remaining findings are P2 style suggestions with no correctness impact The validate-before-mutate guarantee holds correctly. The hunkNumber to hunkIndex conversion is consistent across the full stack. Batch comment IDs are unique per request via mcp:requestId:index. Test coverage spans CLI parsing, daemon server forwarding, state management, and session integration. Both open findings are P2: the alias-validation leniency is a cosmetic contract issue and the empty-batch no-op is a UX edge case. src/core/cli.ts — hunk/hunkNumber alias validation accepts both fields when they are equal Important Files Changed
Sequence DiagramsequenceDiagram
participant Agent
participant CLI as hunk session comment apply
participant Daemon as HTTP Daemon server.ts
participant WS as WebSocket daemonState.ts
participant UI as Hunk TUI useReviewController
Agent->>CLI: stdin JSON with comments array
CLI->>CLI: parseSessionCommentApplyPayload validate each item
CLI->>Daemon: POST /session-api action comment-apply
Daemon->>Daemon: map hunkNumber minus 1 to hunkIndex
Daemon->>WS: sendCommentBatch comment_batch WebSocket command
WS->>UI: command comment_batch
UI->>UI: addLiveCommentBatch resolve all targets then one setState
UI-->>WS: AppliedCommentBatchResult
WS-->>Daemon: command-result
Daemon-->>CLI: result with applied array
CLI-->>Agent: Applied N live comments to session
Reviews (1): Last reviewed commit: "feat(session): batch apply live comments..." | Re-trigger Greptile |
Summary
hunk session comment applyso agents can send many live inline comments in one stdin JSON batch with optional--focusTesting
bun run typecheckbun testbun run lint