Skip to content

fix(harness): reject incomplete and non-reducing summaries - #3855

Merged
Buktal merged 2 commits into
agentscope-ai:mainfrom
Buktal:codex/validate-summary-candidates
Oct 29, 2026
Merged

Buktal merged 2 commits into
agentscope-ai:mainfrom
Buktal:codex/validate-summary-candidates

Conversation

@Buktal

@Buktal Buktal commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Reject unusable or non-reducing summaries before replacing conversation history.

- collect summary text -> replace history
+ collect text, tool calls, and terminal status
+ reject output-limit responses, tool calls, and empty text
+ measure the wrapped summary plus retained tail with the configured estimator
+ replace history only when the complete candidate is strictly smaller

Rejected candidates retain successful lightweight reductions. Reuse the existing finish-reason interpretation from ReasoningContext; preserve model errors, cancellation, and the existing history-commit checks. Update the matching English and Chinese context documentation.

Refs #3834 (slice 03). Structured-output preparation is tracked separately in #3851 and is not included here.

Evidence

  • Before: A completed but larger summary, a response stopped at the output-token limit, or text mixed with tool calls could replace history.
    After: Local fake-model regressions reject those candidates, reject empty text, accept smaller valid summaries, and retain lightweight reductions when replacement is rejected. Existing chained-summary and cancellation tests remain covered.
  • Related core/Harness verification and Spotless: 138 tests passed, zero failures/errors. The six-module reactor completed successfully with mvn -B -T1C -pl agentscope-harness -am verify and the relevant test classes selected.
  • Full repository clean verify was attempted and did not pass: GracefulShutdownTest$StateAndConfigTests.defaultConfig expected a null shutdown timeout but observed PT0.1S, reproducing the previously recorded test-order/configuration failure. Shutdown implementation and tests are unchanged. The attempt excluded only two local, uncommitted structured-output test classes already belonging to fix(core): prepare complete structured-output requests #3851; neither class is part of this PR. The shutdown test was not excluded or modified.
  • Documentation: 13 tests passed and npm run validate passed. The existing broken-link check reports 2,222 issues; this change adds no links.
  • Checks ran on base c4bab469c with Java 21 and the project's Java 17 target.

Merge Danger

Door: Two-way. Reversible behavior change; no configuration or serialized-state migration.

Blast Radius: Conversation. Automatic compaction now preserves existing history when a summary is unusable or fails to reduce the full candidate; the existing final request budget check still decides whether the request can proceed.

@mintlify

mintlify Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 6771a06.

Approve preview

CI tests the merge with main, where memory search now reads through readMemoryFileUtf8. Update both stale test stubs to use that existing memory-scoped API while preserving the result-state and content assertions.
@Buktal
Buktal merged commit 616ab47 into agentscope-ai:main Oct 29, 2026
6 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