Skip to content

Conversation

@Henrrypg
Copy link
Contributor

@Henrrypg Henrrypg commented Dec 19, 2025

This pull request introduces a new AI Workflow Profile and Scope system, replacing the previous configuration model to enable more flexible and maintainable management of AI workflow templates and their application contexts. It adds new models, admin interfaces, API endpoints, and serializer logic to support this change, along with associated database migrations.

Key changes include:

Models and Database

  • Introduced new models: AIWorkflowProfile for reusable workflow template definitions, and AIWorkflowScope for mapping profiles to course/location/service contexts, with associated migrations. Updated AIWorkflowSession to reference these new models and enforce uniqueness.

Admin Interface

  • Added a comprehensive Django admin interface for AIWorkflowProfile, featuring a custom form with JSON5 patch validation, template preview, merged configuration preview, and validation status display. Also added an admin interface for AIWorkflowScope.

API and Serialization

  • Replaced the old config API with endpoints and serializers based on profiles and scopes: introduced AIWorkflowProfileView and AIWorkflowProfileSerializer to expose only the relevant UI components to the frontend.

Workflow Execution Logic

  • Refactored the main workflow execution view to use AIWorkflowScope.get_config for context-aware profile selection and execution, simplifying request handling and removing legacy configuration logic.

These changes collectively establish a more modular, extensible, and user-friendly system for managing AI workflow templates and their application across different Open edX contexts.

@openedx-webhooks
Copy link

openedx-webhooks commented Dec 19, 2025

Thanks for the pull request, @Henrrypg!

This repository is currently maintained by @felipemontoya.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Dec 19, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Dec 19, 2025
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Dec 22, 2025
@codecov
Copy link

codecov bot commented Dec 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.37%. Comparing base (05c259b) to head (9dfb603).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #76      +/-   ##
==========================================
+ Coverage   88.64%   89.37%   +0.72%     
==========================================
  Files          44       45       +1     
  Lines        3197     3773     +576     
  Branches      213      256      +43     
==========================================
+ Hits         2834     3372     +538     
- Misses        288      313      +25     
- Partials       75       88      +13     
Flag Coverage Δ
unittests 89.37% <ø> (+0.72%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Henrrypg Henrrypg changed the title WIP feat: add models feat: rename and materialize django models Dec 22, 2025
@Henrrypg
Copy link
Contributor Author

@felipemontoya
can u check this one?

@felipemontoya felipemontoya self-requested a review December 22, 2025 20:37
action: 'clear_session',
payload: {
requestId: `ai-request-${Date.now()}`,
courseId: preparedContext.courseId || null,
Copy link
Member

Choose a reason for hiding this comment

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

Are we getting the course_id in a different manner? If we can get it from the backend directly that would be much better, but we still need it as I wrote in the performance of the get_config method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we was taking it from both payload and query params before, and this one wasn't use, i removed it from payload to have consistency in both requests (profile/(GET) and workflows/(POST))

Copy link
Member

@felipemontoya felipemontoya left a comment

Choose a reason for hiding this comment

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

Thanks @Henrrypg. While doing my second review I found two errors which I corrected. I'll push those to your branch

@felipemontoya felipemontoya merged commit dbe2db4 into openedx:main Dec 23, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from Waiting on Author to Done in Contributions Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants