fix: update foundry-agent invoke skill for invocations protocol - #2154
Conversation
- Rename create.md → create-hosted.md with reserved env var guardrails - Add blocked prefixes (FOUNDRY_*, AGENT_*) and platform-reserved names - Document platform-injected environment variables - Rewrite invoke skill to use MCP tools instead of az rest fallback - Document responses and invocations protocols with recommended versions - Add session_logstream to tool reference - Add session management reference (session-management.md) - Full CRUD lifecycle, session ID validation, pagination - Session vs conversation distinction - Add file operations reference (file-operations.md) - All 6 operations: upload, download, list, delete, stat, mkdir - Parameters, limits, error handling, common patterns - Update SKILL.md and create-prompt.md links for renamed file Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Update invoke unit tests to match new content (session pattern, readiness checks, RBAC reference to troubleshoot skill) - Update create unit test to reference create-hosted.md (renamed file) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…spec discovery Update the foundry-agent invoke skill to clearly document that the invocations protocol is bytes in, bytes out — the platform is pure pass-through and the developer defines the request/response schema in the container invoke handler. Changes: - invoke.md: Updated Protocols section and Step 3 to explicitly state bytes-in/bytes-out semantics and add OpenAPI spec discovery as the preferred method to learn the expected input format - New references/invocations-protocol.md: Detailed guide covering I/O contract, 3-step schema discovery (OpenAPI spec endpoint → source code → ask user), concrete examples, and error handling - Added "do not guess" guardrails for invocations request body - Clarified conversationId and stream do not apply to invocations Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the microsoft-foundry skill documentation to clarify how the hosted-agent invocations protocol works (raw bytes pass-through) and expands the invoke workflow guidance around sessions and file operations.
Changes:
- Clarifies
invocationsas “bytes in, bytes out” and adds a schema-discovery workflow (prefer OpenAPI). - Adds new invoke reference docs for session management, invocations protocol details, and session file operations.
- Updates skill routing links and unit tests to reflect renamed/updated create + invoke documentation.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/microsoft-foundry/foundry-agent/invoke/unit.test.ts | Updates assertions to match the new invoke docs (sessions vs sticky-session wording). |
| tests/microsoft-foundry/foundry-agent/create/unit.test.ts | Updates the test to load create-hosted.md instead of the prior create.md path. |
| plugin/skills/microsoft-foundry/SKILL.md | Updates the create sub-skill link and lifecycle routing to point to create-hosted.md. |
| plugin/skills/microsoft-foundry/foundry-agent/invoke/invoke.md | Reworks invoke guidance: protocols, sessions via session_create, file ops, and updated error handling. |
| plugin/skills/microsoft-foundry/foundry-agent/invoke/references/session-management.md | New detailed reference for session lifecycle, tooling, and session vs conversation semantics. |
| plugin/skills/microsoft-foundry/foundry-agent/invoke/references/invocations-protocol.md | New reference explaining invocations I/O contract, schema discovery, examples, and errors. |
| plugin/skills/microsoft-foundry/foundry-agent/invoke/references/file-operations.md | New reference for session file tooling and common upload/invoke/download patterns. |
| plugin/skills/microsoft-foundry/foundry-agent/create/create-prompt.md | Updates cross-link to the hosted-agent create doc (create-hosted.md). |
| plugin/skills/microsoft-foundry/foundry-agent/create/create-hosted.md | Adds guidance on reserved, platform-injected environment variables for hosted agents. |
Jon Gallant (jongio)
left a comment
There was a problem hiding this comment.
Solid documentation restructuring. The invoke skill now clearly separates the two protocols and properly delegates session management and file operations to reference docs. The rename from create.md to create-hosted.md is handled cleanly with all cross-references updated.
One observation the bot review didn't catch: the old az rest fallback for invocations is removed, but the inline workflow (Step 3) doesn't show a concrete agent_invoke call with protocol: 'invocations'. The example lives in references/invocations-protocol.md, which is fine for progressive disclosure - but a one-liner example or snippet in Step 3 itself (where users will first encounter invocations guidance) would reduce the back-and-forth for someone following the workflow linearly.
The Quick Reference conversation row inconsistency (already flagged) is the only real issue - the rest reads well.
- Clarify conversationId is responses-only in Quick Reference - Align OpenAPI endpoint URL to full platform path - Split Additional Resources into separate bullets - Add inline invocations example in Step 3 - Strengthen unit test regex assertion to full pattern - Document platform-injected env vars inline, remove private spec link Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Jon Gallant (jongio)
left a comment
There was a problem hiding this comment.
Addresses all prior feedback cleanly. The inline invocations example in Step 3, clarified Quick Reference row, and documented FOUNDRY_* variables all look correct. The test assertion is now precise. No new issues.
59abd05
65a5c72
into
microsoft:main
Summary
Update the foundry-agent invoke skill to clearly document how the invocations protocol works — the platform is pure pass-through, input and output are raw bytes defined by the container developer.
Changes
invoke.mdconversationIdandstreamdo not apply to invocationsNew
references/invocations-protocol.mdGET .../invocations/docs/openapi.jsonendpointMotivation
The invoke skill previously gave vague guidance for the invocations protocol ("payload shape depends on what the hosted agent code expects"). This caused confusion during local testing — agents need clear instructions that invocations is raw bytes pass-through and how to discover the expected input format.
Validation
npm run build— passesnpm run tokens check— within limitsnpm run references— no broken/orphaned references