Repository navigation
Python: [BREAKING] Harden Foundry Hosting options - #10264
Eduard van Valkenburg (eavanvalkenburg) wants to merge 80 commits into
Conversation
…responses-integration
…responses-integration
…responses-integration
…read-only approval translation - Toolbox call_tool converts MCP -32006 consent into structured oauth_consent_request plus paired function_result, blocks later protected Toolbox calls in the host scope, sanitizes disallowed consent links. - Approval conversion uses private read-only _ApprovalLookup; tracker uses staging _ApprovalRecorder awaited before yield; missing generated id raises RuntimeError.
…esponse_server_options adoption
…responses-integration
…responses-integration
Reverts 716f830. Removing the guard was outside the consent/translation scope; steering behavior stays owned by the constructor/options owners.
Delete FunctionApprovalStore, FoundryFunctionApprovalStore and FunctionApprovalStoreProvider from _state_store.py; session-backed approval authority replaces them. Drop the matching legacy tests while keeping session/checkpoint scope coverage.
…responses-integration
…responses-integration
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…responses-integration
…responses-integration
…responses-integration
# Conflicts: # python/packages/foundry_hosting/agent_framework_foundry_hosting/_invocations_agent.py
…ons" This reverts commit 7d92c28.
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: Findings reported
Scope: full PR (9 commit(s)): e76e87e6de2a, 8a713288bfd6, 5a2bf847c6f0, dd9c10e7080d, 3cc4905f7f0a, 4c50dcb8f867, 3d0afc855f13, 15adafd2b0e1, bde8bbe95977
Model: gpt-5.6-sol
Overview
The change establishes explicit option-selection, protected-field validation, bounded workflow output, and request-owned workflow resource checks, with broad streaming and non-streaming coverage. The remaining gap is in the new foreground background-option guard: core appends context-provider chat middleware after that guard, so such middleware can still enable provider background and bypass the intended hosting boundary.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
1 verified finding remained after source verification (1 medium) across 1 file. Details are attached to the affected lines below.
Affected areas: python/packages/foundry_hosting/agent_framework_foundry_hosting/_shared.py
…responses-integration # Conflicts: # python/packages/foundry_hosting/agent_framework_foundry_hosting/_invocations_shared.py # python/packages/foundry_hosting/agent_framework_foundry_hosting/_shared.py # python/packages/foundry_hosting/tests/foundry_hosting/test_background_middleware.py
…options-and-configuration
Separate Invocations/Responses agent and workflow hosts. Agent hosts forward only caller messages by default; agent default_options apply and prepare_options is the explicit opt-in. Workflow hosts require a parser; workflow options come only from the parsed turn.
Motivation & Context
Foundry Hosting needs explicit option and background boundaries for the RC. This is the configuration and Invocations portion of the broader work in #10260.
Do not merge this PR alone. It breaks 17 Responses and native Responses tests until E's matching Responses integration lands with it. E's
foundry-responses-integrationbranch includes this work and the required follow-up.Description & Review Guide
prepare_options; validate protected host/run fields and provider-background settings; tighten Invocations configuration and workflow ownership checks; remove the legacy Invocations wire format and the sharedreject_removed_host_settingscompatibility helper.df055c710also reverts a separate Responses-only copy of the removed-settings helper.For example, with an already configured
agent:Related Issue
Relates to #10012, #10017, #10022, and #10023. This is a scoped contribution to #10260, which targets
main; the issues remain open for the combined work.AI Assistance
AI assistance details: Implementation, tests, and PR description.
Contribution Checklist
cd python && uv run --no-sync poe syntax -P foundry_hosting -Ccd python && uv run --no-sync poe pyright -P foundry_hostinguvx --from ruff==0.17.3 ruff format --check python/packages/foundry_hostingcd python && uv run pytest packages/foundry_hosting/tests/foundry_hosting/test_invocations_workflow.py packages/foundry_hosting/tests/foundry_hosting/test_host_options.py packages/foundry_hosting/tests/test_invocations.py packages/foundry_hosting/tests/test_foundry_hosting_imports.py packages/foundry_hosting/tests/test_request.pycd python/packages/foundry_hosting && uv run --no-sync pytest tests -m 'not integration' --no-cov --tb=short -qdf055c7100eccb0b42c89b56c179315c1b8fff5f:cd python && OTEL_SDK_DISABLED=true uv run --no-sync pytest -o addopts='--import-mode=importlib' -m 'not integration' packages/foundry_hosting/tests -q -p no:cacheprovider -n 8breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.