← Back to PRs

#23749: fix some issues

by tronpis open 2026-02-22 17:07 View on GitHub →
channel: discord channel: telegram commands agents size: M
### 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