Repository navigation
fix(harness): preserve workspace instruction content and cap AGENTS.md - #3723
Merged
Buktal merged 1 commit intoOct 23, 2026
Merged
Conversation
jujn
approved these changes
Oct 22, 2026
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
Summary
Closes #3722.
Workspace instruction examples currently reach the model with HTML entities, and oversized
AGENTS.mdcontent is injected without a source limit. Preserve literal bodies and bound the workspace rules before rendering:ContextRendererpreserves body characters and neutralizes only its own closing delimiters. Reference/runtime items also neutralize the outerHARNESS_CONTEXTdelimiter; attribute values remain escaped.WorkspaceContextMiddlewareuses a bounded UTF-8 encoding buffer and keeps the applicability sentence inside nonempty rules instead of repeating it in environment text.useLegacyXmlWorkspaceContext(boolean)as a deprecated fluent no-op. Remove the unusedRULES_DIRconstant.Evidence
31c7db8c90866502b8685add63adcfc801555edaproducesmvn test && echo "OK"andList<String>.After: regression tests and an offline final-request probe preserve
mvn test && echo "OK"andList<String>while neutralizing embedded frame-closing delimiters.After: 102,400-byte content remains unchanged; 102,401-byte content is capped with
\n\n[File truncated: AGENTS.md]. The probe verifies every cut offset for 1–4-byte UTF-8 characters, per-user isolation, stable SYSTEM bytes, absent-file behavior, and the deprecated builder method.Validation on Windows with GraalVM 21.0.12 (Java release target 17):
mvn -B -T1C clean verify: BUILD SUCCESS; 11,115 tests, 0 failures, 0 errors, 240 skipped. Spotless checks passed as part of the build.npm testindocs: 13 passed.npm run validateindocs: passed.npm run broken-linksindocs: exits 1 with 2,218 reported links in 326 files. Running the same command and CLI against an exported, unmodified31c7db8c90866502b8685add63adcfc801555edaproduces an identical report.Merge Danger
Door: two-way
No persisted-state migration or dependency changes. The source cap does not guarantee that an entire request fits every model's token budget.
Blast Radius: Harness
The shared renderer changes literal body output for SYSTEM, runtime, and reference context. Oversized workspace rules now omit their tail and expose a truncation marker.
Checklist