Skip to content

Commit b1d9bc7

Browse files
feat(seer): Add preamble to structured page context markdown
Prepend a blockquote explaining that the content is a structured summary, not an exact screenshot. This helps the LLM understand the context type and also serves as a marker to differentiate structured context from raw ASCII screenshots downstream. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent aed886a commit b1d9bc7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/sentry/seer/explorer/client_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,4 +369,7 @@ def snapshot_to_markdown(snapshot: dict[str, Any]) -> str:
369369
nodes = snapshot.get("nodes", [])
370370
if not nodes:
371371
return ""
372-
return _render_node(nodes[0], 0)
372+
preamble = (
373+
"> This is a structured summary of the page the user is viewing, not an exact screenshot.\n"
374+
)
375+
return preamble + _render_node(nodes[0], 0)

tests/sentry/seer/explorer/test_client_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ def test_node_with_no_data(self) -> None:
242242
"nodes": [{"nodeType": "dashboard", "data": None, "children": []}],
243243
}
244244
result = snapshot_to_markdown(snapshot)
245-
assert result == "# dashboard"
245+
assert "# dashboard" in result
246+
assert "not an exact screenshot" in result
246247

247248
def test_node_with_non_dict_data(self) -> None:
248249
snapshot = {

0 commit comments

Comments
 (0)