Skip to content

Conversation

@WillemJiang
Copy link
Collaborator

Fix #663

  • Add report_editor module for edit intent detection and context extraction
  • Create report_editor_node to handle report modification requests
  • Update coordinator to route to report_editor when edit intent detected
  • Enhance reporter_node with merge mode to integrate new findings
  • Add previous_report tracking and is_editing_report state flags
  • Include comprehensive unit and integration tests (93 tests, 100% pass rate)

…d merging (bytedance#663)

- Add report_editor module for edit intent detection and context extraction
- Create report_editor_node to handle report modification requests
- Update coordinator to route to report_editor when edit intent detected
- Enhance reporter_node with merge mode to integrate new findings
- Add previous_report tracking and is_editing_report state flags
- Include comprehensive unit and integration tests (93 tests, 100% pass rate)
@WillemJiang WillemJiang requested a review from Copilot October 27, 2025 11:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a report modification feature that allows users to edit previously generated reports through targeted research and intelligent merging. The implementation adds edit intent detection, context extraction, and a merge mode to the reporter that seamlessly integrates new findings into existing reports while preserving unchanged sections.

Key Changes:

  • Added report_editor module with functions to detect edit intent, extract context, parse sections, and prepare merge operations
  • Created report_editor_node to route edit requests to targeted research planning
  • Enhanced reporter_node with merge mode that integrates new findings into existing reports
  • Extended State class with fields for tracking previous reports and editing context

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/unit/graph/test_state_editing.py Validates State class accepts new editing fields (previous_report, is_editing_report, report_edit_context, report_sections_to_edit)
tests/unit/graph/test_report_editor_node.py Tests report_editor_node routing, state updates, and coordinator edit detection
tests/unit/graph/test_report_editor.py Tests core report_editor functions: edit intent detection, context extraction, section parsing, and merge preparation
tests/integration/test_report_editing_workflow.py Integration tests covering full editing workflows, state transitions, and edge cases
src/server/app.py Retrieves previous report from graph state for edit support
src/prompts/report_editor.md Defines prompt template for LLM to merge new findings into existing reports
src/graph/types.py Extends State with four new fields for report editing functionality
src/graph/report_editor.py Implements edit detection, context extraction, section parsing, and merge preparation
src/graph/nodes.py Adds report_editor_node and enhances reporter_node with merge mode; updates coordinator to detect edit intent
src/graph/builder.py Registers report_editor node and updates coordinator routing to include it
Comments suppressed due to low confidence (1)

tests/unit/graph/test_report_editor.py:1

  • The assertion checks for 'improve' as a possible action, but extract_edit_context() only returns 'add', 'remove', 'enhance', 'replace', or 'modify' (line 94 in report_editor.py). The word 'improve' is not a valid return value from the function.
# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

edit_context={
"sections": state.get("report_sections_to_edit", []),
"feedback": edit_context_str,
"action": "modify"
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

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

The action is hardcoded to 'modify' instead of using the action from extract_edit_context(). The edit_context_str contains the extracted context from state, but the action should be extracted from it or determined based on the user's feedback. Consider extracting the actual action type from the edit context.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@willem-bd willem-bd changed the title feat: implement report modification feature with targeted research and merging (#663) WIP feat: implement report modification feature with targeted research and merging (#663) Oct 27, 2025
@willem-bd willem-bd changed the title WIP feat: implement report modification feature with targeted research and merging (#663) feat: implement report modification feature with targeted research and merging (#663) (WIP) Oct 27, 2025
@willem-bd
Copy link
Contributor

TODO, need to update the frontend UI to indicate the report editor states.

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.

有报告修改功能的开发计划吗

2 participants