Issue
In the V2 chat, any Orchestrate plan with an Ask an agent (agent_invoke) step fails before the agent runs. The step reports "This step's agent or action isn't available to you right now, so it didn't run. Check that it still exists, is enabled and is shared with you, then retry." The answer step then reports "A required dependency did not complete." It affects personal, group and global agents in both personal and shared conversations. The same agent works when Orchestrate is off.
This persists after 0.261.289 (the selected-agent-with-agents-turned-off fix). That fix removed an earlier refusal, so the step now reaches a later check, which fails for every agent.
Steps to Reproduce
- In V2 chat, turn on Orchestrate and pick a personal agent, for example one with Microsoft 365 email actions.
- Ask something only that agent can answer, such as "What are my latest emails?"
- The plan's Ask an agent step fails with the message above.
- Turn Orchestrate off, pick the same agent and ask again. The agent answers.
Expected Behavior
The Ask an agent step runs the picked agent, as plain chat does, after the provider rechecks the user's current access to that exact agent.
Actual Behavior
The executor logs [ORCHESTRATION_EXECUTOR] A dependency-bound step could not complete. with sc_capability_id=agent_invoke, sc_error_type=OrchestrationInvocationDeniedError, sc_failure_code=integration_unavailable and sc_authority_reason=result_external_source_unavailable. Before 0.261.289 the same symptom logged result_external_capability_unavailable.
Impact
Orchestrate can't use agents at all. The exact-type check has been in place since 0.261.127; until 0.261.270 and 0.261.289 removed earlier refusals, those refusals were hit first. Action steps are unaffected. There's no workaround except turning Orchestrate off.
Notes
Root cause
OrchestrationExternalSourceProvider._resolve_integration (application/single_app/functions_orchestration_external_sources.py) requires the agent returned by resolve_delegation_agent to be exactly a dict:
if type(resolved) is not dict or agent_reference(resolved, identity.user_id) != expected:
raise ResultUnavailableError("result_external_source_unavailable")
resolve_delegation_agent returns _canonical_agent(record), a deepcopy of the Cosmos read_item result (functions_agent_delegation.py). With the pinned azure-cosmos==4.9.0, point reads return CosmosDict, a dict subclass, and deepcopy keeps the subclass, so the exact-type check always fails. The action branch of the same method uses isinstance and isn't affected. This is the same bug class fixed in ORCHESTRATION_COSMOS_RESPONSE_COMPATIBILITY_FIX.md (0.261.140) and ORCHESTRATION_SETTINGS_DOCUMENT_TYPE_FIX.md (0.261.237). The repo's existing remedies are app_settings_store._plain_document and functions_orchestration_bootstrap._document_response.
Evidence
-
Telemetry for two failed runs, one shared and one personal conversation, shows the same Azure SDK call sequence from the executor:
- Identity, conversation and run reads.
- The agent catalog queries; seeded narrowing succeeded and logged no
selected_agent_unavailable warning.
- One point read of the picked agent's document, which returned 200.
- The denial, logged about 50-70 ms later.
That leaves only the checks after the read in resolve_delegation_agent and the provider's type check. Scope settings, governance and "not found" are excluded.
-
Reproduced with the existing ExternalSourceWorld fixture, the unchanged provider and the unchanged resolve_delegation_agent. Only the fake container's read_item return type changes: plain dict → preflight passes; azure-cosmos 4.9.0 CosmosDict → preflight denied with result_external_source_unavailable after exactly one agent point read.
-
Tests missed it because functional_tests/test_support/agent_delegation.py (DelegationServices.reader) returns deepcopy(record), a plain dict.
Plan
_canonical_agent returns a plain dict (deepcopy(dict(record))), fixing all 8 resolve_delegation_agent callers. _etag is a document field and is kept.
_resolve_integration accepts dict subclasses (isinstance) and keeps the exact reference comparison. This covers preflight, result admission and later reads.
DelegationServices.reader (the shared test fake) returns a dict subclass that stands in for CosmosDict, so exact-type checks on SDK results fail in tests. Fix or justify any new failures; never revert the fake to make a test pass.
- Log which check refused a step: a new
[ORCHESTRATION_EXTERNAL_SOURCES] refusal event with sc_stage, sc_authority_reason and an identifier-free sc_reason, for example integration_reference_mismatch, integration_not_found, integration_access_denied or selection_not_in_catalog. It correlates with the executor's failure event by run and step hash.
- Regression test
functional_tests/test_orchestration_agent_document_type_fix.py: the reported case passes; wrong owner, disabled, missing, governance-denied and mismatched agents are still denied with the right check; action steps are unchanged.
- Fix doc
ORCHESTRATION_AGENT_DOCUMENT_TYPE_FIX.md, a follow-up note on ORCHESTRATION_SELECTED_AGENT_DISABLED_PREFERENCE_FIX.md, an admin troubleshooting row, logging-tags updates and version 0.261.291.
After deployment, the next expected gate for Microsoft 365 agents is the existing Microsoft 365 sign-in, approval or read-only step check, which has its own message.
Related: #1661 (agents in Orchestrate; its expected behavior also needs this fix), #1660 (Microsoft 365 action steps), and the 0.261.289 selected-agent fix (#1696).
Issue
In the V2 chat, any Orchestrate plan with an Ask an agent (
agent_invoke) step fails before the agent runs. The step reports "This step's agent or action isn't available to you right now, so it didn't run. Check that it still exists, is enabled and is shared with you, then retry." The answer step then reports "A required dependency did not complete." It affects personal, group and global agents in both personal and shared conversations. The same agent works when Orchestrate is off.This persists after 0.261.289 (the selected-agent-with-agents-turned-off fix). That fix removed an earlier refusal, so the step now reaches a later check, which fails for every agent.
Steps to Reproduce
Expected Behavior
The Ask an agent step runs the picked agent, as plain chat does, after the provider rechecks the user's current access to that exact agent.
Actual Behavior
The executor logs
[ORCHESTRATION_EXECUTOR] A dependency-bound step could not complete.withsc_capability_id=agent_invoke,sc_error_type=OrchestrationInvocationDeniedError,sc_failure_code=integration_unavailableandsc_authority_reason=result_external_source_unavailable. Before 0.261.289 the same symptom loggedresult_external_capability_unavailable.Impact
Orchestrate can't use agents at all. The exact-type check has been in place since 0.261.127; until 0.261.270 and 0.261.289 removed earlier refusals, those refusals were hit first. Action steps are unaffected. There's no workaround except turning Orchestrate off.
Notes
Root cause
OrchestrationExternalSourceProvider._resolve_integration(application/single_app/functions_orchestration_external_sources.py) requires the agent returned byresolve_delegation_agentto be exactly adict:resolve_delegation_agentreturns_canonical_agent(record), adeepcopyof the Cosmosread_itemresult (functions_agent_delegation.py). With the pinnedazure-cosmos==4.9.0, point reads returnCosmosDict, adictsubclass, anddeepcopykeeps the subclass, so the exact-type check always fails. The action branch of the same method usesisinstanceand isn't affected. This is the same bug class fixed inORCHESTRATION_COSMOS_RESPONSE_COMPATIBILITY_FIX.md(0.261.140) andORCHESTRATION_SETTINGS_DOCUMENT_TYPE_FIX.md(0.261.237). The repo's existing remedies areapp_settings_store._plain_documentandfunctions_orchestration_bootstrap._document_response.Evidence
Telemetry for two failed runs, one shared and one personal conversation, shows the same Azure SDK call sequence from the executor:
selected_agent_unavailablewarning.That leaves only the checks after the read in
resolve_delegation_agentand the provider's type check. Scope settings, governance and "not found" are excluded.Reproduced with the existing
ExternalSourceWorldfixture, the unchanged provider and the unchangedresolve_delegation_agent. Only the fake container'sread_itemreturn type changes: plaindict→ preflight passes; azure-cosmos 4.9.0CosmosDict→ preflight denied withresult_external_source_unavailableafter exactly one agent point read.Tests missed it because
functional_tests/test_support/agent_delegation.py(DelegationServices.reader) returnsdeepcopy(record), a plaindict.Plan
_canonical_agentreturns a plaindict(deepcopy(dict(record))), fixing all 8resolve_delegation_agentcallers._etagis a document field and is kept._resolve_integrationaccepts dict subclasses (isinstance) and keeps the exact reference comparison. This covers preflight, result admission and later reads.DelegationServices.reader(the shared test fake) returns adictsubclass that stands in forCosmosDict, so exact-type checks on SDK results fail in tests. Fix or justify any new failures; never revert the fake to make a test pass.[ORCHESTRATION_EXTERNAL_SOURCES]refusal event withsc_stage,sc_authority_reasonand an identifier-freesc_reason, for exampleintegration_reference_mismatch,integration_not_found,integration_access_deniedorselection_not_in_catalog. It correlates with the executor's failure event by run and step hash.functional_tests/test_orchestration_agent_document_type_fix.py: the reported case passes; wrong owner, disabled, missing, governance-denied and mismatched agents are still denied with the right check; action steps are unchanged.ORCHESTRATION_AGENT_DOCUMENT_TYPE_FIX.md, a follow-up note onORCHESTRATION_SELECTED_AGENT_DISABLED_PREFERENCE_FIX.md, an admin troubleshooting row, logging-tags updates and version 0.261.291.After deployment, the next expected gate for Microsoft 365 agents is the existing Microsoft 365 sign-in, approval or read-only step check, which has its own message.
Related: #1661 (agents in Orchestrate; its expected behavior also needs this fix), #1660 (Microsoft 365 action steps), and the 0.261.289 selected-agent fix (#1696).