c3691a6eff
Replaced the tell streaming path in src/cleveragents/cli/commands/session.py to route through the Rich console by using console.print(_escape(assistant_content)) instead of writing characters directly to stdout. This ensures the redaction layer is applied before content reaches stdout and removes the now-unused import sys. Added a new TDD/BDD feature: features/tdd_session_tell_stream_redaction.feature with 3 scenarios verifying that session tell --stream does not write directly to sys.stdout, that output contains the assistant response, and that streaming output goes through the Rich console. Added features/steps/tdd_session_tell_stream_redaction_steps.py with step definitions to support the new feature. ISSUES CLOSED: #10460
27 lines
1.2 KiB
Gherkin
27 lines
1.2 KiB
Gherkin
@tdd_issue @tdd_issue_10458
|
|
Feature: TDD — session tell --stream routes output through console (not sys.stdout)
|
|
As a security-conscious developer
|
|
I want streaming output from `session tell --stream` to go through the Rich console
|
|
So that sensitive values in the assistant response are redacted before reaching stdout
|
|
|
|
Background:
|
|
Given a session tell stream redaction mock service
|
|
|
|
@tdd_issue @tdd_issue_10458
|
|
Scenario: session tell --stream does not write directly to sys.stdout
|
|
When I invoke session tell with --stream and a sensitive prompt
|
|
Then the tell command exits with code 0
|
|
And sys.stdout.write was not called directly during streaming
|
|
|
|
@tdd_issue @tdd_issue_10458
|
|
Scenario: session tell --stream output contains the assistant response
|
|
When I invoke session tell with --stream and a plain prompt
|
|
Then the tell command exits with code 0
|
|
And the tell output contains "Acknowledged"
|
|
|
|
@tdd_issue @tdd_issue_10458
|
|
Scenario: session tell --stream uses console.print not sys.stdout.write
|
|
When I invoke session tell with --stream and a plain prompt
|
|
Then the tell command exits with code 0
|
|
And the streaming output was written through the Rich console
|