-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(plan, rag) fix the bug in the word reader and plan notebook class. #895
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
Conversation
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 enhances the plan module's serialization capabilities by exposing previously excluded fields (id, created_at, state, finished_at, outcome) in the model serialization, implements plan state management through a refresh_plan_state() method, and adds comprehensive test coverage for plan lifecycle serialization/deserialization. Additionally, it refactors the Word reader module to use TYPE_CHECKING for conditional imports to avoid runtime import overhead.
- Removed
exclude=Truefrom several Plan and SubTask model fields to enable full serialization - Added
refresh_plan_state()method to automatically update plan state based on subtask states - Extended test coverage to verify serialization/deserialization throughout the complete plan lifecycle
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/agentscope/plan/_plan_model.py | Removed field exclusions and added refresh_plan_state() method for automatic plan state management |
| src/agentscope/plan/_plan_notebook.py | Integrated plan state refresh into subtask state updates |
| src/agentscope/plan/_in_memory_storage.py | Added serialization/deserialization support for historical plans storage |
| tests/plan_test.py | Added comprehensive test coverage for plan serialization throughout the lifecycle |
| src/agentscope/rag/_reader/_word_reader.py | Refactored imports to use TYPE_CHECKING for conditional type imports |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (2)
src/agentscope/rag/_reader/_word_reader.py:1
- The Args section is missing the type annotation for the 'table' parameter. According to the project's docstring template, it should be
table (DocxTable):or the full qualified type name.
# -*- coding: utf-8 -*-
src/agentscope/rag/_reader/_word_reader.py:1
- The Args section is missing the type annotation for the 'para' parameter. According to the project's docstring template, it should be
para (DocxParagraph):or the full qualified type name.
# -*- coding: utf-8 -*-
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.
LGTM.
AgentScope Version
[The version of AgentScope you are working on, e.g.
import agentscope; print(agentscope.__version__)]Description
[Please describe the background, purpose, changes made, and how to test this PR]
Checklist
Please check the following items before code is ready to be reviewed.
pre-commit run --all-filescommand