Skip to content
Open
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
1 change: 1 addition & 0 deletions tests/e2e/features/steps/llm_query_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def wait_for_complete_response(context: Context) -> None:
"""Wait for the response to be complete."""
context.response_data = _parse_streaming_response(context.response.text)
context.response.raise_for_status()
print(f"Response data: {context.response_data}")
Comment on lines 94 to +96

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Emit the diagnostic before raise_for_status().

When the response has a non-2xx status, Line 95 raises before Line 96 executes, so the payload is unavailable for precisely those failures the debug output should help diagnose. Move the safe, redacted diagnostic immediately after parsing or include it in error handling.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/e2e/features/steps/llm_query_response.py` around lines 94 - 96, Update
the response handling around _parse_streaming_response so the safe, redacted
diagnostic is emitted immediately after parsing and before
context.response.raise_for_status(). Preserve the existing status validation and
ensure failure responses still print the parsed payload for debugging.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Do not print the full response payload to CI logs.

context.response_data includes response text, conversation IDs, tool calls/results, and stream errors. Raw printing can expose sensitive data to anyone with CI-log access and produce unbounded output. Use the project logger with a bounded/redacted diagnostic instead.

As per coding guidelines, module logging must use logger = get_logger(__name__), and sensitive data must not be leaked in logs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/e2e/features/steps/llm_query_response.py` at line 96, Replace the raw
context.response_data print in the response-handling step with the project
logger initialized as logger = get_logger(__name__). Emit only a bounded,
redacted diagnostic that excludes response text, conversation IDs, tool
calls/results, and stream errors; do not log the full payload.

Source: Coding guidelines

assert context.response_data["finished"] is True
context.use_streaming_response_data = True

Expand Down
Loading