diff --git a/tests/agents_tests/test_agent_sessions.py b/tests/agents_tests/test_agent_sessions.py index 235a8da..2549031 100644 --- a/tests/agents_tests/test_agent_sessions.py +++ b/tests/agents_tests/test_agent_sessions.py @@ -451,6 +451,19 @@ def test_agent_session_list_view(mock_delay, client, user): assert settings.LLM_MODEL.encode() in response.content +@patch("scrobbles.tasks.scrobble_agent_session_prompt.delay") +def test_homepage_shows_agent_sessions_with_first_prompt_title(mock_delay, client, user): + first_prompt = "tell me about the history of cheese making in europe" + _mk_scrobble(user, in_progress=False, title=first_prompt) + client.force_login(user) + response = client.get(reverse("vrobbler-home")) + + assert response.status_code == 200 + assert b"Agent Sessions" in response.content + assert first_prompt.encode() in response.content + assert settings.LLM_MODEL.encode() not in response.content + + @patch("scrobbles.tasks.scrobble_agent_session_prompt.delay") def test_agent_session_detail_view(mock_delay, client, user): scrobble = _mk_scrobble(user, in_progress=True) diff --git a/vrobbler/templates/scrobbles/_last_scrobbles.html b/vrobbler/templates/scrobbles/_last_scrobbles.html index 21644e6..3ba0973 100644 --- a/vrobbler/templates/scrobbles/_last_scrobbles.html +++ b/vrobbler/templates/scrobbles/_last_scrobbles.html @@ -102,6 +102,15 @@

No tasks today

{% endif %} +

Agent Sessions

+ {% if AgentSession %} + {% with scrobbles=AgentSession count=AgentSession_count time=AgentSession_time %} + {% include "scrobbles/_scrobble_table.html" %} + {% endwith %} + {% else %} +

No agent sessions today

+ {% endif %} +

Videos

{% if Video %} {% with scrobbles=Video count=Video_count time=Video_time %} diff --git a/vrobbler/templates/scrobbles/_row.html b/vrobbler/templates/scrobbles/_row.html index 20bbe57..a251bf5 100644 --- a/vrobbler/templates/scrobbles/_row.html +++ b/vrobbler/templates/scrobbles/_row.html @@ -7,6 +7,8 @@

{{scrobble.media_obj.title|truncatechars_html:45}} - {% if scrobble.logdata %}{% if scrobble.logdata.title %}{{scrobble.logdata.title}}{% endif %}{% endif %}

{% elif scrobble.media_type == "GeoLocation" %}

{{scrobble.media_obj|truncatechars_html:45}} - {{scrobble.logdata.movement_type}} + {% elif scrobble.media_type == "AgentSession" %} +

{% if scrobble.logdata.title %}{{scrobble.logdata.title|truncatechars_html:100}}{% else %}{{scrobble.media_obj|truncatechars_html:100}}{% endif %}

{% else %}

{{scrobble.media_obj|truncatechars_html:45}} {% endif %}