Hi everyone,
I'm looking for help with a very inconsistent behavior between Copilot Studio (web) and a custom application consuming the exact same agent via Direct Connect.
Context
- Published Copilot Studio agent
- Knowledge source: SharePoint documents
- Custom channel: internal web app (frontend + Python/FastAPI backend)
- Backend connection:
- user authenticated on the app side
- refresh token → Power Platform access token exchange
-
microsoft-agents-copilotstudio-client SDK
-
CopilotClient.start_conversation(...)
-
CopilotClient.ask_question_with_activity(...)
- Environment:
- Tenant ID:
dd8e3cc0-2ed0-4282-b95c-2cb15a9f8445
- Observed User Object ID:
0a10ebdc-0b01-4a30-abfb-eeda874b307c
- Published agent (not draft)
Observed issue
For the same prompt, behavior diverges significantly between:
- Copilot Studio (web)
- Our custom app
In the custom app:
- sometimes the search correctly returns documents,
- sometimes it returns
search_result: None,
- with the same agent and similar prompts.
In Copilot Studio web:
- responses are more stable and based on the expected docs.
Connector consent (key point)
The issue appeared when we started receiving connector consentCard activities (SharePoint).
Received activity:
-
name='connectors/consentCard'
-
attachments = Adaptive Card
- actions =
Action.Submit (Allow / Cancel)
- no URL link, submit action only
We implemented handling of this card in our app (clickable buttons, submit to backend, relay to bot).
Technical logs (backend)
We log DynamicPlan* events to compare tool plans.
Failing case:
-
DynamicPlanStepFinished
-
observation_preview={'search_result': None}
-
plan_used_outputs_preview={}
Working case:
-
observation_preview contains search_result.search_results with documents (e.g. Name: 'Livret nouvel arrivant.pdf')
So the same P:UniversalSearchTool tool can return either no results or valid results within the custom channel.
What we're trying to understand
- Is this a known behavior between Copilot Studio web and a custom Direct Connect channel, especially with connector consent?
- After
Allow consent, are there known cases where the connection is not fully reused across session/channel?
- Is there an official recommendation to guarantee behavioral parity (Studio vs. custom app) for UniversalSearchTool + SharePoint?
- Should we prefer
Maker-provided credentials to stabilize this scenario?
What we've already checked
- Agent published for several hours
- Same prompts tested
- Consent handled on the app side via
Action.Submit
- DynamicPlan logs instrumented
- Clean conversation IDs (handling expirations/restarts)
If anyone has encountered this case (especially intermittent search_result=None on a custom channel after consent), I'd really appreciate concrete feedback or a Microsoft-recommended diagnostic checklist.
Thanks a lot.Here's the translation:
Hi everyone,
I'm looking for help with a very inconsistent behavior between Copilot Studio (web) and a custom application consuming the exact same agent via Direct Connect.
Context
- Published Copilot Studio agent
- Knowledge source: SharePoint documents
- Custom channel: internal web app (frontend + Python/FastAPI backend)
- Backend connection:
- user authenticated on the app side
- refresh token → Power Platform access token exchange
-
microsoft-agents-copilotstudio-client SDK
-
CopilotClient.start_conversation(...)
-
CopilotClient.ask_question_with_activity(...)
- Environment:
- Tenant ID:
dd8e3cc0-2ed0-4282-b95c-2cb15a9f8445
- Observed User Object ID:
0a10ebdc-0b01-4a30-abfb-eeda874b307c
- Published agent (not draft)
Observed issue
For the same prompt, behavior diverges significantly between:
- Copilot Studio (web)
- Our custom app
In the custom app:
- sometimes the search correctly returns documents,
- sometimes it returns
search_result: None,
- with the same agent and similar prompts.
In Copilot Studio web:
- responses are more stable and based on the expected docs.
Connector consent (key point)
The issue appeared when we started receiving connector consentCard activities (SharePoint).
Received activity:
-
name='connectors/consentCard'
-
attachments = Adaptive Card
- actions =
Action.Submit (Allow / Cancel)
- no URL link, submit action only
We implemented handling of this card in our app (clickable buttons, submit to backend, relay to bot).
Technical logs (backend)
We log DynamicPlan* events to compare tool plans.
Failing case:
-
DynamicPlanStepFinished
-
observation_preview={'search_result': None}
-
plan_used_outputs_preview={}
Working case:
-
observation_preview contains search_result.search_results with documents (e.g. Name: 'Livret nouvel arrivant.pdf')
So the same P:UniversalSearchTool tool can return either no results or valid results within the custom channel.
What we're trying to understand
- Is this a known behavior between Copilot Studio web and a custom Direct Connect channel, especially with connector consent?
- After
Allow consent, are there known cases where the connection is not fully reused across session/channel?
- Is there an official recommendation to guarantee behavioral parity (Studio vs. custom app) for UniversalSearchTool + SharePoint?
- Should we prefer
Maker-provided credentials to stabilize this scenario?
What we've already checked
- Agent published for several hours
- Same prompts tested
- Consent handled on the app side via
Action.Submit
- DynamicPlan logs instrumented
- Clean conversation IDs (handling expirations/restarts)
If anyone has encountered this case (especially intermittent search_result=None on a custom channel after consent), I'd really appreciate concrete feedback or a Microsoft-recommended diagnostic checklist.
Thanks a lot.