Skip to content

Advanced Paste: Foundry Local returns 400 Bad Request despite model being loaded and workingΒ #45340

@dc995

Description

@dc995

Microsoft PowerToys version

0.97.1

Installation method

WinGet

Area(s) with issue?

Advanced Paste

Steps to reproduce

  1. Install Foundry Local (v0.8.119): winget install Microsoft.FoundryLocal
  2. Download model: foundry model download qwen2.5-0.5b
  3. Set fixed port: foundry service set --port 5273
  4. Verify service running: foundry service status shows "🟒 Service is Started on http://127.0.0.1:5273/"
  5. Verify model loaded: foundry service ps shows "🟒 qwen2.5-0.5b"
  6. In PowerToys Settings β†’ Advanced Paste β†’ Add Foundry Local provider with model: qwen2.5-0.5b-instruct-openvino-npu:3
  7. Copy any text to clipboard (e.g., a URL)
  8. Press Win+Shift+V to open Advanced Paste
  9. Select any AI action (e.g., custom action or "Paste with AI")
  10. Error appears: "Failed to generate response using Foundry Local"

Direct API test succeeds:
curl -X POST http://127.0.0.1:5273/v1/chat/completions -H "Content-Type: application/json" -d '{"model": "qwen2.5-0.5b-instruct-openvino-npu:3", "messages": [{"role": "user", "content": "Hello"}]}'
Returns: 200 OK with valid response

βœ”οΈ Expected Behavior

Advanced Paste should successfully call the Foundry Local model and return AI-generated paste content.

❌ Actual Behavior

400 Bad Request error. PowerToys log shows:
[FoundryLocal] Creating OpenAI client with endpoint: http://127.0.0.1:5273/v1
CustomActionTransformService.TransformAsync failed
AdvancedPaste.Models.PasteActionException: Failed to generate response using Foundry Local (Model: qwen2.5-0.5b-instruct-openvino-npu:3)
Inner exception: System.ClientModel.ClientResultException: Service request failed. Status: 400 (Bad Request)

Additional Information

OS: Windows 11 24H2
Foundry Local Version: 0.8.119
Model: qwen2.5-0.5b-instruct-openvino-npu:3 (Intel NPU via OpenVINO)
Fixed Port: 5273
Hardware: Intel NPU with OpenVINO ExecutionProvider

The model loads successfully and direct REST API calls work. The issue appears to be in how PowerToys formats or sends the chat completion request to Foundry Local.

Other Software

Foundry Local 0.8.119
Model: qwen2.5-0.5b-instruct-openvino-npu:3

Metadata

Metadata

Assignees

Labels

Issue-BugSomething isn't workingNeeds-TriageFor issues raised to be triaged and prioritized by internal Microsoft teamsProduct-Advanced PasteRefers to the Advanced Paste module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions