Skip to content

Python: Restore DevUI context provider metadata - #8992

Open
dhairya (dhairyajangir) wants to merge 9 commits into
microsoft:mainfrom
dhairyajangir:fix/devui-context-provider-metadata
Open

dhairya (dhairyajangir) wants to merge 9 commits into
microsoft:mainfrom
dhairyajangir:fix/devui-context-provider-metadata

Conversation

@dhairyajangir

@dhairyajangir dhairya (dhairyajangir) commented Oct 2, 2026 •

Copy link
Copy Markdown

Motivation & Context

DevUI hid configured context providers from agent details because its metadata helper read the obsolete singular attribute. Current Agent instances expose a context_providers list, so both registration and directory discovery returned an empty provider field.

Description & Review Guide

  • What are the major changes? Read names from the current context_providers list before using the existing singular fallback. Add discovery regressions for zero, one, and multiple providers, plus a compatibility test for older agent-like objects. Type the frontend provider field as string[], render names with explicit comma separation, and update the packaged UI.
  • What is the impact of these changes? Configured providers appear in metadata in their configured order and remain distinguishable in the agent-details modal. The existing context_provider response field and behavior for agent-like objects with the singular attribute remain compatible.
  • What do you want reviewers to focus on? Provider ordering, preservation of the existing metadata shape and singular fallback, and the real API-to-modal rendering regression.

Implementation and independent review were AI-assisted. Backend validation: The new one- and two-provider tests fail before the fix and pass afterward; all 12 discovery tests pass. Package Ruff, changed-file formatting, strict source Pyright, test mypy/Pyright/Pyrefly/ty, changed-test Zuban, and source/wheel builds pass. The package suite has 203 passing tests and four skips, with one browser-memory test failing during process cleanup (PermissionError); the same failure occurs on the original code. Full-package Zuban reports the same six errors in three unchanged test files on both versions. No live-service integration tests were run.

Frontend validation: all 3 new API-to-modal render tests, 13 existing tracing tests, TypeScript/Vite build, and changed-file hooks pass. The multi-provider test fails on the previous implementation, while single-provider and absent-provider controls pass. Frontend lint exits 0 with the same 13 warnings reproduced on the prior head; the no-warnings checklist item remains unchecked. The published source and packaged renderer match the independently reviewed files.

Related Issue

Fixes #8989

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Refactor context provider retrieval to use the walrus operator for cleaner code.
Added tests for context providers in agent metadata and legacy support.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@eavanvalkenburg

Copy link
Copy Markdown
Member

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAF Automated Review — Iteration 1

Result: Findings reported
Scope: full PR (2 commit(s)): 43c0694899a3, c86050e53c5e
Model: gpt-5.6-sol

Overview

The change correctly reads the ordered context_providers list while preserving the singular compatibility fallback, and its backend tests cover zero, one, and multiple providers. The backend response model already accepts the resulting list, but the multi-provider case exposes an unresolved frontend contract mismatch that renders provider names without separation.

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/devui/agent_framework_devui/_utils.py

Comment thread python/packages/devui/agent_framework_devui/_utils.py
@dhairyajangir

Copy link
Copy Markdown
Author

Eduard van Valkenburg (@eavanvalkenburg) the branch is now updated with main at e80552d. I revalidated the reviewed fix after that merge: all seven PR files and the diff against the updated base are unchanged, all 3 API-to-modal rendering tests pass, and all 12 discovery tests pass with both core and DevUI loaded from this new head.

The provider-name finding is addressed in the earlier revision reply. The current head has 7 workflows awaiting maintainer approval. Could you authorize CI and revisit that finding when convenient?

This revalidation and follow-up were AI-assisted. The checks above are focused local tests; they do not replace the pending upstream CI or code-owner review.

Use the existing BaseChatClient fixture so the metadata regression satisfies the overloaded response protocol. Assertions and production code are unchanged.
@dhairyajangir

Copy link
Copy Markdown
Author

Fixed the executed Test Typing Checks failure in 160783f. The discovery regression now uses the existing mock_base_chat_client, which implements the required streaming/non-streaming response protocol. Only the fixture parameter and client argument changed; production code and assertions are unchanged.

Validation on Python 3.11.17:

  • Reproduced the original Zuban error before the fix.
  • All five DevUI test-typing checks pass: Mypy, Pyright, Pyrefly, ty and Zuban.
  • All 12 discovery tests and changed-file Ruff lint/format pass.
  • Independent metadata checks preserve provider order and make zero model calls. The published whole tree matches the reviewed tree.

The broader local DevUI run on the same candidate tree recorded 203 passed, four skipped and one browser-memory test failure with timeout/cleanup errors; I am not claiming a complete-suite pass. New-head upstream CI and maintainer review remain pending. Could you revisit the PR after those checks run?

@dhairyajangir

Copy link
Copy Markdown
Author

The newly executed checks at 160783f7 confirm that Test Typing Checks (3.11) passes after the fixture correction.

The remaining Python 3.13 / Windows failure is TestFileHistoryProvider.test_concurrent_writes_for_same_session_are_locked: its initial one-second write_started.wait returns false before the second write is scheduled. That job reports 18,193 passed, 37 skipped, two xfailed and one failed. The merge gate identifies the same failing check. The other ten Python version/OS matrix jobs pass.

Both python/packages/core/tests/core/test_sessions.py and python/packages/core/agent_framework/_sessions.py are byte-identical at this PR head, its merge base 2df61296, and current main c2c8d364; this PR changes neither file. This does not establish the cause, and I have not reproduced the failure on a Windows runner. No timeout, assertion or CI gate has been changed.

Could you rerun the failed Windows job to check whether the startup failure recurs? If it does, its new log should help determine the next investigation separately from this DevUI metadata change.

@eavanvalkenburg

Copy link
Copy Markdown
Member

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAF Automated Review — Iteration 2

Result: No findings
Scope: 21 net-new commit(s): 735050553822, 3c2fe0a8a365, d7ef9e240836, 90615858cbf0, de3a3b08df5b, cdd339b0a541, 4dfb7565b67e, 301a43c862be, 2606b1a0498a, 5bba4cec7380, ccf44d95988b, 6574f75ba0e2, 4cd858d17941, 3a2a8c964068, 0e1e6ffa8817, fdb7ec343398, 52fed574f05a, 6ef0b73ed8ee, 2df61296bb56, e80552d9e6e4, 160783f7d529
Model: gpt-5.6-sol

Overview

This incremental range resolves the previous frontend contract mismatch by typing context providers as an ordered string list and rendering names with explicit separators. Backend discovery, legacy fallback, API forwarding, source UI, and packaged UI remain aligned, with regressions covering absent, single, and multiple providers. The final fixture correction uses the protocol-compatible chat client expected by Agent; no publishable Critical, High, or Medium issue remains.

Reviewed the supplied incremental change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.

This branch was previously deployed

1 inactive deployment
github-app-auth — 160783f7 Deployed Oct 8, 2026 by dhairyajangir via add_label #24748
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: [Bug]: DevUI discovery omits configured context providers

3 participants