Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sentry/seer/explorer/client_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def poll_until_done(
def _render_node(node: dict[str, Any], depth: int) -> str:
"""Recursively render an LLMContextSnapshot node and its children as markdown."""
heading = "#" * min(depth + 1, 6)
lines = [f"{heading} {node.get('nodeType', 'unknown')}"]
lines = [f"{heading} {(node.get('nodeType') or 'unknown').capitalize()}"]

data = node.get("data")
if isinstance(data, dict):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def test_post_json_on_page_context_converted_to_markdown(
assert response.status_code == 200
call_kwargs = mock_client.start_run.call_args[1]
context = call_kwargs["on_page_context"]
assert "# dashboard" in context
assert "# Dashboard" in context
assert '- **title**: "My Dashboard"' in context

@patch("sentry.seer.endpoints.organization_seer_explorer_chat.SeerExplorerClient")
Expand Down
12 changes: 6 additions & 6 deletions tests/sentry/seer/explorer/test_client_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def test_single_node(self) -> None:
],
}
result = snapshot_to_markdown(snapshot)
assert "# dashboard" in result
assert "# Dashboard" in result
assert '- **title**: "Backend Health"' in result
assert "- **widgetCount**: 3" in result

Expand Down Expand Up @@ -228,9 +228,9 @@ def test_nested_nodes(self) -> None:
],
}
result = snapshot_to_markdown(snapshot)
assert "# dashboard" in result
assert "## widget" in result
assert "### chart" in result
assert "# Dashboard" in result
assert "## Widget" in result
assert "### Chart" in result
assert '- **query**: "count()"' in result

def test_empty_nodes(self) -> None:
Expand All @@ -242,7 +242,7 @@ def test_node_with_no_data(self) -> None:
"nodes": [{"nodeType": "dashboard", "data": None, "children": []}],
}
result = snapshot_to_markdown(snapshot)
assert "# dashboard" in result
assert "# Dashboard" in result
assert "not an exact screenshot" in result

def test_node_with_non_dict_data(self) -> None:
Expand All @@ -251,5 +251,5 @@ def test_node_with_non_dict_data(self) -> None:
"nodes": [{"nodeType": "widget", "data": "some string", "children": []}],
}
result = snapshot_to_markdown(snapshot)
assert "# widget" in result
assert "# Widget" in result
assert '- "some string"' in result
Loading