Repository navigation
Description
Describe the bug
Several boundaries between execution and model input lose information or describe a different execution environment. This issue tracks three behavior areas in four independently reviewable PRs on 2.1.0-SNAPSHOT (base 00e4a66b66ca3c7a25d216552aae7be62ebe2efa).
| Review unit | Current behavior | Expected behavior |
|---|---|---|
| Tool calls | Successful void tools produce ambiguous empty/null feedback; a PostActingEvent.setToolResult replacement can miss the stored/model-visible message; MCP result diagnostics and Anthropic failure states can be lost. MCP registration can overwrite existing names, and prefixed names can violate provider name constraints. |
Acknowledge completed void calls after completion, propagate hook replacements into subsequent history, retain explicit failures/diagnostics, and validate a complete MCP server's model-facing identities before registration. |
| Skills and execution environment | Harness can advertise a lazy filesystem skill but fail to load its support files. Pre-escaped paths, fixed content fences, and host/container assumptions can misdescribe resource content or execution. | Load support files on demand while preserving repository access decisions and raw bytes; render file content unambiguously; describe paths, shell syntax, and sandbox roots using the active backend. |
| Context and compaction | The synthetic marker also excludes persisted notifications from ordinary conversation compaction. Copied/restored messages can block summary writeback, while overflow reconstruction can revive stale notifications. System sources become multiple text blocks. | Keep durable notifications ordered, budgeted, and compactable; keep request projections transient; accept unchanged serialized history while rejecting real edits; retry from the latest history; join system text sources into one text block. |
To reproduce
These cases use local fixtures and fake models; no provider credentials are required.
- Register a tool returning
void,Void,Mono<Void>, orCompletableFuture<Void>and capture its result after successful completion. Separately replace a tool result in a PostActing hook and inspect the next model request. Register an MCP server with a tool name already in the toolkit, or enable a prefix with characters/length disallowed by model providers. - Create a filesystem skill whose
SKILL.mdreferencesreferences/guide.md, load it lazily through Harness, then load that resource in the next model round. Include nested backtick fences and a path containing spaces. Inspect environment guidance for a Windows host using a sandbox with a different root or no root metadata. - Put a synthetic subagent/team notification in canonical history and force compaction. Repeat with copied messages and with a JSON-restored message containing
Long/BigDecimalmetadata. Check summary persistence and overflow retry input. Changing content or high-precision decimal metadata under the same message ID must prevent writeback.
Acceptance
- MCP: registration conflicts/name normalization and result diagnostics, with regression tests and EN/ZH documentation.
- Tool feedback: completion acknowledgement, hook feedback, and Anthropic
is_error, with regression tests and EN/ZH documentation. - Skills/environment: lazy support-file loading, repository-reader precedence, binary fidelity, dynamic fences, raw paths, per-call shell guidance, and current sandbox metadata, with tests and EN/ZH documentation.
- Context: durable notification placement/compaction, copied/restored history equality with edit protection, overflow reconstruction, and single-block system text, with tests and EN/ZH documentation.
The tool area is split into two PRs; skills/environment and context each have one PR. Every PR has one commit against the same main snapshot and its own complete Maven verification. Close this issue after all four PRs merge, regardless of merge order.
Related issues and boundaries
- [Bug]: Registering a tool with an existing name silently replaces the existing tool (no error, no log), including MCP tools shadowing local tools #3328: this addresses the MCP registration portion; local-to-local intentional replacement semantics remain outside this change.
- [Bug]: Harness prompt guidance advertises knowledge and skill paths without matching resources #3777 / [Bug]: Harness prompt guidance advertises knowledge and skill paths without matching resources #3778: the skill guidance is limited to entries with a files root; knowledge-presence gating is still tracked separately there.
- feat(harness): optimize LLM input context and compaction summaries #3690 / [Bug]: Preserve Harness request context and native tool-call history #3737: follow-up corrections to input layout and context preservation. The open Anthropic native-replay PR fix(anthropic): preserve native thinking and parallel tool history #3740 is separate from tool-result failure-state formatting here.
- [Bug]: Harness compaction gaps: v2.0.4 streaming overflow recovery and custom flushPrompt propagation #3780: the v2.0.4 streaming/backport and custom memory-flush-prompt questions are separate.
Environment and evidence
- AgentScope-Java:
2.1.0-SNAPSHOT; Java runtime 21, compiler release target 17; Windows. - Verification from
mvn -B -T1C clean verify, including Spotless without skip flags. MCP, skills/environment, and context passed the full reactor. Tool feedback passed its affected Core and Anthropic modules; its full reactor stopped on the unchanged Weixin timeout noted below:
| Review unit | Tests | Failures | Errors | Skipped |
|---|---|---|---|---|
mcp-contracts |
11,321 | 0 | 0 | 242 |
tool-feedback |
11,091 | 0 | 1 | 240 |
skill-environment |
11,327 | 0 | 0 | 242 |
context-compaction |
11,317 | 0 | 0 | 242 |
- All four PRs retain the same three-line upstream fixture correction for the
my_skillidentifier conflict between fix(skill): block path traversal in skill materialization and disambiguate skillId #3787 and fix(skill): move blocking skill reload off reactive event-loop threads #3792, preserving production validation and assertions. - All snapshots passed docs tests (13/13), static checks (432 pages, 584 redirects), and Mintlify build validation. Broken-link checks still report 2,218 links across 326 files; individual links were not baseline-attributed.
- One initial MCP full check timed out after 10 seconds in the unchanged
WeixinChannelLoopbackTest; its standalone two-test rerun and complete full-check rerun passed. - The tool-feedback full check hit the same unchanged Weixin timeout (one error, zero assertion failures); downstream modules skipped by Maven are not reported as tested. No further unrelated retests or code changes were made.
- The numeric-restoration regression was reproduced before its fix: 3 failures in 37 context/compaction tests; after the fix, all 37 passed.
- Independent Standards and Spec reviews of both splits each reported 0 findings. The two tool snapshots exactly reconstruct the original tool PR tree; no implementation was added or lost. Explicit exclusions and original checkout/index preservation were verified.
- Prompt changes are checked against tool/backend behavior. No real-model quality, token-saving, or live Docker/Kubernetes results are claimed.
Pull requests
| Unit | Pull request | Scope |
|---|---|---|
| 1a | #3796 | MCP registration, identities, conflicts, and result diagnostics |
| 1b | #3803 | Tool completion, hook feedback, and Anthropic failure states |
| 2 | #3797 | Lazy skill resources, content/path fidelity, and execution/backend guidance |
| 3 | #3798 | Durable context, precision-preserving compaction writeback, and overflow reconstruction |
All four target main and contain exactly one commit each. They can be reviewed and merged independently. The acceptance checkboxes track merge completion; close this issue after all four PRs merge.
Activity
fix(harness): preserve durable context through compaction (#3798)
fix(harness): align skill resources and execution guidance (#3797)
fix: preserve tool completion, hook feedback, and error states (#3803)
juruoO-o commentedon Nov 12, 2026
Closing as delivered by #3797, #3798 and #3803 (all merged) — the three review units are all in: skill resources, durable context through compaction, and tool completion / hook feedback / error states. Reopen if any unit is incomplete.