Skip to content

fix(harness): retain tool arguments and continuation context in summaries - #3693

Merged
jujn merged 1 commit into
agentscope-ai:mainfrom
Buktal:codex/harness-compaction-summary-context
Oct 21, 2026
Merged

jujn merged 1 commit into
agentscope-ai:mainfrom
Buktal:codex/harness-compaction-summary-context

Conversation

@Buktal

@Buktal Buktal commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

AgentScope-Java Version

2.1.0-SNAPSHOT

Description

Refs #3690. Independent PR 3/4: compaction summary input and continuation.

Summary

The summary model currently receives tool names without arguments and only a result prefix. Retain argument names and short values, preview long values separately, and include result error identity plus a marked head/tail preview. Short raw JSON is preserved verbatim.

tool call -> name + per-field argument preview
tool result -> name + error state + head/tail preview
summary -> intent/corrections/artifacts/errors/next steps -> direct continuation

The default prompt preserves user corrections and exact artifacts and merges earlier summaries. Both continuation variants use established-background wording; the native history lookup remains conditional on an actual session.

Evidence

  • Before: arguments are absent; whole-object clipping also loses a short path between long old/new strings.
    After: ConversationCompactorSummaryShapeTest checks the middle path, both values' head/tail markers, raw-only arguments, exact short raw numbers, error identity, result tail and native/non-native continuation.
  • The constructed edit case uses 1,334 characters instead of the 629-character whole-object clipping prototype. More preview space preserves separate facts; this is not a token-savings claim. Long arguments still use the existing codec's numeric conversion semantics.
  • Independent branch validation: mvn -B -T1 -pl agentscope-harness -am test spotless:check passed; 1,289 Harness tests, 0 failures/errors, 18 skipped; 2,742 Core tests, 0 failures/errors, 8 skipped.

Merge Danger

Door: two-way. Reverting changes future summaries; already-created summary text remains in its existing conversation history.

Blast Radius: Compaction. Summary-model input and default extraction/continuation instructions change; existing custom prompt configuration remains supported.

Checklist

  • Code has been formatted with mvn spotless:apply
  • Relevant module tests and Spotless pass on this independent branch
  • Javadoc comments follow project conventions
  • Native history lookup and custom prompt placeholder remain supported
  • Code is ready for review

@jujn
jujn merged commit 8f87895 into agentscope-ai:main Oct 21, 2026
5 checks passed
chickenlj added a commit that referenced this pull request Nov 13, 2026
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.

2 participants