You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Harness prompt guidance advertises knowledge and skill paths without matching resources #3777
Two Harness prompt instructions can advertise resource paths that are not present in the collected materials:
WorkspaceContextMiddleware always adds ## Domain Knowledge, says that knowledge/ holds many detailed reference documents, and asks the model to browse it even when both readKnowledgeMd() and listKnowledgeFiles() return empty results.
SkillPromptBuilder.DEFAULT_CODE_EXECUTION_INSTRUCTION says every skill includes <files-root>. A mixed catalog may contain a documentation-only skill without that element and a scripted skill with it. The generic instruction contradicts the catalog.
To Reproduce
Create a WorkspaceManager for an empty temporary workspace and invoke WorkspaceContextMiddleware.onSystemPrompt with an empty RuntimeContext. Inspect WorkspaceContextMaterials (or the rendered system prompt): the working-principles instruction still advertises knowledge references.
Render a SkillCatalog containing one entry whose filesRoot is null and another with a valid resource root. Both entries are discoverable, but the code-execution instruction claims each one includes <files-root>.
These cases require no LLM, credentials, or external services.
Expected behavior
Derive knowledge content and navigation guidance from the same collected body and file catalog. Omit knowledge guidance when both are empty; keep inline-only knowledge without promising a browsable directory; retain navigation when actual file paths were collected, including when reference material is omitted for context budget.
Describe file listing and script execution only for skills that provide <files-root>. Documentation-only skills must remain discoverable and loadable through load_skill_through_path.
Preserve memory behavior and public APIs.
Error messages
This is a prompt/resource mismatch. It can cause unnecessary attempts to access missing paths; the deterministic reproduction is the inaccurate instruction itself.
Environment
AgentScope-Java: 2.1.0-SNAPSHOT, upstream main 16cb024ae62a10db2aedc2371f4d729194ffda82
Java: 17
OS: macOS
Additional context
#3374 already fixed reporting a cached directory when a repository stages no resources. This report covers the remaining generic guidance, not a reimplementation of that fix. #3278 (an independent knowledge switch) and #3614 (disabled filesystem tools) are related but have different triggers and scope.
I will prepare a focused PR with regression tests and aligned English/Chinese documentation.
Activity
fix(harness): align knowledge and skill guidance with available resou…