Skip to content

Python: GitHubCopilotAgent ignores tools added by ContextProvider.before_run (e.g. SkillsProvider.load_skill / read_skill_resource) #5736

@RatnaRaj297

Description

@RatnaRaj297

Description

Versions

  • agent-framework-github-copilot==1.0.0b260421
  • agent-framework-core==1.2.1
  • github-copilot-sdk==0.2.1
  • Python 3.13

Problem

SkillsProvider.before_run registers load_skill / read_skill_resource
via context.extend_tools(...), but GitHubCopilotAgent._create_session
(and _resume_session) only forwards self._tools (the constructor
tools= argument) to CopilotClient.create_session. Tools contributed by
context providers are dropped.

Effect: the model sees the <available_skills> system prompt that tells it
to call load_skill, but load_skill isn't registered as a callable tool,
so calls fail with Skill not found.

Repro

from agent_framework import SkillsProvider
from agent_framework.github import GitHubCopilotAgent

skills = SkillsProvider(skill_paths="./skills")
agent = GitHubCopilotAgent(
    instructions="If asked, call load_skill with the requested skill name.",
    context_providers=[skills],
)

async with agent:
    print(await agent.run("Call load_skill with skill_name='<your-skill>'"))
    # -> model reports load_skill is unavailable / "Skill not found"

Current workaround

skills = SkillsProvider(skill_paths="./skills")
agent = GitHubCopilotAgent(
    ...,
    context_providers=[skills],
    tools=list(skills._tools),  # reaches into private state
)

Expectation

_create_session / _resume_session should merge constructor tools with
the tools added to SessionContext by before_run providers before
calling CopilotClient.create_session.

Code Sample

Error Messages / Stack Traces

Package Versions

agent-framework-github-copilot==1.0.0b260421, agent-framework-core==1.2.1, github-copilot-sdk==0.2.1

Python Version

Python 3.13

Additional Context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpython

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions