feat(plan): improve prompt messages#491
Conversation
Change-Id: Ia727a27346d32be6d576d086aab7b1d41e47ef5f
There was a problem hiding this comment.
Pull request overview
This PR improves the prompt messages in the plan module by making the user confirmation rule more flexible and adding a language consistency rule. The changes simplify the RULE_WAIT_FOR_CONFIRMATION message to be less strict while maintaining its core functionality, and add a new rule to ensure agents respond in the same language as the plan.
Key changes:
- Softened the RULE_WAIT_FOR_CONFIRMATION prompt by removing "CRITICAL" emphasis and adding logic to skip confirmation when user's request already implies execution intent
- Added "Language consistency" rule to RULE_COMMON to ensure agents respond in the same language as the plan
- Updated test assertions to match the simplified prompt text
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| agentscope-core/src/main/java/io/agentscope/core/plan/hint/DefaultPlanToHint.java | Simplified RULE_WAIT_FOR_CONFIRMATION prompt text and added language consistency rule to RULE_COMMON |
| agentscope-core/src/test/java/io/agentscope/core/plan/hint/DefaultPlanToHintTest.java | Removed assertion checking for "CRITICAL" text to align with the updated prompt |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| + "- Do not modify plan: Do not modify or amend the plan without a clear plan" | ||
| + " modification instruction from user\n"; | ||
| + " modification instruction from user\n" | ||
| + "- Language consistency: Respond to users in the same language as the plan\n"; |
There was a problem hiding this comment.
The new "Language consistency" rule has been added to RULE_COMMON but lacks test coverage. Consider adding a test case to verify this rule appears in generated hints, similar to the test on line 290 of DefaultPlanToHintTest.java that checks for "Update before processing each subtask".
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
## AgentScope-Java Version 1.0.7 ## Description feat(plan): improve prompt messages ## Checklist Please check the following items before code is ready to be reviewed. - [X] Code has been formatted with `mvn spotless:apply` - [X] All tests are passing (`mvn test`) - [X] Javadoc comments are complete and follow project conventions - [X] Related documentation has been updated (e.g. links, examples, etc.) - [X] Code is ready for review
## AgentScope-Java Version 1.0.7 ## Description feat(plan): improve prompt messages ## Checklist Please check the following items before code is ready to be reviewed. - [X] Code has been formatted with `mvn spotless:apply` - [X] All tests are passing (`mvn test`) - [X] Javadoc comments are complete and follow project conventions - [X] Related documentation has been updated (e.g. links, examples, etc.) - [X] Code is ready for review
AgentScope-Java Version
1.0.7
Description
feat(plan): improve prompt messages
Checklist
Please check the following items before code is ready to be reviewed.
mvn spotless:applymvn test)