Skip to content

Fix Reset button to restore default API host instead of clearing#1183

Merged
bytecii merged 2 commits intomainfrom
copilot/fix-api-host-setting-reset
Feb 17, 2026
Merged

Fix Reset button to restore default API host instead of clearing#1183
bytecii merged 2 commits intomainfrom
copilot/fix-api-host-setting-reset

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 8, 2026

Reset button in model configuration was clearing the API Host field. Now restores provider default.

Changes

  • src/pages/Setting/Models.tsx: Modified handleDelete to restore item.apiHost from INIT_PROVODERS instead of empty string
// Before
return {
  apiKey: '',
  apiHost: '',  // ❌ Cleared field
  // ...
};

// After  
return {
  apiKey: '',
  apiHost: item.apiHost,  // ✅ Restores default (e.g., https://api.anthropic.com/v1/)
  // ...
};

Applies to all providers: Anthropic, OpenAI, Gemini, OpenRouter, Qwen, DeepSeek, etc.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature Request] Reset clears API Host Setting instead of restoring default value</issue_title>
<issue_description>### Motivation

When a user clicks Reset on a model configuration, the API Host Setting field becomes empty. It should be automatically restored to the default API host for that provider (pre-filled), rather than blank.

Image

Solution

No response

Alternatives

No response

Additional context

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix reset functionality to restore default API host value Fix Reset button to restore default API host instead of clearing Feb 8, 2026
Copilot AI requested a review from lightaime February 8, 2026 02:29
@Pakchoioioi Pakchoioioi self-requested a review February 8, 2026 17:54
@Pakchoioioi Pakchoioioi marked this pull request as ready for review February 8, 2026 17:55
@Pakchoioioi
Copy link
Copy Markdown
Contributor

have tested it, this issue has been fixed.

@Pakchoioioi Pakchoioioi requested review from bytecii and removed request for lightaime February 17, 2026 01:04
@bytecii bytecii force-pushed the copilot/fix-api-host-setting-reset branch from 57f3601 to 8b00905 Compare February 17, 2026 23:19
@bytecii bytecii merged commit f93643e into main Feb 17, 2026
8 checks passed
@bytecii bytecii deleted the copilot/fix-api-host-setting-reset branch February 17, 2026 23:34
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.

[Feature Request] Reset clears API Host Setting instead of restoring default value

4 participants