Skip to content

[Bug]: LearningSession has no metadata field — agents get empty context #496

Description

@jes614753-sketch

Problem

LearningSession model (deeptutor/models/learning_session.py) has no metadata field. When agents (Tutor, QA) try to read knowledge point info via session.metadata.get("knowledge_point_title"), they get empty/default values because the attribute doesn't exist.

Steps to Reproduce

  1. Start a learning session with POST /sessions/start
  2. Send a message via POST /sessions/{id}/message
  3. Agent receives empty knowledge point title and description

Expected

Agents should have access to the knowledge point context (title, description) to provide meaningful responses.

Fix

Add a metadata field to LearningSession:

class LearningSession(BaseModel):
    ...
    metadata: dict[str, Any] = Field(default_factory=dict)
    ...

And store knowledge point info when starting a session:

session.metadata["knowledge_point_title"] = request.knowledge_point_title
session.metadata["knowledge_point_description"] = request.knowledge_point_description

Environment

  • Python 3.14, Windows 11, latest main branch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions