Skip to content

Conversation

@xhzeem
Copy link

@xhzeem xhzeem commented Nov 27, 2025

🛠 Fix:

Previously, AutoRun tasks could be saved even when one or more required options were missing. This resulted in agents starting up with incomplete module configurations, ultimately causing the agent to fail to connect.

This PR updates the saveAutorunTasks() logic to validate all modules before saving.
If any AutoRun module is missing required options, the save action is blocked and a descriptive error is shown to the user.

✔ What’s Changed

  • Added validation to detect modules with missing mandatory options.
  • Display an error message listing each affected module and its missing fields.
  • Prevent saving AutoRun tasks until all required fields are completed.

🚫 Example Error

Missing required options for autorun modules → <module-id>: option1, option2 | <module-id-2>: optionA

✅ Outcome

This ensures that users cannot save incomplete AutoRun configurations and avoids agent connection failures caused by missing required module options.

image

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR prevents AutoRun tasks from being saved when required module options are missing, ensuring agents start with complete configurations and avoiding connection failures.

Key Changes:

  • Added validation logic to detect modules with missing required options before saving
  • Updated the options dialog to use GeneralForm component with proper form validation
  • Refactored the UI layout to improve spacing and alignment of module controls

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return Object.entries(module.options)
.filter(
([key, option]) => option.required === true && key.toLowerCase() !== "agent",
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

The hardcoded lowercase comparison with 'agent' is used in multiple places (lines 336, 344, 360). Consider extracting this as a constant or helper function to improve maintainability and ensure consistency.

Copilot uses AI. Check for mistakes.
this.dialogOptions = null;
},
cloneModuleOptions(options) {
const cloned = JSON.parse(JSON.stringify(options || {}));
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

Using JSON.parse(JSON.stringify()) for deep cloning can be inefficient for large objects and doesn't handle non-JSON-serializable values. Consider using a dedicated cloning utility or the structured clone algorithm if available.

Copilot uses AI. Check for mistakes.
return cloned;
},
applyFormValuesToOptions(options, formValues) {
const updatedOptions = JSON.parse(JSON.stringify(options));
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

Using JSON.parse(JSON.stringify()) for deep cloning can be inefficient for large objects and doesn't handle non-JSON-serializable values. Consider using a dedicated cloning utility or the structured clone algorithm if available.

Copilot uses AI. Check for mistakes.
return;
}
const isValid = this.$refs.generalform?.$refs.form.validate?.();
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

The nested ref access $refs.generalform?.$refs.form.validate?.() is fragile and tightly coupled to the internal structure of GeneralForm. Consider exposing a validation method directly on GeneralForm's interface.

Suggested change
const isValid = this.$refs.generalform?.$refs.form.validate?.();
const isValid = this.$refs.generalform?.validate?.();

Copilot uses AI. Check for mistakes.
@vinnybod vinnybod self-requested a review November 28, 2025 12:59
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.

1 participant