Skip to content

fix(skills): always inject _builtin skills for native-skill backends#1718

Merged
kaizhou-lab merged 4 commits intoiOfficeAI:mainfrom
JerryLiu369:fix/builtin-skill-injection
Mar 26, 2026
Merged

fix(skills): always inject _builtin skills for native-skill backends#1718
kaizhou-lab merged 4 commits intoiOfficeAI:mainfrom
JerryLiu369:fix/builtin-skill-injection

Conversation

@JerryLiu369
Copy link
Contributor

Problem

For native-skill backends (Codex, Claude, Gemini, etc.), setupAssistantWorkspace() skipped workspace setup entirely when enabledSkills was empty, and explicitly skipped cron even when it was listed. As a result, the three builtin skills (cron, office-cli, aionui-skills) were never symlinked into .codex/skills (or equivalent directories).

This affected both:

  • Generic conversations with no preset assistant (empty enabledSkills)
  • Preset assistant conversations (builtin skills missing even when optional skills were present)

Fix

In setupAssistantWorkspace():

  • Remove the early return on empty enabledSkills
  • Always read _builtin/ and symlink all builtin skills first
  • Then symlink optional enabledSkills, skipping any already covered by builtins

Only one file changed: src/process/utils/initAgent.ts

Test

  • TypeScript compiles cleanly (tsc --noEmit)
  • Verified at runtime: new Codex ACP workspace now contains .codex/skills/cron, .codex/skills/office-cli, .codex/skills/aionui-skills

🤖 Generated with Claude Code

JerryLiu369 and others added 2 commits March 25, 2026 23:24
setupAssistantWorkspace() previously skipped setup entirely when
enabledSkills was empty, and skipped 'cron' even when it was listed.
This meant cron, office-cli, and aionui-skills were never symlinked
into .codex/skills (or equivalent) for native-skill backends.

Now the function:
- removes the early return on empty enabledSkills
- always reads _builtin/ and symlinks all three builtin skills first
- then symlinks optional enabled skills, skipping any already covered

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add getAutoSkillsDir and readdir to test mocks
- Update 'skip when empty' tests: skills dir is now always created for
  native backends even with no enabledSkills
- Replace 'skip cron' test with a test that verifies builtin skills are
  symlinked from autoSkillsDir and deduplicated from enabledSkills

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sentry
Copy link

sentry bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/process/utils/initAgent.ts 93.75% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

JerryLiu369 and others added 2 commits March 26, 2026 00:35
Inner variable names in the vi.hoisted() callback shadowed the outer
destructured names, triggering oxlint no-shadow on the changed file.
Rename the internal variables (dirs, links, stats, etc.) so the factory
body uses unique names and returns them under the original public keys.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kaizhou-lab kaizhou-lab merged commit af0ed13 into iOfficeAI:main Mar 26, 2026
14 checks passed
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.

2 participants