Skip to content

Commit 82ab526

Browse files
author
Copilot
committed
Address review feedback for microsoft#5897: Python: .NET: [Bug]: GitHubCopilotAgent silently drops MCP tool result events — projected as opaque AIContent instead of FunctionResultContent, causing models to fabricate timeout errors
1 parent 41da08b commit 82ab526

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎python/packages/core/agent_framework/_skills.py‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2134,9 +2134,7 @@ async def _run_script(
21342134
),
21352135
FunctionTool(
21362136
name="read_skill_resource",
2137-
description=(
2138-
"Reads a resource associated with a skill, such as references, assets, or dynamic data."
2139-
),
2137+
description=("Reads a resource associated with a skill, such as references, assets, or dynamic data."),
21402138
func=_read_resource,
21412139
input_model={
21422140
"type": "object",
@@ -2173,8 +2171,7 @@ async def _run_script(
21732171
"type": "object",
21742172
"additionalProperties": True,
21752173
"description": (
2176-
"Named arguments as key-value pairs "
2177-
'(e.g. {"length": 24, "uppercase": true}).'
2174+
'Named arguments as key-value pairs (e.g. {"length": 24, "uppercase": true}).'
21782175
),
21792176
},
21802177
{

‎python/packages/core/tests/core/test_skills.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4086,8 +4086,8 @@ async def test_full_skill_content_contains_scripts(self) -> None:
40864086

40874087
async def test_content_is_cached(self) -> None:
40884088
skill = _MinimalClassSkill()
4089-
content1 = (await skill.get_content())
4090-
content2 = (await skill.get_content())
4089+
content1 = await skill.get_content()
4090+
content2 = await skill.get_content()
40914091
assert content1 is content2
40924092

40934093
def test_resources_are_lazy_cached(self) -> None:
@@ -5587,8 +5587,8 @@ class TestInlineSkillContentCaching:
55875587
async def test_content_cached_after_first_access(self) -> None:
55885588
"""InlineSkill.content returns the same object on subsequent accesses."""
55895589
skill = InlineSkill(frontmatter=SkillFrontmatter(name="test-skill", description="Test"), instructions="Body")
5590-
first = (await skill.get_content())
5591-
second = (await skill.get_content())
5590+
first = await skill.get_content()
5591+
second = await skill.get_content()
55925592
assert first is second # Same object (cached)
55935593
assert "<name>test-skill</name>" in first
55945594

‎python/samples/02-agents/harness/harness_research.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ async def main() -> None:
109109
print(f"\n [calling tool: {content.name}]", flush=True)
110110
print(" ", end="", flush=True)
111111
# Show web search activity when the result arrives with action details.
112-
elif content.type in ("search_tool_call", "search_tool_result") and getattr(content, "tool_name", None) == "web_search":
112+
elif (
113+
content.type in ("search_tool_call", "search_tool_result")
114+
and getattr(content, "tool_name", None) == "web_search"
115+
):
113116
action = None
114117
if content.type == "search_tool_result" and isinstance(content.result, dict):
115118
action = content.result.get("action", {})

‎python/uv.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)