Skip to content

docs(harness): note instruction availability for 2.0.x - #4232

Merged
jujn merged 1 commit into
agentscope-ai:mainfrom
shanuo0312:agent/fix-agentscope-4231-69fe2bb65400
Nov 19, 2026
Merged

jujn merged 1 commit into
agentscope-ai:mainfrom
shanuo0312:agent/fix-agentscope-4231-69fe2bb65400

Conversation

@shanuo0312

@shanuo0312 shanuo0312 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

This is by an automated agent, not a human.

AgentScope-Java Version

2.1.0-SNAPSHOT (main) — documentation change only.

Description

Fixes #4231.

HarnessAgent.Builder.instruction(String, String) is available only in the 2.1 development line (present in v2.1.0-BETA1 and main). The Harness context guide showed the instruction example with no version boundary, so readers who followed a direct /dev/ link while depending on a released 2.0.x version hit a compile error.

This adds a version-availability callout beside the example on the English and Chinese dev pages: instruction is available in 2.1 and later, and 2.0.x applications should keep their existing system prompt and add the rule to sysPrompt instead. The 2.0 versioned docs are unchanged because they do not contain this page.

Before / After

Baseline: 5a7e8e533709398fe5fc047e153235bfdf952498 (current main). Changed revision: 3a89a14595e37e1ec91feb01f3fb00168ab3b517.

Before — docs/dev/en/docs/harness/context.md and docs/dev/zh/docs/harness/context.md showed the instruction example with no version boundary:

agentBuilder.instruction(
        "change-policy",
        "Preserve public API behavior and report which checks support the proposed fix.");
builder.instruction("test-policy", "修改代码后运行相关测试;无法运行时说明原因。");

After — a Mintlify <Note> callout with the 2.0.x alternative follows each example. English:

agentBuilder.instruction(
        "change-policy",
        "Preserve public API behavior and report which checks support the proposed fix.");

instruction is available in AgentScope Java 2.1 and later; the released 2.0.x line does not provide it. On 2.0.x, add the rule to sysPrompt together with your existing prompt:

agentBuilder.sysPrompt(
        "Investigate changes, implement fixes, and report supporting evidence. "
                + "Preserve public API behavior and report which checks support the proposed fix.");

Chinese page receives the equivalent callout; its note also tells readers to keep any existing system prompt and add the rule.

Verification

  • cd docs && npm test — passed.
  • cd docs && npm run validate — passed: 659 pages, 999 redirects: navigation, syntax, local links, anchors and assets passed. and success build validation passed.
  • cd docs && npm run broken-links — passed: success no broken links found.
  • API availability checked against tags: v2.0.3, v2.0.4, and v2.0.5 have sysPrompt but no instruction; v2.1.0-BETA1 and main have both.

Checklist

  • Code has been formatted with mvn spotless:apply — N/A, documentation-only change.
  • All tests are passing (mvn test) — N/A, documentation-only change; the docs checks above are the relevant validation.
  • Javadoc comments are complete and follow project conventions — N/A, no Java changes.
  • Related documentation has been updated (both English and Chinese dev pages).
  • Code is ready for review.

Copilot AI balanced review requested due to automatic review settings November 17, 2026 11:01
@mintlify

mintlify Bot commented Nov 17, 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 3a89a14.

Approve preview

@CLAassistant

CLAassistant commented Nov 17, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The sysPrompt(...) documentation example discards the agent’s existing instructions instead of preserving them alongside the new rule.

1 open issue
What changed in this PR

Clarifies Harness API availability to address #4231, helping readers of the development guides avoid using instruction(...) with released 2.0.x versions.

Changes:

  • Adds English and Chinese notes identifying instruction(...) as available in 2.1 and later.
  • Provides sysPrompt(...) fallback examples for 2.0.x; versioned 2.0 documentation remains unchanged.
File Description
docs/​dev/​zh/​docs/​harness/​context.md Adds the Chinese version note and 2.0.x fallback example.
docs/​dev/​en/​docs/​harness/​context.md Adds the English version note and 2.0.x fallback example.

Review effort: Balanced

Comment thread docs/dev/en/docs/harness/context.md Resolved
@shanuo0312
shanuo0312 force-pushed the agent/fix-agentscope-4231-69fe2bb65400 branch from 4a16dc5 to e3e368b Compare November 17, 2026 11:05
`HarnessAgent.Builder.instruction(String, String)` exists only in the 2.1 development line. The Harness context guide showed the `instruction` example without a version boundary, so readers who opened the `/dev/` page with a released 2.0.x dependency could not compile it.

Document the version boundary next to the example on the English and Chinese pages and point 2.0.x readers to `sysPrompt`.

Fixes agentscope-ai#4231
@shanuo0312
shanuo0312 force-pushed the agent/fix-agentscope-4231-69fe2bb65400 branch from e3e368b to 3a89a14 Compare November 17, 2026 11:07
@jujn

jujn commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

请签署 CLA

@jujn
jujn merged commit 10c94c7 into agentscope-ai:main Nov 19, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Wrong Doc API

4 participants