-
Notifications
You must be signed in to change notification settings - Fork 39
fix: auto-activate custom workflow after submission #510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Previously, custom workflows were only set as pending but never activated,
which meant no network call was made to the backend API. This fix ensures
custom workflows are automatically activated after submission, matching
the behavior of out-of-the-box workflows.
The fix adds an immediate call to activateWorkflow() after setCustomWorkflow(),
which triggers the POST request to /api/projects/{project}/agentic-sessions/{session}/workflow
Claude Code ReviewSummaryThis PR fixes a bug where custom workflows were not being activated after submission. The fix adds an automatic activation call after setting the workflow as pending, matching the behavior of out-of-the-box (OOTB) workflows. The change is focused, minimal, and follows the established pattern. Issues by Severity🚫 Blocker IssuesNone identified. 🔴 Critical IssuesNone identified. 🟡 Major Issues1. Duplicate workflow object creation (lines 2038-2046)
onSubmit={(url, branch, path) => {
workflowManagement.setCustomWorkflow(url, branch, path);
setCustomWorkflowDialogOpen(false);
// Automatically activate the custom workflow (same as OOTB workflows)
// The workflow is now in pendingWorkflow after setCustomWorkflow call above
if (workflowManagement.pendingWorkflow) {
workflowManagement.activateWorkflow(
workflowManagement.pendingWorkflow,
session?.status?.phase
);
}
}}2. Execution order creates race condition risk
🔵 Minor Issues1. Frontend standards compliance
2. Missing type safety validation
const customWorkflow: WorkflowConfig = {
id: "custom",
// ... rest
};3. Comment could be more specific (line 2037)
Positive Highlights✅ Follows established patterns: The fix mirrors the OOTB workflow activation pattern used in ✅ Clean and focused: The fix is minimal (11 lines) and doesn't introduce unnecessary changes or refactoring. ✅ Proper error handling: Uses the existing ✅ Testing noted: PR description mentions frontend builds successfully and no linting errors. ✅ Good PR description: Clear problem statement, root cause analysis, and solution explanation. RecommendationsPriority 1 (Before Merge):
Priority 2 (Nice to Have):
Priority 3 (Future Refactoring):
Testing Recommendations:
Overall AssessmentStatus: ✅ APPROVE with suggestions This is a solid bug fix that correctly addresses the issue. The major issue identified (duplicate object creation) is a code quality concern rather than a functional bug. The current implementation will work correctly due to passing the workflow directly to The fix follows the repository's patterns, uses proper error handling through the existing hook, and maintains consistency with OOTB workflow activation behavior. 🔍 View AI decision process (logs available for 90 days) 📋 View memory system files loaded (click to expand)What Amber Loaded for Code ReviewAmber automatically loaded these repository standards from the memory system:
Impact: This review used your repository's specific code quality standards, security patterns, and best practices from the memory system (PRs #359, #360) - not just generic code review guidelines. |
Problem
Custom workflows were not being activated after submission - the form dialog would close, but no network call was made to the backend API to actually load the workflow.
Root Cause
When submitting a custom workflow, the code was only calling
setCustomWorkflow()which set it as "pending" but never calledactivateWorkflow(). Out-of-the-box workflows automatically activated, but custom ones didn't.Solution
Modified the
CustomWorkflowDialogsubmission handler to automatically activate the workflow after setting it as pending. This now:/api/projects/{project}/agentic-sessions/{session}/workflow)This matches the behavior of OOTB workflows.
Testing
npm run buildChanges
components/frontend/src/app/projects/[name]/sessions/[sessionName]/page.tsxCustomWorkflowDialogonSubmit handler