Remove 'Inspect -> Support card' UI leak from OFFER chat prose
Browse filesThe OFFER template embedded a UI instruction ('The source cards are on
the side under Inspect -> Support card if you want details.') inside
chat copy. The rephraser system prompt instructs the LLM to preserve
input content faithfully, so Groq kept the phrase verbatim on its way
out — making the rephrased reply read like a help-tooltip instead of
a conversation.
The Support card panel is already visible on the right side of the UI
with the verified resource links + last_verified dates, so the chat
bubble does not need to point at it.
src/pipeline/response_planner.py
CHANGED
|
@@ -272,14 +272,16 @@ class ResponsePlan:
|
|
| 272 |
parts.append(self.recommended_action)
|
| 273 |
|
| 274 |
# Soft, named resource mention. Only for routes where it adds value.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 275 |
if self.route not in ("crisis_immediate", "out_of_scope", "peer_helper"):
|
| 276 |
names = self._resource_names(2)
|
| 277 |
phrase = self._phrase_resources(names)
|
| 278 |
if phrase:
|
| 279 |
-
parts.append(
|
| 280 |
-
f"Specific places worth knowing: {phrase}. The source cards are on the "
|
| 281 |
-
"side under Inspect → Support card if you want details."
|
| 282 |
-
)
|
| 283 |
|
| 284 |
if self.international_concern and self.route not in ("crisis_immediate", "out_of_scope"):
|
| 285 |
parts.append(
|
|
|
|
| 272 |
parts.append(self.recommended_action)
|
| 273 |
|
| 274 |
# Soft, named resource mention. Only for routes where it adds value.
|
| 275 |
+
# The Support card UI on the right surfaces verified links + last-
|
| 276 |
+
# verified dates already, so the chat bubble doesn't need to point
|
| 277 |
+
# at the panel — that text used to leak into the LLM rephrase and
|
| 278 |
+
# read as a UI instruction inside what should be conversational
|
| 279 |
+
# prose.
|
| 280 |
if self.route not in ("crisis_immediate", "out_of_scope", "peer_helper"):
|
| 281 |
names = self._resource_names(2)
|
| 282 |
phrase = self._phrase_resources(names)
|
| 283 |
if phrase:
|
| 284 |
+
parts.append(f"Specific places worth knowing: {phrase}.")
|
|
|
|
|
|
|
|
|
|
| 285 |
|
| 286 |
if self.international_concern and self.route not in ("crisis_immediate", "out_of_scope"):
|
| 287 |
parts.append(
|