fix(cli): route session tell --stream output through console to apply redaction #10734

Merged
HAL9000 merged 2 commits from fix/session-tell-stream-redaction into master 2026-04-27 01:33:30 +00:00
Owner

Summary

Fixed a security issue where session tell --stream was writing directly to sys.stdout, bypassing the redaction layer. The streaming output now routes through the Rich console, ensuring sensitive information is properly redacted before reaching stdout.

Changes

  • src/cleveragents/cli/commands/session.py: Replaced character-by-character sys.stdout.write() loop with console.print(_escape(assistant_content)). Removed unused import sys statement.
  • features/tdd_session_tell_stream_redaction.feature: Added 3 BDD scenarios verifying the fix.
  • features/steps/tdd_session_tell_stream_redaction_steps.py: Step definitions for the new TDD feature.

Testing

  • ✓ Lint checks passing
  • ✓ Type checking passing
  • ✓ 3 new BDD scenarios pass
  • ✓ 35 existing session command tests pass

Closes #10460


Automated by CleverAgents Bot
Supervisor: Implementation Pool | Agent: implementation-worker

## Summary Fixed a security issue where `session tell --stream` was writing directly to `sys.stdout`, bypassing the redaction layer. The streaming output now routes through the Rich console, ensuring sensitive information is properly redacted before reaching stdout. ## Changes - **`src/cleveragents/cli/commands/session.py`**: Replaced character-by-character `sys.stdout.write()` loop with `console.print(_escape(assistant_content))`. Removed unused `import sys` statement. - **`features/tdd_session_tell_stream_redaction.feature`**: Added 3 BDD scenarios verifying the fix. - **`features/steps/tdd_session_tell_stream_redaction_steps.py`**: Step definitions for the new TDD feature. ## Testing - ✓ Lint checks passing - ✓ Type checking passing - ✓ 3 new BDD scenarios pass - ✓ 35 existing session command tests pass Closes #10460 --- **Automated by CleverAgents Bot** Supervisor: Implementation Pool | Agent: implementation-worker
HAL9000 added the
Type
Bug
label 2026-04-19 08:50:34 +00:00
HAL9001 approved these changes 2026-04-22 09:39:10 +00:00
HAL9001 left a comment
Owner

All changes look correct and align with requirements:

  • Correctness: streaming output now uses Rich console with the redaction layer applied.
  • Test Quality: three new BDD scenarios added and passing.
  • Security: uses markup.escape to ensure sensitive information is redacted.

No issues found. Approving.


Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker

All changes look correct and align with requirements: - Correctness: streaming output now uses Rich console with the redaction layer applied. - Test Quality: three new BDD scenarios added and passing. - Security: uses markup.escape to ensure sensitive information is redacted. No issues found. Approving. --- Automated by CleverAgents Bot Supervisor: PR Review | Agent: pr-review-worker
HAL9000 force-pushed fix/session-tell-stream-redaction from 85a0eab185 to 152f6cc211 2026-04-22 10:59:32 +00:00 Compare
HAL9000 scheduled this pull request to auto merge when all checks succeed 2026-04-22 10:59:37 +00:00
HAL9000 force-pushed fix/session-tell-stream-redaction from 152f6cc211 to 3039006c63 2026-04-22 13:12:22 +00:00 Compare
HAL9000 force-pushed fix/session-tell-stream-redaction from 3039006c63 to b633aedd17 2026-04-22 22:36:19 +00:00 Compare
HAL9000 force-pushed fix/session-tell-stream-redaction from b633aedd17 to fbf3486154 2026-04-23 09:24:33 +00:00 Compare
HAL9000 force-pushed fix/session-tell-stream-redaction from fbf3486154 to 6b2be34966 2026-04-23 13:27:13 +00:00 Compare
HAL9000 force-pushed fix/session-tell-stream-redaction from 6b2be34966 to e2324c3dc0 2026-04-23 15:44:10 +00:00 Compare
HAL9000 force-pushed fix/session-tell-stream-redaction from e2324c3dc0 to 65606529e3 2026-04-23 18:34:44 +00:00 Compare
HAL9000 force-pushed fix/session-tell-stream-redaction from 65606529e3 to 72877c0518 2026-04-24 01:30:30 +00:00 Compare
HAL9000 force-pushed fix/session-tell-stream-redaction from 72877c0518 to a6a10ae20f 2026-04-24 04:22:07 +00:00 Compare
HAL9000 force-pushed fix/session-tell-stream-redaction from a6a10ae20f to 3f4a05a0cb 2026-04-24 06:19:57 +00:00 Compare
HAL9000 force-pushed fix/session-tell-stream-redaction from 3f4a05a0cb to be8769f339 2026-04-25 04:34:13 +00:00 Compare
HAL9000 force-pushed fix/session-tell-stream-redaction from be8769f339 to b7ca8c0830 2026-04-26 10:03:40 +00:00 Compare
HAL9000 force-pushed fix/session-tell-stream-redaction from b7ca8c0830 to edc74973fd 2026-04-26 17:03:19 +00:00 Compare
HAL9000 force-pushed fix/session-tell-stream-redaction from edc74973fd to acb46d96f7 2026-04-27 01:12:37 +00:00 Compare
HAL9000 merged commit acb46d96f7 into master 2026-04-27 01:33:30 +00:00
Sign in to join this conversation.
No Reviewers
No Label
Type
Bug
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cleveragents/cleveragents-core#10734