Skip to content

perf(harness): skip marketplace restage when skill files are unchanged - #2893

Open
jialiuyang wants to merge 2 commits into
agentscope-ai:mainfrom
jialiuyang:fix/stager-skip-unchanged-hash
Open

perf(harness): skip marketplace restage when skill files are unchanged#2893
jialiuyang wants to merge 2 commits into
agentscope-ai:mainfrom
jialiuyang:fix/stager-skip-unchanged-hash

Conversation

@jialiuyang

Copy link
Copy Markdown

AgentScope-Java Version

2.0.3-SNAPSHOT (main)

Description

MarketplaceStager.writeIfChanged hashed the on-disk file and the incoming bytes on every stage() call, even when the skill had not changed. Length is compared first; only equal-length files are read, and they are compared with Arrays.equals instead of two SHA-256 digests. Unchanged files keep their mtime. A size mismatch no longer reads the whole file.

MarketplaceStagerWriteIfChangedTest covers missing files, size mismatch, identical bytes, same-length different bytes, and restage through stage().

Fixes #2881

Checklist

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn -pl agentscope-harness -am -Dtest=MarketplaceStagerWriteIfChangedTest,MarketplaceStagerExecBitTest test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

writeIfChanged hashed the on-disk copy and the incoming bytes separately
on every call. Compare length first, then the bytes, so an unchanged
skill is not rewritten and a size mismatch does not read the whole file.

Fixes agentscope-ai#2881
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.

[Enhancement]: MarketplaceStager 每轮都对整棵技能树做完整磁盘读取与双重 SHA-256,只为得出「什么都没变」

1 participant