chore: update dependencies, fix agent resolution & skill discovery#192
Merged
chore: update dependencies, fix agent resolution & skill discovery#192
Conversation
- @github/copilot-sdk 0.2.0 → 0.2.2 (enableConfigDiscovery, modelCapabilities, sessionFs) - @slack/bolt 4.6.0 → 4.7.0 - vitest 4.1.2 → 4.1.4 - Pass enableConfigDiscovery: true so CLI auto-discovers *.agent.md files (SDK 0.2.2 no longer discovers them implicitly) - Graceful agent fallback: if session create fails due to missing agent, clear the pref, retry without the agent, and warn the user Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The SDK's enableConfigDiscovery already discovers workspace-level skills (.github/skills/, .agents/skills/). Remove those from our manual discoverSkillDirectories() to avoid passing duplicates. Keep user-level and plugin skill sources the SDK doesn't scan. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Split discoverSkillDirectories into discoverAllSkillDirectories (for /skills display) and discoverExtraSkillDirectories (for SDK session creation, excludes workspace roots handled by SDK) - Add enableConfigDiscovery to inter-agent ephemeral sessions so they get workspace skills and MCP configs - getSkillInfo() uses the full discovery for accurate /skills listing Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates Copilot Bridge session creation to properly resolve plugin/user-defined agents via the SDK, and removes redundant skill directory discovery by relying on SDK config discovery where appropriate.
Changes:
- Bump dependencies:
@github/copilot-sdk→0.2.2,@slack/bolt→4.7.0,vitest→4.1.4. - Refactor skill discovery into “all sources” (for
/skillsdisplay) vs “extra only” (for SDK sessions) and enable SDK config discovery on more session types. - Build and pass
customAgentsinto SDK session creation/resume; add agent-not-found fallback behavior.
Show a summary per file
| File | Description |
|---|---|
| src/core/session-manager.ts | Splits skill discovery paths, enables SDK config discovery, passes customAgents, and adds agent selection/session fallback logic. |
| src/core/bridge.ts | Threads enableConfigDiscovery through to SDK createSession/resumeSession calls. |
| package.json | Updates key runtime/dev dependencies. |
| package-lock.json | Lockfile refresh for updated dependency graph. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
src/core/session-manager.ts:1714
- Same case-sensitivity issue as in switchAgent:
msg.includes('not found')is case-sensitive while the agent check is lowercased. Consider normalizing the message once and applying both checks consistently so the agent-pref fallback reliably triggers across SDK error variants.
const msg = String(err?.message ?? err);
// Agent not found — clear the pref and retry without the agent
if (prefs.agent && msg.includes('not found') && msg.toLowerCase().includes('agent')) {
log.warn(`Agent "${prefs.agent}" not found for channel ${channelId}, falling back to default`);
prefs.agent = null;
- Files reviewed: 3/4 changed files
- Comments generated: 3
- Normalize error messages to lowercase before substring checks in both switchAgent and createNewSession fallback paths - Fix BYOK error detection strings to match lowercased messages - Populate description field in buildCustomAgents from YAML frontmatter - Add extractFrontmatterField helper for reusable frontmatter parsing Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Owner
Author
|
Re: session config duplication in fallback valid concern about config drift. Deferring for now since the fallback path is rarely hit (only when a stored agent pref becomes invalid) and refactoring the session builder is a larger change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Dependency Updates
0.2.2
4.7.0
4.1.4
Fix: Plugin Agent Resolution
The SDK couldn't find plugin-sourced agents (e.g., "anvil" from
~/.copilot/installed-plugins/) because we only passed the agent name, not the definition content. NowcustomAgentsis built from all discovered agent definitions (plugin, user, workspace) and passed tocreateSession/resumeSession, so the SDK can resolve them.Fix: Remove Duplicative Skill Discovery
The SDK's
enableConfigDiscoveryalready discovers workspace-level skills (.github/skills/,.agents/skills/). Our manual discovery was passing the same directories, causing redundant loading. Split into:user-level + plugin sources only (for SDK sessions)discoverExtraSkillDirectories()full discovery including workspace (for/skillsdisplay)discoverAllSkillDirectories()enableConfigDiscovery: trueto inter-agent ephemeral sessions (was missing)Testing
anvil) resolves correctly after bridge restart