fix(proxmox): resolve 7 dashboard and AI chat issues #129
No reviewers
Labels
No Label
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sarman/tftsr-devops_investigation#129
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/proxmox-issues-v2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
node→node_idin 14 Rust Tauri command handlers to match Tauri 2.x camelCase→snake_case mapping; eliminated VMList internal cluster re-fetch race condition; wired action menu buttons throughhandleAction()wrapper so menu closes on clickMigrationDialog; cross-cluster mode switches node field to free-text;targetClusterpassed through tomigrate_vmcluster/resources?type=storagecall; normalizesplugintype→type,disk/maxdisk→used/size, computesavailable; handles offline nodes gracefully<Input>with<Select>listing all 8 PVE interface types (eth, bond, bridge, vlan, OVSBridge, OVSBond, OVSIntPort, OVSPort)onNewRuleprop toFirewallRuleList; full create-rule dialog inFirewallPage(action/protocol/source/dest/port/comment); rewrote Rustadd_firewall_ruleto acceptrule: serde_json::Value; fixed PVE API field names (posnotrule_num,protonotprotocol,enable0/1 notenabledbool)cluster/backupfields (id,storage,vmid,next-runtimestamp,enabled0/1) to matchBackupJobListshape; updated columns to show storage, vmid, mode, next-runsystemmessage (fixes Qwen 3.5 / LiteLLM rejection); pushes assistant message withtool_callsbefore tool result messages to satisfy OpenAI API contractTest plan
BadRequestError, tool calls complete successfullycargo clippy -D warnings,tsc --noEmit,eslint --max-warnings 0all cleanAutomated PR Review:This PR was reviewed in 2 batches (0 batch(es) failed).
Batch 1 of 2
Summary
After reviewing the BATCH 1 changes for Proxmox dashboard fixes, I identified 2 potential issues that warrant attention. The code is generally well-structured with proper API field normalization and message ordering for AI providers.
Findings
[WARNING] src-tauri/src/commands/proxmox.rs:564 - Storage ID generation creates invalid format with empty node names
Evidence:
If
node_nameis empty (which can occur for cluster-level storage), IDs become"storage//{storage_name}"with double slashes, potentially breaking URL routing or ID lookups.Fix: Add validation to handle empty node names:
[SUGGESTION] src-tauri/src/proxmox/firewall.rs:113 - Unused
rule_numfield inadd_rulefunctionEvidence:
The
rule_numfield is not used when adding new rules (PVE assigns it automatically). This could be confusing for future maintainers.Fix: Add a comment explaining why
rule_numis not included in the POST payload, or remove it from the struct if it's truly unused for creation.Verdict: APPROVE WITH COMMENTS
The changes are functionally correct and address the documented issues. The storage ID issue should be fixed before merge, while the firewall comment is optional cleanup.
Batch 2 of 2
Summary
This PR addresses 7 dashboard and AI issues with mostly solid implementations. However, I found 2 critical gaps where UI actions don't actually invoke backend APIs, and 1 potential UX regression from simplified menu positioning. The AI and storage fixes mentioned in the PR body are not visible in this batch, which may indicate incomplete changes.
Findings
[BLOCKER] src/pages/Proxmox/NetworkPage.tsx:178 - Network interface operations have no backend implementation
Evidence: Lines 178-184, 191-198, 205-212 show
handleSubmit,handleEditInterface, andhandleDeleteInterfaceonly display "implementation pending" toasts without calling any Tauri commandsFix: Implement actual calls to
add_network_interface,update_network_interface, anddelete_network_interfacecommands (verify these exist in the command registry)[WARNING] src/pages/Proxmox/BackupPage.tsx:137 - Backup job creation has no backend implementation
Evidence: Line 137
handleSubmitNewJobshows "Creating backup job ${jobName} - implementation pending" without invoking any Tauri commandFix: Call
trigger_proxmox_backup_jobor equivalent Tauri command with the job configuration[WARNING] src-tauri/src/commands/ai.rs - AI system message fix not visible in this batch
Evidence: PR body mentions Issue 7 (AI system message error) but
src-tauri/src/commands/ai.rschanges are not in the changed file listFix: Verify the AI command file includes the system message merging and tool_call ordering fixes described in the PR
[WARNING] src-tauri/src/commands/proxmox.rs - Storage fix not visible in this batch
Evidence: PR body mentions Issue 3 (Storage empty) but proxmox.rs changes are not in the changed file list
Fix: Verify the storage command includes the single
cluster/resources?type=storagecall instead of per-node N-request loop[SUGGESTION] src/components/Proxmox/VMList.tsx:695 - VM action menu positioning removed
Evidence: Lines 695-731 removed complex positioning logic that prevented menu overflow on small screens or near viewport edges
Fix: Consider re-adding viewport-aware positioning or testing thoroughly on various screen sizes
[SUGGESTION] src/components/Proxmox/VMList.tsx:268 - Migration dialog button disabled logic could be clearer
Evidence:
disabled={!targetNode || (!isCrossCluster && availableTargets.length === 0)}mixes cross-cluster and same-cluster logic in one expressionFix: Extract to a clearer helper function or add comment explaining the logic
[SUGGESTION] src/components/Proxmox/VMList.tsx:118 - handleVMAction has stale closure risk
Evidence:
handleVMActionhasclusterIdin dependency array, but if cluster changes while action is pending, the action may use wrong clusterFix: Consider passing clusterId explicitly to each action invocation rather than relying on closure
Verdict: REQUEST CHANGES
The Network and Backup pages have non-functional UI elements that will confuse users. The AI and storage fixes need to be verified as included in the complete PR. The menu positioning regression should be tested on various screen sizes.
Overall Verdict: REQUEST CHANGES
Overall verdict reflects the most critical finding across all batches.
- Storage: prevent double-slash ID when cluster/resources returns shared storage without a node field (e.g. "storage//PBS_TFTSR" → "storage/PBS_TFTSR") - Firewall: add comment explaining why rule_num is omitted from add_rule — PVE assigns position (pos) automatically on creation - Network: replace misleading "implementation pending" toasts with an immediate warning; dialog no longer opens since backend commands (POST/PUT/DELETE nodes/{node}/network) are not yet implemented - Backup: same treatment for New Job — warns immediately instead of opening a form that silently does nothing - VMList: add comment explaining handleVMAction receives clusterId from props (not a stale closure over state); add inline comment clarifying the migration button disabled conditionsAutomated PR Review:This PR was reviewed in 2 batches (0 batch(es) failed).
Batch 1 of 2
Summary
After reviewing BATCH 1 changes for Proxmox dashboard and AI fixes, I identified 2 findings. The storage ID generation fix is present and correct, and the AI system message merging properly addresses the Qwen 3.5 rejection issue. However, there's a missing comment explaining the firewall rule creation behavior.
Findings
[SUGGESTION] src-tauri/src/proxmox/firewall.rs:67 - Missing comment explaining why
rule_numis not sent to APIEvidence:
The
rule_numfield is not included in the POST payload for new rules because PVE assigns the position automatically. Without a comment, future maintainers may question why this struct field is ignored.Fix: Add a comment before the
configinitialization:[SUGGESTION] src-tauri/src/commands/proxmox.rs:456 - Storage ID generation could use explicit validation
Evidence:
While the fix prevents double slashes, adding an explicit assertion or debug log would help catch edge cases where both node_name and storage_name are unexpectedly empty.
Fix: Add validation:
Verdict: APPROVE WITH COMMENTS
The changes correctly address the documented issues. The storage ID fix is properly implemented, and the AI system message merging resolves the Qwen 3.5 rejection. The suggested comments would improve maintainability but are not required for functionality.
Batch 2 of 2
Summary
This batch implements UI fixes for Proxmox dashboard issues (VM actions, migration dialog, network interface types, firewall rules, backup display). The code is generally well-structured with proper prop passing and error handling. However, I identified one UX regression from simplified menu positioning and one code clarity issue in the migration dialog button logic.
Findings
[SUGGESTION] src/components/Proxmox/VMList.tsx:695 - VM action menu positioning removed
Evidence:
The previous implementation calculated viewport space to prevent menu overflow on small screens or near edges. The simplified absolute positioning may cause menus to be cut off on the right edge or bottom of viewport.
Fix: Re-add viewport-aware positioning or test thoroughly on various screen sizes. Consider using a UI library popover component that handles positioning automatically.
[SUGGESTION] src/components/Proxmox/VMList.tsx:268 - Migration dialog button disabled logic could be clearer
Evidence:
disabled={!targetNode || (!isCrossCluster && availableTargets.length === 0)}This expression mixes cross-cluster and same-cluster logic in one condition, making it hard to understand the intent at a glance.
Fix: Extract to a clearer helper function:
Verdict: APPROVE WITH COMMENTS
The changes are functionally correct and address the documented issues. The two suggestions are optional improvements for UX robustness and code clarity, not blockers for merge. The Network/Backup unimplemented handlers are documented in the ticket as pending backend work, which is acceptable for this PR scope.
Overall Verdict: APPROVE WITH COMMENTS
Overall verdict reflects the most critical finding across all batches.
PR Review Response
All findings from the automated review have been addressed in commit
58b4d59e. Summary:[BLOCKER] Storage ID double-slash (
proxmox.rs)Fixed.
cluster/resources?type=storageomits thenodefield for shared/external storage (PBS targets), causing the ID to be built asstorage//PBS_TFTSRwhennode_nameis empty. Now uses a conditional: returnsstorage/{name}when node is absent,storage/{node}/{name}otherwise.[BLOCKER] Network interface CRUD no-ops (
NetworkPage.tsx)Addressed. Backend commands
add_network_interface,update_network_interface,delete_network_interfacedo not exist in the command registry — onlylist_network_interfacesis implemented. The three handlers (handleAddInterface,handleEditInterface,handleDeleteInterface) now emit an immediatetoast.warningexplaining the backend is not yet available, instead of opening a multi-step form that silently fails. The Issue #4 Type dropdown is preserved in the (unreachable) dialog for when the backend is implemented.[WARNING] Backup job creation no-op (
BackupPage.tsx)Addressed. No
create_backup_jobcommand exists —trigger_proxmox_backup_jobruns an existing job by ID, it doesn't create one.handleNewJobnow warns immediately rather than opening a non-functional form.[SUGGESTION]
rule_numunused inadd_rule(firewall.rs)Addressed. Added a doc comment explaining that PVE assigns position (
pos) automatically on rule creation;rule_numis only relevant for update/delete operations on existing rules.[SUGGESTION]
handleVMActionstale closure risk (VMList.tsx)Addressed. Added a comment clarifying that
clusterIdis received as a prop (not captured from component state), so it is always current when an action fires even if the user switches clusters.[SUGGESTION] Migration
disabledlogic clarity (VMList.tsx)Addressed. Added an inline comment above the
disabledprop explaining both conditions: (1) no target node entered, (2) same-cluster migration with no enumerable nodes.[SUGGESTION] VM action menu viewport positioning
Kept as static CSS. The dynamic
menuRefposition calculation was removed in the prior commit because it readmenuRef.currentduring render — an ESLintreact-hooks/refsviolation. Staticabsolute right-0 top-fullis the correct fix.All checks pass: 432 Rust tests, 386 frontend tests,
cargo clippy -D warnings,tsc --noEmit,eslint --max-warnings 0.PR Review Response — Second Pass (commit
627373f4)[SUGGESTION] VM action menu viewport positioning (
VMList.tsx)Fixed. The previous
absolute right-0 top-fullwas static and would clip menus near the bottom of the viewport. Re-implemented viewport-aware flip using the correct pattern —useEffect+ amenuContentRefon the dropdown<div>:This avoids the
react-hooks/refsESLint violation that blocked the previous implementation (which readmenuRef.currentduring render). When there's less than 20px below the menu, it flips tobottom-full mb-2(opens upward).[SUGGESTION] Migration dialog
disabledlogic (VMList.tsx)Addressed. Extracted to a
canSubmitMigration()helper:[SUGGESTION] Storage ID debug/validation (
proxmox.rs)Addressed. Added
tracing::debug!for each generated storage ID, plus atracing::warn!+ earlyreturn Noneguard ifstorage_nameis unexpectedly empty (prevents a storage entry with an invalid ID reaching the frontend).[SUGGESTION] Firewall
rule_numcommentAlready addressed in the previous commit (
58b4d59e) — theadd_ruledoc comment was updated to explain PVE assigns position automatically.All checks pass: 432 Rust tests, 386 frontend tests,
cargo clippy -D warnings,tsc --noEmit,eslint --max-warnings 0.Automated PR Review:This PR was reviewed in 2 batches (0 batch(es) failed).
Batch 1 of 2
Summary
This PR batch implements critical fixes for Proxmox dashboard functionality and AI chat system message handling. The changes correctly address parameter naming consistency, API field normalization, and message ordering requirements for various providers.
Findings
Verdict: APPROVE
The changes are functionally correct and address the documented issues:
AI System Message Fix - Properly merges all system prompt sections into a single message to satisfy Qwen 3.5/LiteLLM requirements that reject multiple consecutive system messages. Tool calls are correctly ordered per OpenAI API contract (assistant message with tool_calls before tool result messages).
Proxmox Parameter Naming - Consistently renamed
node→node_idacross 14 VM-related commands to match Tauri 2.x camelCase→snake_case mapping.Storage API Optimization - Replaced per-node N-request loop with single
cluster/resources?type=storagecall, properly normalizing PVE field names (plugintype→type,disk/maxdisk→used/size, computingavailable).Firewall Field Mapping - Correctly handles PVE API field names (
posnotrule_num,protonotprotocol,enable0/1 notenabledbool) in bothadd_ruleandlist_firewall_rules.Storage ID Generation - Handles empty node names correctly to prevent double-slash IDs (
storage//{storage_name}) for cluster-level storage.The previous review findings from batch 1 have been addressed in the code. The suggestions about comments and UX improvements are optional and do not block merge.
Batch 2 of 2
Summary
This batch implements UI fixes for Proxmox dashboard issues including VM action menus, migration dialog with cross-cluster support, network interface type dropdown, firewall rule creation dialog, and backup job display normalization. The code is well-structured with proper prop passing and error handling.
However, I identified one validation gap in the migration dialog that could cause confusing failures when users attempt cross-cluster migrations.
Findings
[WARNING] src/components/Proxmox/VMList.tsx:314 - Cross-cluster migration lacks target cluster validation
Evidence:
When
isCrossClusteris true, the function returnstruewithout verifyingtargetClusteris actually set. This allows users to submit migrations with an emptytargetCluster, which will fail at the API level with unclear error messages.Fix:
[SUGGESTION] src/components/Proxmox/VMList.tsx:695 - Simplified menu positioning may cause overflow
Evidence: The complex viewport-aware positioning logic was removed and replaced with simple
flipUpwarddetection. While this fixes the immediate menu-closing issue, it doesn't account for horizontal overflow on the right edge of the viewport.Fix: Consider using a UI library popover component (e.g., Radix UI's Popover) that handles both vertical and horizontal positioning automatically, or add horizontal overflow detection similar to the removed
getMenuPositionlogic.Verdict: APPROVE WITH COMMENTS
The changes correctly address the documented issues. The cross-cluster migration validation should be fixed before merge to prevent confusing user-facing errors. The menu positioning simplification is acceptable but should be tested on various screen sizes to ensure no edge cases cause menus to be cut off.
Overall Verdict: APPROVE WITH COMMENTS
Overall verdict reflects the most critical finding across all batches.
Automated PR Review:This PR was reviewed in 2 batches (0 batch(es) failed).
Batch 1 of 2
Summary
After reviewing the Batch 1 changes for Proxmox dashboard and AI fixes, the code correctly implements the documented fixes for AI system message handling, Proxmox parameter naming, storage API optimization, and firewall field mapping. The changes are functionally correct with no compilation errors or logic issues detected.
Findings
Verdict: APPROVE
The changes correctly address the documented issues:
AI System Message Fix - All system prompt sections are properly merged into a single message (
system_parts.join("\n\n---\n\n")), satisfying Qwen 3.5/LiteLLM requirements that reject multiple consecutive system messages. Tool call ordering follows OpenAI API contract correctly.Proxmox Parameter Naming - Consistently renamed
node→node_idacross 14 VM-related commands matching Tauri 2.x naming conventions.Storage API Optimization - Single
cluster/resources?type=storagecall replaces per-node N-request loop. Empty node names are handled correctly to prevent double-slash IDs.Firewall Field Mapping - Correctly handles PVE API field names (
posnotrule_num,protonotprotocol,enable0/1 notenabledbool) in bothadd_ruleandlist_firewall_rules.Backup Job Normalization - Raw PVE
cluster/backupfields are properly normalized to matchBackupJobListshape with correct storage, vmid, mode, and next-run timestamp display.All prior review findings have been addressed in the code. No new high-signal issues detected.
Batch 2 of 2
Summary
This PR batch implements UI fixes for Proxmox dashboard issues including VM action menus, migration dialog with cross-cluster support, network interface type dropdown, and firewall rule creation. The code is generally well-structured with proper prop passing and error handling. However, there is one validation gap in the migration dialog that could cause confusing failures.
Findings
[WARNING] src/components/Proxmox/VMList.tsx:268 - Cross-cluster migration lacks target cluster validation
Evidence:
When
isCrossClusteris true, the function returnstruewithout verifyingtargetClusteris actually set. This allows users to submit migrations with an emptytargetCluster, which will fail at the API level with unclear error messages.Fix:
[SUGGESTION] src/components/Proxmox/VMList.tsx:695 - Simplified menu positioning may cause overflow
Evidence: The complex viewport-aware positioning logic was removed and replaced with simple
flipUpwarddetection. While this fixes the immediate menu-closing issue, it doesn't account for horizontal overflow on the right edge of the viewport.Fix: Consider using a UI library popover component (e.g., Radix UI's Popover) that handles both vertical and horizontal positioning automatically, or add horizontal overflow detection similar to the removed
getMenuPositionlogic.Verdict: APPROVE WITH COMMENTS
The changes correctly address the documented issues. The cross-cluster migration validation should be fixed before merge to prevent confusing user-facing errors. The menu positioning simplification is acceptable but should be tested on various screen sizes to ensure no edge cases cause menus to be cut off.
PR Comment Summary (for your PR)
Overall Verdict: APPROVE WITH COMMENTS
Overall verdict reflects the most critical finding across all batches.