Skip to content

fix(harness): reject incomplete memory consolidation - #3857

Merged
Buktal merged 1 commit into
agentscope-ai:mainfrom
Buktal:codex/commit-complete-memory
Oct 30, 2026
Merged

Buktal merged 1 commit into
agentscope-ai:mainfrom
Buktal:codex/commit-complete-memory

Conversation

@Buktal

@Buktal Buktal commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

AgentScope-Java Version

2.1.0-SNAPSHOT

Summary

An output-limit response currently replaces MEMORY.md and advances its consolidation watermark, losing the prior curated memory. Reject incomplete or invalid candidates before writing, and advance the watermark only after confirming the write.

 consolidate daily ledgers
-  stream directly from the model
-  commit any non-empty text and advance the watermark
+  use the existing budget-only auxiliary call boundary
+  reject truncated, tool-bearing, empty, or oversized candidates
+  write MEMORY.md and confirm it by reading it back
+  advance the watermark only after confirmation

Reuse ContextModelCalls.auxiliary, FinishReasons, and the existing workspace/store routing. Keep the body-text target separate from the model API output limit. Update both memory guides; an unconfirmed write preserves the watermark but may already have changed the body.

Refs #3834, slice 05. The shared tracking issue remains open for the other slices.

Evidence

  • Before: a non-empty length response passes the existing text-only accumulator and overwrites memory/progress.
    After: lengthPartialRejected_thenValidResultCommitted preserves the old memory/watermark for that response, then commits a subsequent complete candidate.
  • Eleven new regression tests cover rejection, successful retry, input-budget refusal, auxiliary message shape, errors, cancellation, unconfirmed writes, identity routing, and the store watermark.
  • Java validation: mvn -B -T1C -pl agentscope-harness -am spotless:check test passed: 5,040 tests, no failures/errors, 41 skipped (Core: 2,942; AG-UI: 554; Harness: 1,544).
  • Documentation: npm test (13 passed) and npm run validate passed. The full-site npm run broken-links reports 2,222 links in 328 files on Windows, matching the existing recorded count; this change adds no links.
  • spotless:apply and git diff --check passed. The full repository suite and live-provider tests were not run.

Merge Danger

Door: two-way. No public API, dependency, or storage-format changes.

Blast Radius: memory. Consolidation can retry ledgers when a candidate is refused or a write cannot be confirmed; no cross-store transaction is introduced.

Checklist

  • Code has been formatted with mvn spotless:apply.
  • Harness and its dependency-module tests pass (see validation result above).
  • Javadoc comments describe the write-confirmation guarantee.
  • Related English and Chinese documentation is updated.
  • Code is ready for review.

@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 17ba76b.

Approve preview

@Buktal
Buktal merged commit ed4556a into agentscope-ai:main Oct 30, 2026
6 checks passed
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