fix(general-skills): materialize package files for Harness execution - #191
Open
Serious-H wants to merge 1 commit into
Open
fix(general-skills): materialize package files for Harness execution#191Serious-H wants to merge 1 commit into
Serious-H wants to merge 1 commit into
Conversation
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.
问题背景
当前 Harness 在调用 GeneralSkill 时,会将
SKILL.md和包内容摘要加载到模型上下文,但不会将技能包中的真实文件物化到当前 TaskFrame 工作区。因此,对于包含
scripts/、data/、assets/等文件的已上传技能包,Agent 虽然能从技能说明中得知应执行某个脚本,但实际工作区中不存在该脚本。模型可能转而通过write_file重写脚本,导致已审核、已打包的技能实现无法被直接复用。本次改动
在 Harness 读取 GeneralSkill 时,将当前技能包快照物化到当前 TaskFrame:
.harness/skill_packages/{slug}--{digest}/向 Agent 返回
package_workspace.relative_path,使其能够定位真实的SKILL.md、scripts/、data/、assets/等包内文件。更新 Harness Agent 指令:包内已有明确脚本时,直接通过
exec_command执行;不通过write_file重写或复制该脚本。抽取共享的技能包物化实现,旧 GeneralSkill runner 复用该实现,避免两条执行链路对包文件还原行为不一致。
.harness/下的技能包文件继续排除在用户可见 Artifact 发现范围之外。未涉及范围
验证
自动化测试:
backend/.venv/bin/python -m pytest backend/tests/test_harness_v2.py -q:55 passedbackend/.venv/bin/python -m pytest backend/tests/test_general_skills.py -k runner -q:8 passed浏览器校验:
/chat/