Skip to content

fix(agent): respect global skills toggle for skill tools#1145

Merged
afjcjsbx merged 1 commit intosipeed:mainfrom
Esubaalew:fix/upstream-skills-global-toggle
Mar 5, 2026
Merged

fix(agent): respect global skills toggle for skill tools#1145
afjcjsbx merged 1 commit intosipeed:mainfrom
Esubaalew:fix/upstream-skills-global-toggle

Conversation

@Esubaalew
Copy link
Copy Markdown
Contributor

Summary

  • require tools.skills.enabled before registering find_skills / install_skill
  • fixes config behavior where global skills disable was ignored

Copilot AI review requested due to automatic review settings March 5, 2026 12:40
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 5, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes agent tool registration so that the skill-related tools (find_skills, install_skill) are only registered when the global tools.skills.enabled toggle is enabled, aligning runtime behavior with the config model.

Changes:

  • Add a global skills enable check before registering find_skills / install_skill.
  • Prevent skill registry manager initialization when global skills are disabled.
Comments suppressed due to low confidence (2)

pkg/agent/loop.go:174

  • Local boolean names use snake_case (e.g., skills_enabled), which is inconsistent with Go conventions and the surrounding camelCase locals in this function. Consider renaming these to skillsEnabled / findSkillsEnabled / installSkillEnabled (and updating uses) for readability and consistency.
		skills_enabled := cfg.Tools.IsToolEnabled("skills")
		find_skills_enable := cfg.Tools.IsToolEnabled("find_skills")
		install_skills_enable := cfg.Tools.IsToolEnabled("install_skill")
		if skills_enabled && (find_skills_enable || install_skills_enable) {

pkg/agent/loop.go:174

  • The behavior change (gating find_skills/install_skill registration on the global skills toggle) is a config regression fix and would benefit from a unit test to prevent reintroductions. Suggest adding a test in pkg/agent/loop_test.go that sets cfg.Tools.Skills.Enabled=false while enabling cfg.Tools.FindSkills.Enabled / cfg.Tools.InstallSkill.Enabled, then asserts the default agent's tool registry does not contain find_skills or install_skill.
		if skills_enabled && (find_skills_enable || install_skills_enable) {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@afjcjsbx
Copy link
Copy Markdown
Collaborator

afjcjsbx commented Mar 5, 2026

LGTM

@afjcjsbx afjcjsbx merged commit 23da450 into sipeed:main Mar 5, 2026
7 of 8 checks passed
dj-oyu pushed a commit to dj-oyu/picoclaw that referenced this pull request Mar 8, 2026
…bal-toggle

fix(agent): respect global skills toggle for skill tools
fishtrees pushed a commit to fishtrees/picoclaw that referenced this pull request Mar 12, 2026
…bal-toggle

fix(agent): respect global skills toggle for skill tools
andressg79 pushed a commit to andressg79/picoclaw that referenced this pull request Mar 30, 2026
…bal-toggle

fix(agent): respect global skills toggle for skill tools
ra1phdd pushed a commit to ra1phdd/picoclaw-pkg that referenced this pull request Apr 12, 2026
…bal-toggle

fix(agent): respect global skills toggle for skill tools
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants