Commit 5c8e9e1
Introduce agentscope-harness module (#1353)
This pull request introduces a new `agentscope-harness` module built
with the `Harness Engineering` practices.
## Purpose
agentscope-harness builds on agentscope-core with a higher-level agent
runtime for production-style assistants: workspace-first workflows,
pluggable execution environments, and richer memory/session tooling.
## Entry point
HarnessAgent wraps ReActAgent with opinionated defaults: hooks, toolkit
wiring, and configuration for workspace, skills, subagents, and
persistence.
## Key design ideas
* Workspace-centric context — Loads and injects workspace material (e.g.
AGENTS.md, MEMORY.md, knowledge) into the agent’s unified system message
via hooks such as WorkspaceContextHook.
* Pluggable filesystem — Abstracts file operations behind a filesystem
layer (local, sandbox-backed, remote/composite) so tools and agents
share one API regardless of where files actually live.
* Sandbox & isolation — Optional sandbox execution with lifecycle
management, state stores, and options for distributed deployments when
session/sandbox state must be shared across replicas.
* Session & persistence — WorkspaceSession, session trees, and hooks
(e.g. session persistence, traces) tie long-running work to durable
session state where configured.
* Memory operations — Memory flush/consolidation, compaction, and
eviction policies help keep context bounded; dedicated tools (e.g.
memory search/get) support retrieval over workspace memory files.
* Subagents — Declarative subagent specs, spawn/send/list tooling, and
background tasks for delegated or async work (SubagentsHook, task
repository).
* Relationship to core. Harness does not replace ReActAgent; it composes
it with extra hooks, tools, and backends so applications can adopt
“harness” behavior incrementally while staying aligned with core APIs
(Model, Toolkit, Session, hooks).
This pull request also includes significant enhancements to the
`ReActAgent` class, focusing on improved runtime context handling,
per-call system message management, and better integration of
hook-supplied tools.
* Runtime Context and System Message Handling
* Hook and Toolkit Integration
* General Refactoring and Minor Improvements
---------
Co-authored-by: fang-tech <tianyufang978@gmail.com>
Co-authored-by: Copilot <copilot@github.com>1 parent f7f1c17 commit 5c8e9e1
233 files changed
Lines changed: 32338 additions & 260 deletions
File tree
- agentscope-core/src
- main/java/io/agentscope/core
- agent
- hook
- model
- skill
- tool
- test/java/io/agentscope/core
- agent
- hook
- model
- skill
- agentscope-distribution
- agentscope-all
- agentscope-bom
- agentscope-examples
- harness-examples
- harness-example-common
- src/main/java/io/agentscope/examples/harness/common
- model
- util
- harness-example-local
- src/main
- java/io/agentscope/harness/example
- resources
- io/agentscope/harness/example
- workspace
- knowledge
- skills
- query-writing
- schema-exploration
- subagents
- harness-example-remote
- src/main
- java/io/agentscope/examples/harness/remote
- data
- resources
- io/agentscope/examples/harness/remote
- workspace
- knowledge
- skills/query-writing
- harness-example-sandbox
- src/main
- java/io/agentscope/examples/harness/sandbox
- data
- support
- resources
- io/agentscope/examples/harness/sandbox
- workspace
- knowledge
- skills/query-writing
- harness-quickstart
- src/main
- java/io/agentscope/harness/example
- resources
- io/agentscope/harness/example
- workspace
- knowledge
- skills
- query-writing
- schema-exploration
- subagents
- harness-sandbox-docker
- src
- main
- docker/python-sandbox
- java/io/agentscope/examples/harness/sandbox
- test/java/io/agentscope/examples/harness/sandbox
- agentscope-harness
- src
- main/java/io/agentscope/harness/agent
- filesystem
- model
- util
- hook
- memory
- compaction
- session
- sandbox
- filesystem
- impl/docker
- layout
- snapshot
- session
- store
- subagent
- task
- tool
- workspace
- test/java/io/agentscope/harness/agent
- example
- support
- filesystem
- memory
- session
- sandbox
- snapshot
- docs
- en/task
- zh
- harness
- task
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
| |||
Lines changed: 160 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
| |||
151 | 155 | | |
152 | 156 | | |
153 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
154 | 169 | | |
155 | 170 | | |
156 | 171 | | |
| |||
178 | 193 | | |
179 | 194 | | |
180 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
181 | 281 | | |
182 | 282 | | |
183 | 283 | | |
| |||
466 | 566 | | |
467 | 567 | | |
468 | 568 | | |
469 | | - | |
| 569 | + | |
470 | 570 | | |
471 | 571 | | |
472 | 572 | | |
473 | 573 | | |
474 | 574 | | |
475 | 575 | | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
480 | 580 | | |
481 | 581 | | |
482 | 582 | | |
| |||
665 | 765 | | |
666 | 766 | | |
667 | 767 | | |
668 | | - | |
| 768 | + | |
669 | 769 | | |
670 | 770 | | |
671 | 771 | | |
| |||
734 | 834 | | |
735 | 835 | | |
736 | 836 | | |
737 | | - | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
738 | 841 | | |
739 | 842 | | |
740 | 843 | | |
| |||
775 | 878 | | |
776 | 879 | | |
777 | 880 | | |
778 | | - | |
| 881 | + | |
779 | 882 | | |
780 | 883 | | |
781 | 884 | | |
| |||
816 | 919 | | |
817 | 920 | | |
818 | 921 | | |
819 | | - | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
820 | 926 | | |
821 | | - | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | | - | |
828 | | - | |
829 | | - | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
830 | 930 | | |
831 | | - | |
832 | | - | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
833 | 937 | | |
834 | 938 | | |
835 | 939 | | |
| |||
911 | 1015 | | |
912 | 1016 | | |
913 | 1017 | | |
914 | | - | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
915 | 1021 | | |
916 | 1022 | | |
917 | 1023 | | |
| |||
981 | 1087 | | |
982 | 1088 | | |
983 | 1089 | | |
984 | | - | |
| 1090 | + | |
985 | 1091 | | |
986 | | - | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
987 | 1095 | | |
988 | 1096 | | |
989 | 1097 | | |
| |||
1219 | 1327 | | |
1220 | 1328 | | |
1221 | 1329 | | |
| 1330 | + | |
1222 | 1331 | | |
1223 | 1332 | | |
1224 | 1333 | | |
| |||
1234 | 1343 | | |
1235 | 1344 | | |
1236 | 1345 | | |
| 1346 | + | |
1237 | 1347 | | |
1238 | 1348 | | |
1239 | 1349 | | |
| |||
1374 | 1484 | | |
1375 | 1485 | | |
1376 | 1486 | | |
1377 | | - | |
| 1487 | + | |
| 1488 | + | |
1378 | 1489 | | |
1379 | 1490 | | |
1380 | 1491 | | |
| |||
1562 | 1673 | | |
1563 | 1674 | | |
1564 | 1675 | | |
| 1676 | + | |
| 1677 | + | |
1565 | 1678 | | |
1566 | 1679 | | |
1567 | 1680 | | |
| |||
1594 | 1707 | | |
1595 | 1708 | | |
1596 | 1709 | | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
1597 | 1730 | | |
1598 | 1731 | | |
1599 | 1732 | | |
| |||
1748 | 1881 | | |
1749 | 1882 | | |
1750 | 1883 | | |
1751 | | - | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
1752 | 1887 | | |
1753 | 1888 | | |
1754 | 1889 | | |
| |||
0 commit comments