-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat: implement report modification feature with targeted research and merging (#663) (WIP) #666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…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)
There was a problem hiding this 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" |
Copilot
AI
Oct 27, 2025
There was a problem hiding this comment.
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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
TODO, need to update the frontend UI to indicate the report editor states. |
Fix #663