Skip to content

feat(harness): add progressive loading for built-in tools - #3463

Open
Zbhbb wants to merge 4 commits into
agentscope-ai:mainfrom
Zbhbb:codex/harness-progressive-builtins
Open

Zbhbb wants to merge 4 commits into
agentscope-ai:mainfrom
Zbhbb:codex/harness-progressive-builtins

Conversation

@Zbhbb

@Zbhbb Zbhbb commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

AgentScope-Java Version

2.1.0-SNAPSHOT

Description

Adds opt-in progressive disclosure for HarnessAgent built-in tools:

HarnessAgent.builder()
    .enableProgressiveToolLoading()
    .build();

The feature is disabled by default, so existing builders keep exposing built-ins exactly as before. When enabled, Harness registers the available built-ins as initially inactive META groups and enables reset_equipped_tools:

  • workspace_files
  • subagents
  • session_history
  • web

Memory, skill, and plan-mode tools remain always visible. Existing disable*() options and tools.json filtering run before grouping, empty groups are omitted, and both general-purpose and declarative subagents inherit the setting.

Grouping follows Harness-owned tool instances rather than names alone. An intentional same-name replacement, or a user tool retained while its built-in family is disabled, is not hidden as a Harness built-in. Ordinary duplicate registration still follows Toolkit's fail-fast behavior. Reserved progressive group names and pre-existing group membership fail fast instead of silently producing ambiguous tool visibility.

HarnessAgent.Builder.fromAgent(...) preserves the progressive-loading setting. Its build-time Toolkit copy removes only Harness-owned progressive groups while retaining user tools and unrelated memberships, so filtering and explicit re-enablement remain consistent after a builder round trip.

This PR deliberately reuses the existing session-scoped activation state. It does not add run-scoped reset semantics or automatic progressive classification for custom/MCP tools.

This implements the opt-in built-in grouping requested in #3296. The per-session tool-state isolation discussed in #2439 is already available in v2.0.4 and is reused here.

Closes #3296

Test Plan

  • mvn -T1C -pl agentscope-harness -am -Dtest=ToolkitTest,HarnessAgentProgressiveToolLoadingTest -Dsurefire.failIfNoSpecifiedTests=false test (68 tests, 0 failures, 0 errors)
  • mvn -T1C -pl agentscope-harness -am clean test (1617 Harness tests, 0 failures, 0 errors, 38 skipped; 6-module reactor build successful)
  • npm test from docs/ (13/13 passed)
  • npm run validate from docs/ (432 pages and 584 redirects validated; Mint build validation passed)
  • npm run broken-links from docs/ (no broken links found)
  • git diff --check origin/main...HEAD

The runtime regression coverage from Leeaoyin#1 is included in this branch with authorship preserved.

Checklist

  • Code has been formatted and the Maven build passed Spotless checks
  • All relevant tests are passing
  • Javadoc comments are complete and follow project conventions
  • Related English and Chinese documentation has been updated
  • Code is ready for review

@Zbhbb
Zbhbb force-pushed the codex/harness-progressive-builtins branch from 4a7837a to 3c15880 Compare October 9, 2026 10:06
@codecov

codecov Bot commented Oct 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Zbhbb

Zbhbb commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (48f7257ae) and incorporated the runtime regression tests from Leeaoyin#1 with authorship preserved. No production-code change was needed beyond the original feature.

Local verification on the rebased branch:

  • focused runtime suite: 12 tests, 0 failures, 0 errors
  • Harness reactor: 1166 tests, 0 failures, 0 errors, 19 skipped
  • docs tests: 13/13 passed
  • docs validation: 430 pages and 584 redirects passed

The new head is a84e49fbe; CI will rerun for this commit.

@Zbhbb
Zbhbb force-pushed the codex/harness-progressive-builtins branch from a84e49f to 2be6cd9 Compare October 12, 2026 10:52
@Zbhbb

Zbhbb commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (44ec9e71a). The 13 upstream commits since the previous base did not overlap this PR's seven changed paths, and the rebase completed without conflicts or production-code changes.

Verification on the rebased head 2be6cd97e:

  • progressive-loading runtime suite: 12 tests, 0 failures, 0 errors
  • clean Harness reactor: 1244 Harness tests, 0 failures, 0 errors, 19 skipped
  • docs tests: 13/13 passed
  • docs validation: 430 pages and 584 redirects passed
  • broken-link check: passed

CI will rerun for the new head.

@Zbhbb
Zbhbb force-pushed the codex/harness-progressive-builtins branch from 2be6cd9 to e025c1e Compare November 4, 2026 09:46
@mintlify

mintlify Bot commented Nov 4, 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 20c76be.

Approve preview

@Zbhbb

Zbhbb commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Rebased semantically onto current main (d30a6c92f) and resolved the Harness tool-registration changes introduced upstream.

  • progressive grouping now consumes the Harness-owned bindings captured after ToolFilter.apply, preserving Toolkit's duplicate-registration fail-fast behavior
  • always-visible Harness tools are excluded from progressive membership validation
  • Builder.fromAgent(...) now preserves progressive loading while rebuilding the reserved groups, without dropping user tools or unrelated group memberships
  • explicit re-enablement after a builder round trip is covered by regression tests

Verification on head e025c1eeb:

  • focused Core + Harness tests: 68 passed
  • clean 6-module Harness reactor: 1617 Harness tests, 0 failures, 0 errors, 38 skipped
  • docs tests: 13/13 passed
  • docs validation: 432 pages and 584 redirects passed
  • broken-link check: passed

CI is rerunning for the new head.

@jujn jujn added the P2 重要不紧急 label Nov 4, 2026
@Zbhbb
Zbhbb force-pushed the codex/harness-progressive-builtins branch from e025c1e to f4dc0a0 Compare November 6, 2026 02:41
@Zbhbb

Zbhbb commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (dc077e7ab) to clear the out-of-date status. The upstream readFileMaxChars changes overlapped the Harness builder paths, so the rebase retained both behaviors without changing the progressive-loading semantics.

Verification on head f4dc0a009:

  • focused Core + Harness tests: 15 passed
  • clean six-module Harness reactor: 1629 tests, 0 failures, 0 errors, 38 skipped
  • docs tests: 13/13 passed
  • docs validation: 432 pages and 584 redirects passed
  • broken-link check: passed
  • git diff --check: passed

CI is rerunning for the rebased head.

@Zbhbb
Zbhbb force-pushed the codex/harness-progressive-builtins branch from f4dc0a0 to e63da93 Compare November 12, 2026 02:46
@Zbhbb

Zbhbb commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto latest main (c8875287f808deb3cd0b3c2d85d671f1860fbbec) and pushed as e63da93ffb244e6cfb33da6aa30fc7bbab14ed7c so the PR is up to date again.

Validation before push:

  • Focused Harness/toolkit tests: 102 passed, 0 failures, 0 errors, 0 skipped.
  • Clean reactor test: mvn -T1C -pl agentscope-harness -am clean test — BUILD SUCCESS; Harness 1771 tests, 0 failures, 0 errors, 39 skipped.
  • Docs: npm test, npm run validate, npm run broken-links — 13/13 tests passed; 432 pages, 584 redirects, no broken links.

GitHub CI has restarted for the rebased head; I will address any new failure from its detailed logs.

This branch has not been deployed

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

Labels

P2 重要不紧急

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Opt-in tool groups for HarnessAgent built-in tools (progressive disclosure of built-ins)

3 participants