Repository navigation
Conversation
… in compaction summaries
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AgentScope-Java Version
2.1.0-SNAPSHOT (
mainat634fe8d)Description
Fixes #4565.
The compaction summary transcript labelled framework-injected messages as
Human:turns.renderMessageForSummaryonly recognised the canonicalMsg.METADATA_SYNTHETICkey ("agentscope_synthetic"), whileInboxMiddleware(background tool/hint notifications) andRepeatedFailureGuard(repeated failure reminders) mark theirUSER-role messages with the alias"synthetic". The summary prompt tells the summarizing model thatHuman:lines are the user's own words, so a notification shaped likewas promoted into the summary as a user request. The same file already read both keys in
findLatestUserInput, andCompactionMiddleware.recoveryTailSizedoes as well; the label rendering was the one place that missed the alias.Changes
ConversationCompactor: newMETADATA_SYNTHETIC_ALIASconstant and a package-privateisSyntheticMessage(Msg)helper that accepts the canonical key or the alias.renderMessageForSummaryuses it to chooseFrameworkMessage, andfindLatestUserInputuses it instead of its inline duplicate of the same check.ConversationCompactorSummaryShapeTest: newformatMessagesForSummaryLabelsLegacySyntheticKeyAsFrameworkMessages, built from the exact metadata shapeInboxMiddleware.notification(...)writes ({"synthetic": true, "reminderKind": "background_event"}). It asserts the background event renders asFrameworkMessage:and that noHuman: Automated background eventline appears, while genuine user speech keeps theHuman:label.No public API change; nothing changes for messages that already carry
Msg.METADATA_SYNTHETIC.Tests
The new test fails on the unmodified tree with
and passes with the change. The full
agentscope-harnesssuite was not run in this environment; the modules needed by this change (agentscope-core,agentscope-harness) build withmvn -pl agentscope-harness -am -DskipTests install.Checklist
mvn spotless:applymvn testfor the affected module and test classes)