#23749: fix some issues
channel: discord
channel: telegram
commands
agents
size: M
Cluster:
Skill Enhancements and Fixes
### Motivation
- Discovery currently treats renamed backup/disabled plugin folders (for example `feishu.disabled.*`, `*.bak`, `*.backup-*`) as live plugins, causing duplicate-ID warnings and the risk of loading stale or untrusted code.
- Provide a safe default by filtering common archive/disable suffix patterns so users can keep backups in-place without triggering discovery.
- Add an automatic skill auto-invoke feature to derive candidate skills from a session-start message so sessions can optionally auto-load relevant skills based on intent.
- Restore/accept legacy IPv4 `gateway.bind` values by allowing IPv4 strings and normalizing them to the modern `custom` shape in config parsing.
### Description
- Ignore archived/disabled directories during automatic plugin discovery by adding `ARCHIVED_PLUGIN_DIR_PATTERN` and `shouldIgnoreDiscoveredExtensionEntry(...)` and skipping matching directories in `src/plugins/discovery.ts`.
- Add a regression test `src/plugins/discovery.ignored-archives.test.ts` that verifies archived/disabled folders are skipped while active plugin folders are still discovered.
- Implement a new skill auto-invoke helper in `src/agents/skills/auto-invoke.ts` (and unit tests in `src/agents/skills.auto-invoke.test.ts`), export it from `src/agents/skills.ts`, and wire it into the agent startup flow in `src/commands/agent.ts` so `buildWorkspaceSkillSnapshot(...)` can receive an auto-resolved skill filter.
- Accept legacy IPv4 bind values in the config schema by adding an IPv4 regex and a transform in `src/config/zod-schema.ts`, plus a test `src/config/config.gateway-bind-legacy.test.ts` that asserts migration to `bind: "custom"` with `customBindHost` set.
- Improve status-reaction timing handling by using `DEFAULT_TIMING` as a baseline and merging configured timing overrides in relevant channels, updating `src/telegram/*` and `src/discord/*` to use the resolved timing values.
### Testing
- Ran the new discovery test with `pnpm test src/plugins/discovery.ignored-archives.test.ts` and it passed.
- Ran type checks and repo checks with `pnpm tsgo` and `pnpm check`, and both completed successfully (engine warnings observed due to Node version but checks succeeded).
- Added unit tests for skill auto-invoke and gateway legacy bind parsing; local focused test runs and type checks around the changed modules passed; a full run of the larger `src/plugins/discovery.test.ts` suite in this environment surfaced an existing ownership-related test that is unrelated to these changes.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This PR introduces several quality-of-life improvements and bug fixes across plugin discovery, skill auto-invocation, configuration parsing, and status reaction timing.
**Key changes:**
- Added automatic filtering of archived/disabled plugin directories (`.bak`, `.backup-*`, `.disabled.*`) during discovery to prevent duplicate-ID warnings and loading stale code
- Implemented skill auto-invoke feature that automatically selects relevant skills based on user message intent at session start using triggers, keywords, and `connects_to` metadata
- Added legacy IPv4 gateway bind value migration to normalize old configs to modern `bind: "custom"` with `customBindHost`
- Improved status reaction timing by merging configured timing with defaults to ensure consistent behavior across Telegram and Discord channels
**Implementation quality:**
- Good separation of concerns with dedicated helper functions
- Proper test coverage for all major features (discovery filtering, auto-invoke scoring, config migration)
- Efficient skill loading by passing pre-loaded entries to avoid double-loading
- Type-safe config schema with proper validation and transformation
<h3>Confidence Score: 4/5</h3>
- Safe to merge with minor validation suggested for regex edge cases
- The implementation is well-structured with comprehensive test coverage. The changes are isolated, backward-compatible, and follow good engineering practices. Score is 4 (not 5) due to one minor consideration: the archived plugin regex pattern could potentially be tested against a broader set of edge cases, though the current implementation handles the documented use cases correctly.
- No files require special attention - all changes are well-tested and follow consistent patterns
<sub>Last reviewed commit: 8bfb7f8</sub>
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#10016: fix: prevent FD exhaustion from skill watcher scanning artifact trees
by oldeucryptoboi · 2026-02-06
82.3%
#22525: [Bug]: Session snapshot not reloading skills after gateway restart ...
by zwffff · 2026-02-21
82.2%
#11250: fix: expand skills watcher ignore list and improve session repair l...
by zhangzhefang-github · 2026-02-07
81.6%
#12076: fix(skills): recursive directory filtering to actually exclude venv...
by xiaoyaner0201 · 2026-02-08
81.1%
#16244: feat(gateway): add session files API and external skill management
by wanquanY · 2026-02-14
79.5%
#14023: fix: filter skills watcher to relevant file types to prevent FD exh...
by funmerlin · 2026-02-11
78.9%
#15115: fix: pre-load skill docs in cron sessions to prevent hallucinated syn…
by joaolcorreia · 2026-02-13
78.6%
#19707: fix(agents): apply per-agent skills filter to all run paths
by mcaxtr · 2026-02-18
78.5%
#22568: fix(gateway): bump skills snapshot version on startup so sessions r...
by zwffff · 2026-02-21
78.2%
#8075: fix(skills): add --ignore-scripts to all package managers
by yubrew · 2026-02-03
78.1%