Skip to content

fix(autocontext): preserve follow-up turn shape after compression#1146

Open
Alexxigang wants to merge 3 commits intoagentscope-ai:mainfrom
Alexxigang:fix/autocontext-current-round-turn-shape
Open

fix(autocontext): preserve follow-up turn shape after compression#1146
Alexxigang wants to merge 3 commits intoagentscope-ai:mainfrom
Alexxigang:fix/autocontext-current-round-turn-shape

Conversation

@Alexxigang
Copy link
Copy Markdown
Contributor

Summary

  • preserve a non-assistant trailing turn after strategy-6 current-round compression
  • mark synthetic current-round summaries so internal scans ignore them as real user turns
  • add regression coverage for follow-up reasoning turn shape and synthetic-summary metadata

Root cause

Strategy 6 replaced the post-user tool/result sequence with a synthetic assistant message. For providers that expect the next reasoning request to continue from a non-assistant turn, that leaves the conversation ending with assistant content and can produce an empty follow-up response.

Fix

  • store the current-round compressed summary as a synthetic USER message instead of an ASSISTANT message
  • add MsgUtils helpers to detect synthetic current-round summaries and ignore them in user-turn scans / interaction extraction
  • add regression tests covering the follow-up reasoning shape and metadata preservation

Validation

  • mvn -pl agentscope-extensions/agentscope-extensions-autocontext-memory -am spotless:apply
  • mvn -pl agentscope-extensions/agentscope-extensions-autocontext-memory -am "-Dtest=AutoContextMemoryTest,PromptProviderTest,CompressionLanguageHintResolverTest" test

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.

1 participant