#17062: fix(telegram): prioritize workspace skills over bundled in native command registration
channel: telegram
agents
stale
size: XS
Cluster:
Skill Command Deduplication
Fixes #17061
## Problem
When `commands.nativeSkills: true`, all eligible skills (bundled + workspace) are registered as Telegram bot commands. With 50+ bundled skills, the 100-command Telegram limit is easily exceeded. The existing truncation logic drops commands from the end of the list, which can silently drop workspace/user skills that the user actually wants.
## Solution
1. **Track skill origin**: Added `bundled?: boolean` flag to `SkillCommandSpec` (set when `skill.source === "openclaw-bundled"`)
2. **Reorder command list**: Bundled skill commands are now placed **after** built-in commands, workspace skills, plugin commands, and custom commands
3. **Better overflow warning**: The truncation message now mentions `skills.allowBundled` as the recommended config to limit bundled skill commands
### Command registration order (new)
1. Built-in OpenClaw commands + workspace skill commands
2. Plugin commands
3. Custom commands
4. Bundled skill commands ← truncated first when over 100
### Files changed
- `src/agents/skills/types.ts` — added `bundled` field to `SkillCommandSpec`
- `src/agents/skills/workspace.ts` — populate `bundled` flag from `entry.skill.source`
- `src/telegram/bot-native-commands.ts` — partition and reorder commands by origin
- `src/telegram/bot-native-commands.test.ts` — updated test expectation for new warning message
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Prioritizes workspace/user skills over bundled skills when registering Telegram bot commands to prevent user-created skills from being silently dropped when hitting the 100-command limit. The PR adds a `bundled` flag to track skill origin, reorders the command list to place bundled skill commands last, and updates the truncation warning to suggest using `skills.allowBundled` configuration.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The implementation is straightforward and correct - it adds a boolean flag to track bundled skills, reorders an array based on that flag, and updates a warning message. The logic properly maps skill command names through the transformation pipeline, and the test has been updated to match the new behavior. No security issues, performance concerns, or breaking changes.
- No files require special attention
<sub>Last reviewed commit: 65c60f4</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#14991: fix(telegram): deduplicate skill commands by skillName to prevent B...
by smartchainark · 2026-02-12
85.1%
#21839: fix(skills): allowBundled: [] now blocks all bundled skills
by hydro13 · 2026-02-20
80.5%
#22198: fix(skills): treat empty allowBundled array as block-all
by haitao-sjsu · 2026-02-20
79.3%
#11240: Fix #10875: Clear Telegram commands before registering to prevent d...
by divol89 · 2026-02-07
79.1%
#19164: fix(discord): dedupe native skill commands across agents by skill name
by seewhyme · 2026-02-17
78.0%
#19664: fix(skills): log skill YAML parsing diagnostics with skill name
by orchidsun · 2026-02-18
74.4%
#21727: skills: treat allowBundled [] as denylist for bundled skills
by AIflow-Labs · 2026-02-20
74.3%
#12076: fix(skills): recursive directory filtering to actually exclude venv...
by xiaoyaner0201 · 2026-02-08
74.0%
#11132: fix(telegram): guard command menu overflow and doctor warnings
by kiminbean · 2026-02-07
74.0%
#22525: [Bug]: Session snapshot not reloading skills after gateway restart ...
by zwffff · 2026-02-21
73.8%