Skip to content

chore: update dependencies, fix agent resolution & skill discovery#192

Merged
ChrisRomp merged 4 commits intomainfrom
chore/dependency-updates
Apr 11, 2026
Merged

chore: update dependencies, fix agent resolution & skill discovery#192
ChrisRomp merged 4 commits intomainfrom
chore/dependency-updates

Conversation

@ChrisRomp
Copy link
Copy Markdown
Owner

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. Now customAgents is built from all discovered agent definitions (plugin, user, workspace) and passed to createSession/resumeSession, so the SDK can resolve them.

Fix: Remove Duplicative Skill Discovery

The SDK's enableConfigDiscovery already 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/skills display)discoverAllSkillDirectories()
  • Added enableConfigDiscovery: true to inter-agent ephemeral sessions (was missing)

Testing

  • 683 tests pass
  • Type-check clean
  • Verified plugin agent (anvil) resolves correctly after bridge restart

ChrisRomp and others added 3 commits April 10, 2026 09:56
- @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>
Copilot AI review requested due to automatic review settings April 11, 2026 03:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-sdk0.2.2, @slack/bolt4.7.0, vitest4.1.4.
  • Refactor skill discovery into “all sources” (for /skills display) vs “extra only” (for SDK sessions) and enable SDK config discovery on more session types.
  • Build and pass customAgents into 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

Comment thread src/core/session-manager.ts Outdated
Comment thread src/core/session-manager.ts
Comment thread src/core/session-manager.ts
- 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>
@ChrisRomp
Copy link
Copy Markdown
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.

@ChrisRomp ChrisRomp merged commit faf09cb into main Apr 11, 2026
6 checks passed
@ChrisRomp ChrisRomp deleted the chore/dependency-updates branch April 11, 2026 04:06
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