Skip to content

[Bug]: Preserve tool outcomes, lazy skill resources, and durable Harness context #3794

Closed

Description

@Buktal

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.

  1. Register a tool returning void, Void, Mono<Void>, or CompletableFuture<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.
  2. Create a filesystem skill whose SKILL.md references references/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.
  3. Put a synthetic subagent/team notification in canonical history and force compaction. Repeat with copied messages and with a JSON-restored message containing Long/BigDecimal metadata. 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

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_skill identifier 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

  1. juruoO-o commented on Nov 12, 2026

    @juruoO-o
    Collaborator

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions