feat(openclaw): add additive mode frontend support

- Add getOpenClawLiveProviderIds() API for querying live config
- Update ProviderList to query OpenClaw live IDs
- Rename isOpenCodeMode to isAdditiveMode (covers OpenCode + OpenClaw)
- Update ProviderCard shouldAutoQuery and isActiveProvider logic
- Update App.tsx onRemoveFromConfig and invalidateQueries for OpenClaw
This commit is contained in:
Jason
2026-02-05 15:25:33 +08:00
parent 47f2c47a2f
commit 715e9e89c4
5 changed files with 57 additions and 14 deletions
+13 -4
View File
@@ -425,10 +425,19 @@ function App() {
const { provider, action } = confirmAction;
if (action === "remove") {
// Remove from live config only (for additive mode apps like OpenCode/OpenClaw)
// Does NOT delete from database - provider remains in the list
await providersApi.removeFromLiveConfig(provider.id, activeApp);
await queryClient.invalidateQueries({
queryKey: ["opencodeLiveProviderIds"],
});
// Invalidate queries to refresh the isInConfig state
if (activeApp === "opencode") {
await queryClient.invalidateQueries({
queryKey: ["opencodeLiveProviderIds"],
});
} else if (activeApp === "openclaw") {
await queryClient.invalidateQueries({
queryKey: ["openclawLiveProviderIds"],
});
}
toast.success(
t("notifications.removeFromConfigSuccess", {
defaultValue: "已从配置移除",
@@ -642,7 +651,7 @@ function App() {
setConfirmAction({ provider, action: "delete" })
}
onRemoveFromConfig={
activeApp === "opencode"
activeApp === "opencode" || activeApp === "openclaw"
? (provider) =>
setConfirmAction({ provider, action: "remove" })
: undefined