Skip to content

Add private model catalog SDK support (AddCatalog, SelectCatalog, GetCatalogNames)#601

Open
kobby-kobbs wants to merge 6 commits intomainfrom
emmanuel/privatecatalog
Open

Add private model catalog SDK support (AddCatalog, SelectCatalog, GetCatalogNames)#601
kobby-kobbs wants to merge 6 commits intomainfrom
emmanuel/privatecatalog

Conversation

@kobby-kobbs
Copy link
Copy Markdown

Summary

  • Adds SDK support for registering and managing private model catalogs (MDS integration)
  • Exposes three new async methods on ICatalog: AddCatalogAsync, SelectCatalogAsync, GetCatalogNamesAsync
  • Removes logging of command input to prevent leaking credentials in debug logs

Changes by file

sdk/cs/src/ICatalog.cs

Adds three new interface methods with full XML documentation:

  • AddCatalogAsync — Register a private catalog with OAuth2/bearer auth support
  • SelectCatalogAsync — Filter models to a specific catalog (or null to show all)
  • GetCatalogNamesAsync — List all registered catalog names

sdk/cs/src/Catalog.cs

Implements the three new methods with:

  • Input validation (URI scheme check, token endpoint URL validation, null/whitespace guards)
  • forceRefresh parameter on UpdateModels so Add/Select immediately refresh the model list
  • Null-safe deserialization in GetCatalogNamesAsync

sdk/cs/src/Detail/CoreInterop.cs

Removes logging of commandInput in error paths to prevent leaking credentials (client secrets, bearer tokens) in debug logs.

sdk/cs/src/Detail/JsonSerializationContext.cs

Registers List<string> for AOT-compatible JSON serialization of catalog names.

sdk/cs/test/FoundryLocal.Tests/CatalogManagementTests.cs

New test class with two tests:

  • Test_AddAndSelectCatalog — Verifies add + select + reset flow
  • Test_GetCatalogNames — Verifies catalog name retrieval and deserialization

Copilot AI review requested due to automatic review settings April 6, 2026 23:19
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
foundry-local Ready Ready Preview, Comment Apr 9, 2026 7:57am

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds C# SDK support for managing private model catalogs (MDS integration) by extending the catalog API surface, implementing the new interop commands, and adding tests—while also reducing the risk of credential leakage in logs.

Changes:

  • Extends ICatalog with AddCatalogAsync, SelectCatalogAsync, and GetCatalogNamesAsync.
  • Implements the new catalog-management commands in Catalog, including forced refresh behavior.
  • Removes logging of command input in CoreInterop error paths and adds AOT JSON context for List<string>.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
sdk/cs/src/ICatalog.cs Adds new public async catalog-management methods to the catalog interface.
sdk/cs/src/Catalog.cs Implements add/select/list catalog operations and introduces a forceRefresh option for model updates.
sdk/cs/src/Detail/CoreInterop.cs Stops logging command input in error paths to avoid leaking secrets.
sdk/cs/src/Detail/JsonSerializationContext.cs Registers List<string> for source-generated JSON serialization (AOT).
sdk/cs/test/FoundryLocal.Tests/CatalogManagementTests.cs Adds tests covering add/select/reset and catalog name listing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

4 participants