Skip to content

fix(harness): refresh plan guidance and refine context prompts - #3741

Merged
jujn merged 1 commit into
agentscope-ai:mainfrom
Buktal:codex/harness-runtime-prompts
Oct 24, 2026
Merged

jujn merged 1 commit into
agentscope-ai:mainfrom
Buktal:codex/harness-runtime-prompts

Conversation

@Buktal

@Buktal Buktal commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

AgentScope-Java Version

2.1.0-SNAPSHOT

Description

Summary

Plan mode implements a model-call refresh hook but does not register for that extension point, allowing stale SYSTEM policy after a mode change. Enable the existing hook, use the existing slim skill-catalog default, and refine summary wording to retain current user constraints while marking withdrawn decisions.

mode change -> registered model-call refresh -> current policy
skill discovery -> name/description + loadable ID/path
compaction prompt -> exact active constraints + superseded-decision markers

The full-metadata constructor remains available. Skill loading IDs and files-root guidance are retained. Compaction asks for exact wording only where it governs behavior.

Parent issue: #3737. This PR can target main independently.

Evidence

Real Harness/ReAct scheduling tests enter and exit Plan mode and inspect the prepared request. Skill tests check slim metadata, explicit opt-in, loadable IDs, filtering, and file roots. Summary-shape tests check the prompt contract for active constraints and superseded instructions; they do not claim that a live model always follows it.

Isolated verification on upstream 07c5f3078d682da30f29e96b6d76f68242cbc2e1: 51 tests, 0 failures/errors/skips; Spotless passed.

mvn -B -T1C -pl agentscope-harness -am test spotless:check '-Dtest=PlanModeMiddlewareTest,PlanModeSubagentPropagationTest,SkillRuntimeTest,ConversationCompactorSummaryShapeTest,SkillLoadToolFrontmatterViewTest,HarnessSkillMiddlewareContextIsolationTest' -Dsurefire.failIfNoSpecifiedTests=false

ZCode uses recurring mode reminders, a bounded skill-discovery view, and literal compaction extraction. DeepSeek Harness separates Plan policy from transitions, lists skill summaries before loading, and quotes important wording while discarding superseded information. ASJ reuses its existing mechanisms; no reminder state machine or new catalog budget framework is added.

Merge Danger

Door: reversible code change. Blast radius: Plan policy refresh and the default skill/compaction prompt text. Callers relying on arbitrary skill frontmatter can keep the explicit full-metadata constructor. Validation proves scheduling and rendered prompt shape; real-model task-success or compression-quality A/B measurements are not available.

Checklist

  • Code formatting verified with Spotless.
  • Relevant tests pass on this PR's isolated source snapshot.
  • Javadoc comments follow project conventions.
  • Existing context documentation describes the retained APIs; no example API changes are required.
  • Code is ready for review.

@jujn
jujn merged commit 041ce17 into agentscope-ai:main Oct 24, 2026
4 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.

2 participants