mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
fix(notifications): task titles and agent slugs replace raw UUIDs (#616)
* fix(notifications): task titles and agent slugs replace raw UUIDs
Notification producers interpolated raw task/agent UUIDs into subjects and
bodies ('Task 68e1e4db-... unblocked', 'handed back to 00000000-...-0004').
A tiny notification_text helper (task_display: title-first with a #id8
fallback; agent_display: identity-map slug first, DB lookup fallback) now
feeds every producer: all 13 NotificationService methods, the 7
delivery-service bodies whose subjects were already title-based, the
substitute-PM ad-hoc insert, and the orchestrator/choreographer callers,
which thread the task row's title one call deeper. Fixes the literal
'cell_pm' role string sent as an agent slug in the merge-conflict
notification. Tool-call examples like unblock('<uuid>') keep the raw id on
purpose — agents need it.
* test(notifications): board-review subject assertion matches the humanized format
---------
Co-authored-by: Renn F <rennf93@users.noreply.github.com>
This commit is contained in:
@@ -28,6 +28,7 @@ from http import HTTPStatus
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
import httpx
|
||||
from roboco.services.notification_text import task_display
|
||||
from tests.e2e_smoke.arcs import seed_company, seed_project, seed_task
|
||||
|
||||
if TYPE_CHECKING:
|
||||
@@ -225,7 +226,8 @@ def test_unblock_persists_alert_notification(e2e_stack: E2EStack) -> None:
|
||||
note = notifications[0]
|
||||
assert "alert" in note["type"].lower(), note
|
||||
assert note["related_task_id"] == task_id, note
|
||||
assert note["subject"] == f"Task {task_id} unblocked", note
|
||||
expected_display = task_display("Rotate the expired staging credential", task_id)
|
||||
assert note["subject"] == f"Task {expected_display} unblocked", note
|
||||
assert note["priority"], "priority must be populated"
|
||||
assert company.dev_id in note["to_agents"], note
|
||||
|
||||
@@ -294,8 +296,11 @@ def test_dependency_revival_persists_alert_notification(e2e_stack: E2EStack) ->
|
||||
note = notifications[0]
|
||||
assert "alert" in note["type"].lower(), note
|
||||
assert note["related_task_id"] == dependent_id, note
|
||||
assert note["subject"] == f"Task {dependent_id} revived by dependency completion", (
|
||||
note
|
||||
expected_display = task_display(
|
||||
"Wire the new endpoint to the shared auth helper", dependent_id
|
||||
)
|
||||
assert (
|
||||
note["subject"] == f"Task {expected_display} revived by dependency completion"
|
||||
), note
|
||||
assert note["priority"], "priority must be populated"
|
||||
assert company.dev_id in note["to_agents"], note
|
||||
|
||||
Reference in New Issue
Block a user