fix(harness): preserve RuntimeContext during skill promotion - #2465
fix(harness): preserve RuntimeContext during skill promotion#2465RainYuY wants to merge 2 commits into
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
oss-maintainer
left a comment
There was a problem hiding this comment.
Review: fix(harness): preserve RuntimeContext during skill promotion
Verdict: Approved ✅
Clean, well-scoped fix. The changes correctly propagate the caller's RuntimeContext through the entire skill promotion pipeline (draft lookup → resource loading → security scan → gate review → filesystem move).
Highlights
- Backward-compatible overload —
promoteSkill(name, reviewerId)delegates to the new context-aware overload withgetRuntimeContext(), preserving existing callers. - Default method on
RuntimeContextSkillRepository—getSkill(name, context)provides a sensible default implementation viagetAllSkills(context), avoiding breaking changes for implementors. SkillPromoterrefactor — removes the scatteredRuntimeContext.empty()/ default-context usage and threads the effective context consistently.- Regression test — 111-line test covering USER-scoped isolation (draft visibility, cross-user rejection, resource scanning in owning namespace, dangerous resource rejection).
Minor observation
RuntimeContextSkillRepository.getSkill()does a linear scan. Fine for typical skill counts, but worth noting if repositories grow large.
LGTM.
|
What is the intended semantic of skill promotion?
The current implementation follows option 1 because it preserves isolation and is consistent with the existing single-context filesystem API. I would appreciate maintainer feedback before finalizing this behavior. @chickenlj @jujn |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
AgentScope-Java Version
2.0.1-SNAPSHOT
Description
Background
Skill promotion did not consistently preserve the caller's
RuntimeContext.For USER- or SESSION-scoped workspaces, the context determines which filesystem namespace contains the draft skill. Although
SkillPromoter.promote(...)accepted a context, the following operations still used the default context orRuntimeContext.empty():This could cause a user-scoped draft to appear missing or make promotion operate on the wrong namespace.
Changes
HarnessAgent.promoteSkill(name, reviewerId, RuntimeContext)for explicit context propagation.RuntimeContextSkillRepository.Expected Behavior