Repository navigation
refactor(harness): move skill catalogs and session facts to runtime context - #3691
Merged
jujn merged 1 commit intoOct 21, 2026
Merged
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
jujn
approved these changes
Oct 21, 2026
xzxiaoshan
added a commit
to xzxiaoshan/agentscope-java
that referenced
this pull request
Oct 23, 2026
Conflict resolution in HarnessAgent#forceCompactAndRetry: keep main's overflow-retry rework (agentscope-ai#3661 — persist compacted state via updateAgentState, retry with retryInput to avoid duplicate input) and re-apply the capability-surface re-prepare on the retry call so the grant surface survives the overflow path. Adapt HarnessSkillMiddlewareGrantTest to main's agentscope-ai#3691 change: the skills block now rides a tail runtime material (harness:skills) instead of the system prompt, so grant-visibility assertions move there.
This was referenced Nov 18, 2026
Buktal
added a commit
that referenced
this pull request
Nov 19, 2026
…4248) Closes #4247. ## AgentScope-Java Version `2.1.0-SNAPSHOT` ## Description Follow-up to #3691. Place the Harness skill catalog where the shared request prefix can include it as conversation history grows. ## Summary ```text main System -> history -> runtime materials (including skills) and task state -> references fork/kst System -> runtime materials (including skills) -> history -> task state -> references Proposed System -> skill catalog -> history -> other runtime materials and task state -> references ``` The earlier fork groups the catalog with session facts and per-call values from `ContextBlock.runtime(...)`. A changing value can end the shared prefix before the conversation. [Fork commit `eb50ccd96`](Buktal@eb50ccd) `HarnessContextBuilder` uses the existing `harness:skills` source ID to render the catalog as a request-only User message. The catalog remains required during compaction. If putting it before history would leave an Assistant message last, Harness places the catalog at the end as a User message. ## Evidence - **Before** `skillCatalogPrecedesGrowingHistoryAndChangingRuntimeState` fails on `main` (`c1d482900`) because the catalog follows history. - **After** The ordering, empty-input continuation, and compaction regressions pass. System text matches across all three requests. The first two share the same catalog text, and the third reflects the changed skill description. Changing runtime values follow history. Provider cache hits and savings remain unmeasured. - **Maven** Spotless and the full reactor pass with the Windows CI command below. Harness reports 1,841 tests, 39 skipped, and zero failures or errors. - **Docs** All 20 docs tests pass, and `npm run validate` passes. The `npm run broken-links` report matches the baseline's 2,750 existing broken links. ```sh mvn -B -T1C "-Dmaven.javadoc.skip=true" "-Dmaven.source.skip=true" "-Djacoco.skip=true" "-DskipDurableWindowsTests=true" clean verify ``` ## Merge Danger **Door** Two-way. Reverting restores the previous message order. **Blast radius** Harness model requests with a visible skill catalog. ## Checklist - [x] Spotless formatting checked. - [x] Regression tests and Windows CI build pass. - [x] Javadoc and the English and Chinese Harness guides describe the request layout. - [x] Tracking issue linked.
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.
AgentScope-Java Version
2.1.0-SNAPSHOT
Description
Refs #3690. Independent PR 1/4: workspace session facts and skill discovery.
Summary
Changing the session ID or skill catalog currently rewrites the system prompt. Keep environment instructions in system, and render date/session facts and the skill catalog through the existing runtime-material channel.
The catalog is required so it survives budget selection before history compaction; date/session facts remain optional. EN/ZH skill and workspace docs describe the placement.
Evidence
After:
skillsRemainVisibleInTheFirstRequestAfterCompactiondrives the real middleware, context builder and compactor with 20,000 characters of history and checks that the first prepared request still contains the skill. Environment placement and skill-isolation tests cover the layout.mvn -B -T1 -pl agentscope-harness -am test spotless:checkpassed; 1,284 Harness tests, 0 failures/errors, 18 skipped; 2,742 Core tests, 0 failures/errors, 8 skipped.Merge Danger
Door: two-way. Reverting restores the previous layout; stored state and public builders are unchanged.
Blast Radius: Harness. Skills appear after the conversation and remain required during budget selection.
Checklist
mvn spotless:apply