Skip to content

Conversation

@Alam-2U
Copy link

@Alam-2U Alam-2U commented Dec 24, 2025

Description

Add client_id support for AI unit summary tracking

Merge checklist:
Check off if complete or not applicable:

  • Version bumped
  • Changelog record added
  • Documentation updated (not only docstrings)
  • Fixup commits are squashed away
  • Unit tests added/updated
  • Manual testing instructions provided
  • Noted any: Concerns, dependencies, migration issues, deadlines, tickets

Related Ticket
COSMO2-779

Related PR
https://github.com/2uinc/ai-spot/pull/51

@Alam-2U Alam-2U marked this pull request as ready for review January 9, 2026 06:55
Copilot AI review requested due to automatic review settings January 9, 2026 06:55
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 pull request adds client_id support for AI unit summary tracking, allowing the frontend to identify the client making requests to the AI service. The version has been bumped to 3.8.3.

Key changes:

  • Added data-client-id attribute to the summary hook HTML template with value "edx-unit-summaries"
  • Introduced SUMMARY_CLIENT_ID setting with a default fallback value
  • Updated tests to verify the client_id is properly rendered in the HTML output

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
ai_aside/__init__.py Version bumped from 3.8.2 to 3.8.3
ai_aside/block.py Added data-client-id template variable and logic to read from settings with fallback
ai_aside/settings/devstack.py Added SUMMARY_CLIENT_ID setting configured as 'edx-unit-summaries'
tests/test_block.py Updated test to assert the presence of data-client-id attribute in rendered HTML

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

"""

__version__ = '3.8.2'
__version__ = '3.8.3'
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

The version has been bumped to 3.8.3, but the CHANGELOG.rst file is missing a corresponding entry for this version. According to the merge checklist in the PR description, a changelog record should be added. Please add an entry under the "Unreleased" section or create a new "3.8.3" section documenting the addition of client_id support for AI unit summary tracking.

Suggested change
__version__ = '3.8.3'
__version__ = '3.8.2'

Copilot uses AI. Check for mistakes.
settings.SUMMARY_HOOK_MIN_SIZE = 500
settings.SUMMARY_ENABLED_BY_DEFAULT = False
settings.AISPOT_LMS_NAME = 'lms' # in docker ai-spot sees the LMS as 'lms' not 'localhost'
settings.SUMMARY_CLIENT_ID = 'edx-unit-summaries'
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

The SUMMARY_CLIENT_ID setting is configured in devstack.py but is missing from common.py where other similar settings like SUMMARY_HOOK_HOST, SUMMARY_HOOK_JS_PATH, and AISPOT_LMS_NAME are configured. Consider adding SUMMARY_CLIENT_ID to common.py to allow it to be configured via ENV_TOKENS, following the same pattern as the other settings. This would ensure consistent configuration management across different environments.

Copilot uses AI. Check for mistakes.
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.

3 participants