Skip to content

Update proxmox extension - add multiple servers support - #30125

Open
kzaoaai wants to merge 5 commits into
raycast:mainfrom
kzaoaai:proxmox-multiple-servers
Open

Update proxmox extension - add multiple servers support#30125
kzaoaai wants to merge 5 commits into
raycast:mainfrom
kzaoaai:proxmox-multiple-servers

Conversation

@kzaoaai

@kzaoaai kzaoaai commented Aug 10, 2026

Copy link
Copy Markdown

Description

Fixes #27260

Adds support for multiple Proxmox servers:

  • New Manage Servers command to add, edit or remove servers. Additional servers are stored in LocalStorage; the connection is verified on save (with the option to save anyway).
  • The existing preferences keep working unchanged as the first server. They are now optional instead of required, so nothing changes for current users and no migration is needed.
  • Manage VMs and Manage Storage fetch all configured servers and group the results into one section per server (single-server setups look exactly as before). An unreachable server shows a per-server error row instead of hiding the other servers' results.
  • VM actions and Open Dashboard use the server of the row they are triggered on.

Two small fixes that came out of this:

  • Fetch errors now surface error.cause (e.g. TLS or DNS problems) instead of Node's generic "fetch failed".
  • pveFetch now checks response.ok — before, a failed VM action (e.g. missing token permission) showed a success toast.

Note for review: token secrets of additional servers live in LocalStorage (the preference-based server keeps using the encrypted password preference). Happy to change this if there is a preferred pattern for multi-instance credentials.

Tested against three Proxmox VE 9 servers (one cluster + two standalone nodes) on macOS.

Screencast

Mock data, two servers configured:

Manage VMs Manage Storage
Manage VMs with two servers Manage Storage with two servers

Checklist

🤖 Generated with Claude Code

- New Manage Servers command (add/edit/remove servers, stored in LocalStorage)
- Existing preferences keep working unchanged as the first server (now optional)
- VM and storage lists aggregate all servers, one section per server, with
  per-server error rows so one unreachable server doesn't hide the others
- Surface fetch error causes instead of Node's generic "fetch failed"
- Check response.ok in pveFetch, failed VM actions no longer show success

Fixes raycast#27260

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: proxmox Issues related to the proxmox extension platform: macOS platform: Windows labels Aug 10, 2026
@raycastbot

Copy link
Copy Markdown
Collaborator

Thank you for your first contribution! 🎉

🔔 @CzBiX @xmok @j3lte you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

📋 Quick checkout commands
BRANCH="proxmox-multiple-servers"
FORK_URL="https://github.com/kzaoaai/extensions.git"
EXTENSION_NAME="proxmox"
REPO_NAME="extensions"

git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run dev

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days.

@greptile-apps

greptile-apps Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds multi-server Proxmox configuration and routes VM and storage operations through each resource’s originating server.

  • Stores additional servers under independent LocalStorage keys and migrates the legacy server array.
  • Adds server management, per-server resource sections, and isolated connection errors.
  • Uses server-specific credentials for API calls, actions, storage details, and dashboard links.
  • Surfaces HTTP failures and underlying fetch causes.

Confidence Score: 4/5

The PR does not yet appear safe to merge because overlapping mutations of the same server can silently lose an edit or recreate a server after deletion.

Per-server storage fixes cross-server array replacement, but updateServer still performs an unguarded read followed by a blind write while removeServer independently deletes the same key, leaving the previously reported mutation race reachable.

Files Needing Attention: extensions/proxmox/src/utils/servers.ts, extensions/proxmox/src/screens/ManageServers.tsx

Important Files Changed

Filename Overview
extensions/proxmox/src/utils/servers.ts Per-server keys prevent unrelated server mutations from replacing the whole list, but same-server update/remove races remain possible.
extensions/proxmox/src/screens/ManageServers.tsx Adds management actions and editable server snapshots that feed the remaining same-server race.
extensions/proxmox/src/hooks/use-multi-pve-fetch.ts Fetches each configured server independently and retains per-server failures.
extensions/proxmox/src/api/index.ts Routes requests through explicit server credentials and rejects non-success HTTP responses.
extensions/proxmox/src/index.tsx Groups VMs by server and binds actions to each VM’s source server.
extensions/proxmox/src/storage.tsx Groups storage resources by server and preserves server context for detail and content requests.

Reviews (4): Last reviewed commit: "Store each server under its own key inst..." | Re-trigger Greptile

Comment thread extensions/proxmox/src/utils/servers.ts
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@kzaoaai
kzaoaai marked this pull request as ready for review August 10, 2026 21:03
…changes

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
const { servers, isLoading: isLoadingServers } = useServers();

// Serialized so the promise re-executes exactly when the server list changes
const serversKey = JSON.stringify(servers);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

usePromise already deep-compares its args array, no re-serialize needed

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

you're right. The servers array is now passed straight through.

Comment on lines +26 to +27
const result = usePromise(
async (key: string): Promise<PveServerResult<T>[]> => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should passthrough abortable signal

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

abortable is now passed to usePromise and its signal forwarded to every request. One detail worth flagging: the per-server catch rethrows AbortError instead of turning it into a result, otherwise a superseded revalidation renders as a "Connection Failed" row for that server.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Comment thread extensions/proxmox/src/utils/servers.ts Outdated
Replaces the whole-array read-modify-write, so concurrent add, edit or
remove operations can no longer discard each other. Existing
configurations are migrated on the first read.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@kzaoaai

kzaoaai commented Aug 12, 2026

Copy link
Copy Markdown
Author

Thanks for the review, both points are addressed:

  • Args deep-compare — you're right, usePromise already compares its args with dequal, so the serialized key was doing work the hook does itself. The servers array is now passed straight through.
  • Abort signalabortable is now passed to usePromise and its signal forwarded to every request. One detail worth flagging: the per-server catch rethrows AbortError instead of turning it into a result, otherwise a superseded revalidation renders as a "Connection Failed" row for that server.

I also changed how servers are stored while I was in there: each server now lives under its own LocalStorage key instead of all of them in one array, so add/edit/remove no longer rewrite each other's entries (this was the lost-update path the review bot flagged). Existing configurations are migrated on the first read, keeping their original order.

Tested against three PVE 9 servers (one cluster plus two standalone nodes): list, per-server sections, storage contents, and the VM actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extension fix / improvement Label for PRs with extension's fix improvements extension: proxmox Issues related to the proxmox extension platform: macOS platform: Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Proxmox] Allow multiple hosts

3 participants