Repository navigation
Conversation
ranm-msft
left a comment
There was a problem hiding this comment.
Holding approval for two agreement-consent paths.
- Fail closed when source agreement state cannot be read.
- Present the complete terms for text-only agreements.
| // Reading the agreements requires contacting the source. Rather than turn a transient | ||
| // failure into a confusing agreement error, use the catalog and let connecting to it | ||
| // report the actual problem. | ||
| selection.Included.Add(catalog); |
There was a problem hiding this comment.
This fails open on agreement-state retrieval: a transient information-endpoint failure adds the catalog, Connect retries the same REST reference, and AcceptSourceAgreements defaults true, so the recovered source can be searched or installed from without presenting its agreements. Please fail or exclude this source until its agreement state can be read successfully.
| if (agreement.Text.Length > MaximumAgreementTextLength) | ||
| { | ||
| // The full text remains available at the URL, which follows when present. | ||
| message.Append(agreement.Text, 0, MaximumAgreementTextLength); |
There was a problem hiding this comment.
This can let the user accept a valid text-only agreement after seeing only its first 2,000 characters; agreement text may be 10,000 characters and the URL is optional, while accepted elicitation proceeds without invoking the full-text fallback. Please only truncate when the complete terms remain accessible, or present the full text before accepting.
ranm-msft
left a comment
There was a problem hiding this comment.
The source-agreement tests need deterministic cleanup before I can sign off.
| [TearDown] | ||
| public void TearDown() | ||
| { | ||
| CleanupTestPackages(); |
There was a problem hiding this comment.
Both x64 and x86 CI time out here after SourceAgreements_Elicitation_Declined leaves TestMCPAgreementsRestSource installed with changed, unaccepted agreements. Because agreementsSource.Remove() follows CleanupTestPackages() in both teardown and setup, the first uninstall timeout prevents source removal and later agreement cases repeat the timeout during setup. Remove the agreement source before running winget uninstall, and ensure source removal still runs if package cleanup throws.
📖 Description
Expose source agreement state through COM and leverage it in the MCP server to handle source and package agreements.
This leverages elicitation when available, which allows the server to ask the user to make a decision directly. When not available, unaccepted agreements are simply returned as a response so that the agent can present them / submit a new tool call with the agreements field set to
true.🔍 Validation
Add tests for the COM interface additions and MCP server tests.
Microsoft Reviewers: Open in CodeFlow