Repository navigation
fix(harness): align MemorySearchToolTest mocks with readMemoryFileUtf8 - #3856
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
xzxiaoshan
approved these changes
Oct 29, 2026
5 tasks done
Buktal
added a commit
that referenced
this pull request
Oct 30, 2026
## AgentScope-Java Version 2.1.0-SNAPSHOT ## Summary Align the parent and child subagent prompts with the existing lifecycle and delivery paths. Require self-contained tasks and final reports, distinguish observer events from delivered results, and keep EN/ZH documentation aligned. ```diff - All subagents are ephemeral; the parent receives only the final text. + Each invocation delivers a final result; intermediate events serve observers. + Live local children retain history across sends; remote history depends on the backend. + Session persistence and later resumption depend on the declaration and backend. ``` Refs #3834 (slice 08). This shared tracking issue should remain open. ## Evidence - **Before:** The prompts describe all subagents as ephemeral while also advertising persistent sessions and follow-up sends, and describe final text as the only information the parent receives despite the existing event forwarding path. - **After:** Local spawn/send tests verify that follow-ups see the first task and reply, and that a task-less spawn does not invoke the child. Prompt contract checks retain handle, timeout-promotion, push/wait, and stable-system guidance. These are offline contract/runtime fixtures, not model-quality measurements. Validation on base `616ab47cc`: - `mvn -B -T1C verify`: full reactor passed, including Spotless and all 9 tests in the three new classes; environment-dependent tests retain their existing skips. - `cd docs; npm test`: 13 passed. - `cd docs; npm run validate`: local checker (432 pages / 584 redirects) and Mintlify build passed. - `git diff --cached --check`: passed. - `npm run broken-links` previously reported 2,222 links across 328 files. That broad CLI report remains unresolved; the local link checker and build validation pass. The initial `clean verify` on the older worktree base failed in `MemorySearchToolTest.errorLookingMemoryIsData`. The branch was then moved onto current main, which already contains the fix in #3856, and the full reactor rerun passed. ## Merge Danger **Door:** Two-way **Blast Radius:** Harness Changes prompt guidance, tests, and documentation only. Reuses the existing local conversation, remote task, final-result delivery, and observer-event mechanisms; adds no protocol or public API. ## Checklist - [x] Code formatting verified by Spotless - [x] All enabled tests are passing (full `mvn verify`; existing environment-dependent skips retained) - [x] Javadoc comments are complete and follow project conventions - [x] Related EN/ZH documentation has been updated - [x] Code is ready for review
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.
Summary
CI
build (ubuntu-latest)andbuild (windows-latest)jobs have been failing onmainsince commit 269ccd1 (#3113) landed. The single failing test across all three runs isMemorySearchToolTest.errorLookingMemoryIsData.Root cause
PR #3113 introduced memory-scoped IO on
WorkspaceManager(readMemoryFileUtf8/appendMemoryFileUtf8/writeMemoryFileUtf8) and switchedMemorySearchToolfromreadManagedWorkspaceFileUtf8toreadMemoryFileUtf8. The test fileMemorySearchToolTestwas not updated — its Mockito stubs still mock the old method name, so the stub is never invoked.readMemoryFileUtf8returnsnull(default for an un-stubbed mock), the file content is skipped, and the search yields 0 matches instead of the expected 2, failing theassertTrue(text.contains("Found 2 matches:"))assertion.The
noMatchesIsASuccessfulSearchtest also used the wrong method name but passed coincidentally — both the stubbed path and the null path produce "no matches".Fix
Update both mock stubs in
MemorySearchToolTestto callreadMemoryFileUtf8, matching the production code.Verification
mvn -T1C -pl agentscope-harness -am test -Dtest=MemorySearchToolTest— 7 tests, 0 failures.mvn -T1C -pl agentscope-harness spotless:check— clean, 0 changes needed.