* Restructure harness console so that reactive app is the entry point
* Further refactoring to split tool formatters, improve UX, make console configurable and fix bugs
* Address PR comments.
* UX tweak
* Fix streaming text bug
* Address PR comments.
TestServerWithDevUI_ResolvesMixedAgentsAndWorkflows_AllRegistrationsAsync fails intermittently in the merge_group with NRE on the discovery response, blocking PRs unrelated to DevUI from merging. Skip via Fact(Skip=...) referencing #5845 while the underlying race is investigated.
* Python: DevUI: tighten default access controls and CORS posture
Adjusts the default configuration of the DevUI server so the out-of-the-box
posture matches what most callers expect when running locally. Adds explicit
opt-outs for callers who need the previous behavior.
- DevServer gains auth_enabled and auth_token constructor params; auth is on by
default. Auto-generates and logs a token when none provided.
- CORS default is an empty allowlist on every host. Callers wanting cross-origin
pass cors_origins explicitly.
- Streaming /v1/responses no longer sets Access-Control-Allow-Origin directly;
CORSMiddleware owns all CORS decisions.
- Loopback binds enforce a Host-header allowlist.
- /meta moved out of the auth bypass list (was alongside /health and /).
- serve() default flipped to auth_enabled=True; passes auth args through to
DevServer instead of using env-var indirection.
- CLI: --auth opt-in replaced with --no-auth opt-out; --auth-token preserved.
- Tests cover the eight behaviors above in test_server.py.
* Python: DevUI: address PR review comments
- /meta now derives auth_required from self.auth_enabled instead of
reading DEVUI_AUTH_TOKEN, so the auto-generated and explicit
auth_token paths report correctly.
- Reorder middleware so the loopback Host-header allowlist is registered
last; Starlette wraps later-added middleware around earlier-added ones,
so the host check now runs outermost (before CORS/auth) as intended.
- Rework comments to describe the behavior rather than threat scenarios.
- Streaming-headers and CORS tests now construct the server with an
explicit auth_token and send a Bearer header, so the assertions
actually exercise the streaming/CORS path instead of short-circuiting
in the auth middleware.
Replaces two ILogger.LogWarning(string, params object?[]) calls in DevUIAuthFilter and DevUIExtensions with allocation-free [LoggerMessage] partial methods on a new internal DevUILog class. Preserves original message templates and structured property names ({RemoteIp}, {EnvVar}).
Co-authored-by: alliscode <25218250+alliscode@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fixes microsoft/agent-framework#3295. When the OpenAI Responses chat
client sends a request that carries previous_response_id / conversation_id
/ conversation, the server already has the prior turn's response items
and rejects duplicates with "Duplicate item found with id fc_xxx". The
chat client was re-sending them inline whenever the input messages still
carried the items in additional_properties (workflow replay, history
providers, etc.), which broke any tool-using agent with persistent
history.
Decisions:
- Single chokepoint: _prepare_message_for_openai. When the resulting
request uses service-side storage, drop function_call, reasoning,
approval-request/response, and local-shell-call items from the wire
input. Keep function_result with its call_id; the server pairs it to
the prior function_call via that key.
- function_result is preserved unconditionally except for the local-shell
variant, which carries its own server-issued item id.
- No public API change. Wire format change is subtractive and only on
requests that would otherwise 400.
- Re-pointed the strict-xfail in test_full_conversation.py from #4047 to
#3295. Kept xfail because the test asserts executor-level session-id
clearing, which is the defense-in-depth half tracked by 3295-03; this
slice closes the wire-level half.
Files:
- python/packages/openai/agent_framework_openai/_chat_client.py: strip
rule applied alongside the existing reasoning-item branch.
- python/packages/openai/tests/openai/test_openai_chat_client.py: four
new tests pin the contract (function_call, approval, local-shell-call
stripped under storage; everything kept without storage). Updated
pre-existing tests that exercised the storage-on path to either pass
request_uses_service_side_storage=False explicitly or assert the new
strip behavior.
- python/packages/foundry/tests/foundry/test_foundry_chat_client.py:
same explicit storage-off opt-in for the inherited test.
- python/packages/core/tests/workflow/test_full_conversation.py:
re-pointed xfail reason to #3295 and the executor-level follow-up.
Notes for next iteration:
- 3295-01 (HITL wire-format validation against live OpenAI/Foundry) was
not run; it requires the user's API credentials. The PRD design is
locked but the empirical confirmation is still pending. If script 3
fails on either provider, this slice may need to be revisited.
- 3295-03 (clear service_session_id in AgentExecutor on full-history
replay) remains open. After it lands the xfail in
test_full_conversation.py can be removed.
- pytest was not run in this iteration because uv-based pytest commands
required interactive approval. Validation rests on careful reading;
next iteration should run the openai + core test suites.