Skip to content

Use direct-symbol imports for embeddings/query/podcast in mcp/server.py - #304

Merged
Bernhard Merkle (bmerkle) merged 1 commit into
microsoft:mainfrom
bmerkle:fix-import-style-mcpserver
Sep 28, 2026
Merged

Bernhard Merkle (bmerkle) merged 1 commit into
microsoft:mainfrom
bmerkle:fix-import-style-mcpserver

Conversation

@bmerkle

Copy link
Copy Markdown
Collaborator

Summary

  • mcp/server.py was the lone qualified-import user for three low-symbol modules where every other consumer in the codebase uses direct-symbol import:
    • aitools.embeddings.IEmbeddingModel (vs. 21 files using direct import)
    • knowpro.query.QueryEvalContext (vs. 2 files: search.py, storage/memory/reltermsindex.py)
    • podcasts.podcast.PodcastMessage/Podcast (vs. podcast_ingest.py)
  • Brings this file in line with the prevailing, already-consistent convention for these modules.
  • Found via a whole-project import-style scan (not part of the original 7 families in Code Quality & Cleanup (from TODO.md) #112's audit comment) — tracked in Standardize import style (module-qualified vs direct-symbol) across the codebase #298.

Test plan

  • make (format, check on 3.12/3.14, test, build) — 0 pyright errors, 737 passed / 12 skipped, wheel builds

Copilot AI review requested due to automatic review settings August 1, 2026 16:23

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.

Pull request overview

Aligns src/typeagent/mcp/server.py with the codebase’s prevailing import-style for a few low-symbol, class-centric modules by switching from module-qualified imports to direct-symbol imports, improving readability and consistency with other consumers.

Changes:

  • Replace typeagent.aitools.embeddings qualified usage with direct import of IEmbeddingModel.
  • Replace typeagent.knowpro.query qualified usage with direct import of QueryEvalContext.
  • Replace typeagent.podcasts.podcast qualified usage with direct imports of Podcast and PodcastMessage.

@bmerkle

Copy link
Copy Markdown
Collaborator Author

robgruen would you mind taking a look at this one when you get a chance? Thanks!

mcp/server.py was the lone qualified-import user for these low-symbol
modules while every other consumer imports them directly:
- aitools.embeddings.IEmbeddingModel (vs. 21 files using direct import)
- knowpro.query.QueryEvalContext (vs. 2 files)
- podcasts.podcast.PodcastMessage/Podcast (vs. podcast_ingest.py)

Brings this file in line with the prevailing convention for these
modules. Found via a whole-project import-style scan, tracked in
microsoft#298.
@bmerkle

Copy link
Copy Markdown
Collaborator Author

robgruen rebased onto main — no conflicts. make passes (0 pyright errors, 756 tests, build OK). Ready for your review.

@bmerkle
Bernhard Merkle (bmerkle) merged commit c51c81e into microsoft:main Sep 28, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants