Skip to content

Commit 135401f

Browse files
committed
fix: preserve workflow hint display in coaching
1 parent 3b011a4 commit 135401f

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/primer/server/services/coaching_service.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,11 @@ def _normalize_hint(value: str | None) -> str | None:
161161
return normalized or None
162162

163163

164-
def _normalize_workflow_value(value: str | None) -> str | None:
165-
return _normalize_hint(value)
166-
167-
168164
def _matches_workflow_hint(playbook_like, workflow_hint: str | None) -> bool:
169165
if not workflow_hint:
170166
return True
171-
title = _normalize_workflow_value(getattr(playbook_like, "title", "")) or ""
172-
session_type = _normalize_workflow_value(getattr(playbook_like, "session_type", None))
167+
title = _normalize_hint(getattr(playbook_like, "title", "")) or ""
168+
session_type = _normalize_hint(getattr(playbook_like, "session_type", None))
173169
return workflow_hint in title or workflow_hint == session_type
174170

175171

@@ -248,7 +244,7 @@ def _build_session_start_recommendations_section(
248244
for recommendation in model_recommendations
249245
if not workflow_hint
250246
or not recommendation.workflow_archetype
251-
or _normalize_workflow_value(recommendation.workflow_archetype) == workflow_hint
247+
or _normalize_hint(recommendation.workflow_archetype) == workflow_hint
252248
]
253249
if matching_models:
254250
recommendation = matching_models[0]
@@ -382,7 +378,7 @@ def get_session_start_brief(
382378
brief_type="session_start",
383379
context_summary=_context_summary(
384380
project_name=project_name,
385-
workflow_hint=normalized_workflow_hint,
381+
workflow_hint=workflow_hint,
386382
task_hint=task_hint,
387383
),
388384
)

tests/test_coaching.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,3 +232,4 @@ def test_session_start_coaching_matches_hyphenated_workflow_hints(
232232
assert any(
233233
"Use Sonnet for feature-delivery work" in item for item in data["sections"][1]["items"]
234234
)
235+
assert "Workflow: feature-delivery" in data["context_summary"]

0 commit comments

Comments
 (0)