Skip to content

Python: forward Foundry context instructions#5887

Open
he-yufeng wants to merge 3 commits into
microsoft:mainfrom
he-yufeng:fix/foundry-skills-instructions
Open

Python: forward Foundry context instructions#5887
he-yufeng wants to merge 3 commits into
microsoft:mainfrom
he-yufeng:fix/foundry-skills-instructions

Conversation

@he-yufeng
Copy link
Copy Markdown
Contributor

Summary

  • forward system/developer messages from Foundry context providers as request instructions
  • keep agent-level instructions and skills/context instructions together instead of dropping the context side
  • add a regression test for SkillsProvider-style context instructions

Fixes #5883.

To verify

  • uv run pytest packages\foundry\tests\foundry\test_foundry_agent.py::test_raw_foundry_agent_chat_client_prepare_options_forwards_context_instructions packages\foundry\tests\foundry\test_foundry_agent.py::test_raw_foundry_agent_chat_client_prepare_options_accepts_function_tools packages\foundry\tests\foundry\test_foundry_agent.py::test_raw_foundry_agent_chat_client_prepare_options_strips_client_side_fields -q --basetemp .tmp\pytest -p no:cacheprovider
  • uv run ruff check packages\foundry\agent_framework_foundry\_agent.py packages\foundry\tests\foundry\test_foundry_agent.py
  • uv run ruff format --check packages\foundry\agent_framework_foundry\_agent.py packages\foundry\tests\foundry\test_foundry_agent.py
  • uv run pyright packages\foundry\agent_framework_foundry\_agent.py packages\foundry\tests\foundry\test_foundry_agent.py
  • uv run python -m py_compile packages\foundry\agent_framework_foundry\_agent.py packages\foundry\tests\foundry\test_foundry_agent.py
  • git diff --check

Copilot AI review requested due to automatic review settings May 15, 2026 06:23
Copy link
Copy Markdown
Contributor

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@he-yufeng
Copy link
Copy Markdown
Contributor Author

Synced this branch with the latest upstream/main and re-ran the targeted checks after the merge.

Verified locally:

uv run --no-sync pytest packages/foundry/tests/foundry/test_foundry_agent.py -q
uv run --no-sync ruff check packages/foundry/agent_framework_foundry/_agent.py packages/foundry/tests/foundry/test_foundry_agent.py
uv run --no-sync ruff format --check packages/foundry/agent_framework_foundry/_agent.py packages/foundry/tests/foundry/test_foundry_agent.py
uv run --no-sync python -m py_compile packages/foundry/agent_framework_foundry/_agent.py packages/foundry/tests/foundry/test_foundry_agent.py
uv run --no-sync pyright packages/foundry/agent_framework_foundry/_agent.py packages/foundry/tests/foundry/test_foundry_agent.py
git diff --check upstream/main...HEAD

All passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: [Bug]: FoundryAgent ignores SkillsProvider / skills in context_providers (agent-framework 1.4.0)

3 participants