feat(tui): implement full conversation stream block type catalog #1006

Open
opened 2026-03-17 01:10:33 +00:00 by brent.edwards · 4 comments
Member

10 block types: Welcome, UserInput, ActorResponse, ActorThought, ToolCall, PlanProgress, DiffView, TerminalEmbed, ShellResult, Note.

Dependencies

  • Parent: #868 (Epic: TUI Interface)
  • Tracked by: #926
10 block types: Welcome, UserInput, ActorResponse, ActorThought, ToolCall, PlanProgress, DiffView, TerminalEmbed, ShellResult, Note. ## Dependencies - Parent: #868 (Epic: TUI Interface) - Tracked by: #926
brent.edwards added this to the v3.7.0 milestone 2026-03-17 01:11:51 +00:00
Author
Member

Implemented in PR #1247.

Design and implementation notes:

  • Added a new presentation-layer conversation stream module at src/cleveragents/tui/widgets/conversation_stream.py.
  • Introduced ConversationBlockType as the canonical block-type catalog for the 10 spec-defined conversation blocks: Welcome, UserInput, ActorResponse, ActorThought, ToolCall, PlanProgress, DiffView, TerminalEmbed, ShellResult, and Note.
  • Added ConversationBlockSpec and CONVERSATION_BLOCK_CATALOG so the spec metadata (visual treatment, source, expandable state) is preserved in a single location instead of being duplicated across app logic and tests.
  • Added EXPANDABLE_BLOCK_TYPES as a derived set from the catalog so the expandable-block contract stays consistent with the catalog definition.
  • Added ConversationBlock plus plain-text rendering helpers (render_conversation_block, render_conversation_blocks) so the current minimal TUI can render typed stream content without needing the full later-stage rich block widgets yet.
  • Added ConversationStream as a lightweight widget wrapper over the typed block list. This keeps the app-side change small while creating a dedicated ownership point for future richer block rendering.

App integration notes:

  • Updated src/cleveragents/tui/app.py so SessionView.transcript stores typed ConversationBlock entries instead of raw strings.
  • Seeded the session transcript with a default welcome block at app construction time.
  • Replaced the single raw Static conversation panel with the new ConversationStream widget.
  • Added small app helpers to keep transcript mutation and widget refresh centralized (_append_block, _sync_conversation).
  • Existing app behaviors were mapped onto the new stream model conservatively:
    • help / command responses -> Note
    • prompt submissions -> UserInput
    • shell output -> ShellResult
    • shell-without-result fallback -> Note
  • I kept the renderer intentionally plain-text for now. That minimizes scope for this ticket while still establishing the full typed catalog the later TUI tickets can build on.

Test coverage notes:

  • Added features/tui_conversation_stream_coverage.feature and features/steps/tui_conversation_stream_coverage_steps.py to validate:
    • catalog cardinality and ordering
    • expandable block set
    • catalog metadata lookup
    • renderer output across all 10 block types
    • widget append/replace refresh behavior
  • Updated features/tui_app_coverage.feature and features/steps/tui_app_coverage_steps.py so mocked-Textual coverage reloads the new widget module and verifies the welcome block appears on mount.
  • Added a Robot smoke check in robot/tui_smoke.robot to verify the catalog names and representative rendered block output from a subprocess.

Validation run:

  • nox -s lint
  • nox -s typecheck unit_tests -- features/tui_conversation_stream_coverage.feature features/tui_app_coverage.feature
  • PYTHONPATH=src NO_COLOR=1 .nox/unit_tests-3-13/bin/robot --outputdir build/reports/robot-smoke --variable PYTHON:/tmp/issue-1006/.nox/unit_tests-3-13/bin/python robot/tui_smoke.robot
  • nox -s coverage_report
  • Coverage result: COVERAGE OK: 98.7% (threshold: 97%)

Traceability:

  • Commit: 668c349d (feat(tui): implement full conversation stream block type catalog)
Implemented in PR #1247. Design and implementation notes: - Added a new presentation-layer conversation stream module at `src/cleveragents/tui/widgets/conversation_stream.py`. - Introduced `ConversationBlockType` as the canonical block-type catalog for the 10 spec-defined conversation blocks: `Welcome`, `UserInput`, `ActorResponse`, `ActorThought`, `ToolCall`, `PlanProgress`, `DiffView`, `TerminalEmbed`, `ShellResult`, and `Note`. - Added `ConversationBlockSpec` and `CONVERSATION_BLOCK_CATALOG` so the spec metadata (visual treatment, source, expandable state) is preserved in a single location instead of being duplicated across app logic and tests. - Added `EXPANDABLE_BLOCK_TYPES` as a derived set from the catalog so the expandable-block contract stays consistent with the catalog definition. - Added `ConversationBlock` plus plain-text rendering helpers (`render_conversation_block`, `render_conversation_blocks`) so the current minimal TUI can render typed stream content without needing the full later-stage rich block widgets yet. - Added `ConversationStream` as a lightweight widget wrapper over the typed block list. This keeps the app-side change small while creating a dedicated ownership point for future richer block rendering. App integration notes: - Updated `src/cleveragents/tui/app.py` so `SessionView.transcript` stores typed `ConversationBlock` entries instead of raw strings. - Seeded the session transcript with a default welcome block at app construction time. - Replaced the single raw `Static` conversation panel with the new `ConversationStream` widget. - Added small app helpers to keep transcript mutation and widget refresh centralized (`_append_block`, `_sync_conversation`). - Existing app behaviors were mapped onto the new stream model conservatively: - help / command responses -> `Note` - prompt submissions -> `UserInput` - shell output -> `ShellResult` - shell-without-result fallback -> `Note` - I kept the renderer intentionally plain-text for now. That minimizes scope for this ticket while still establishing the full typed catalog the later TUI tickets can build on. Test coverage notes: - Added `features/tui_conversation_stream_coverage.feature` and `features/steps/tui_conversation_stream_coverage_steps.py` to validate: - catalog cardinality and ordering - expandable block set - catalog metadata lookup - renderer output across all 10 block types - widget append/replace refresh behavior - Updated `features/tui_app_coverage.feature` and `features/steps/tui_app_coverage_steps.py` so mocked-Textual coverage reloads the new widget module and verifies the welcome block appears on mount. - Added a Robot smoke check in `robot/tui_smoke.robot` to verify the catalog names and representative rendered block output from a subprocess. Validation run: - `nox -s lint` - `nox -s typecheck unit_tests -- features/tui_conversation_stream_coverage.feature features/tui_app_coverage.feature` - `PYTHONPATH=src NO_COLOR=1 .nox/unit_tests-3-13/bin/robot --outputdir build/reports/robot-smoke --variable PYTHON:/tmp/issue-1006/.nox/unit_tests-3-13/bin/python robot/tui_smoke.robot` - `nox -s coverage_report` - Coverage result: `COVERAGE OK: 98.7% (threshold: 97%)` Traceability: - Commit: `668c349d` (`feat(tui): implement full conversation stream block type catalog`)
freemo self-assigned this 2026-04-02 06:14:01 +00:00
Owner

PR #1247 has been reviewed and approved — code quality, spec alignment, typing, and test coverage all look excellent.

However, the PR cannot be merged yet due to merge conflicts with master. The conflict is likely in src/cleveragents/tui/app.py caused by the recently merged help panel PR (#1013). The branch needs to be rebased onto current master and conflicts resolved before merge can proceed.

PR #1247 has been **reviewed and approved** — code quality, spec alignment, typing, and test coverage all look excellent. However, the PR **cannot be merged yet** due to merge conflicts with master. The conflict is likely in `src/cleveragents/tui/app.py` caused by the recently merged help panel PR (#1013). The branch needs to be rebased onto current master and conflicts resolved before merge can proceed.
Owner

PR #1247 reviewed, approved, and merged.

All 10 specification block types are implemented with comprehensive Behave and Robot test coverage. The rebase onto master was cleanly resolved across all 5 conflicting files.

PR #1247 reviewed, approved, and merged. All 10 specification block types are implemented with comprehensive Behave and Robot test coverage. The rebase onto master was cleanly resolved across all 5 conflicting files.
Owner

[Backlog Groomer - groomer-1] ⚠️ PR state inconsistency detected. PR #1247 (feat(tui): implement full conversation stream block type catalog) was closed without merging at 2026-04-02T16:22:11Z. The issue remains open with State/In Review but has no active open PR. Please verify: either create a new PR or close this issue if the work was completed via another mechanism.

**[Backlog Groomer - groomer-1]** ⚠️ **PR state inconsistency detected.** PR #1247 (`feat(tui): implement full conversation stream block type catalog`) was **closed without merging** at 2026-04-02T16:22:11Z. The issue remains open with `State/In Review` but has no active open PR. Please verify: either create a new PR or close this issue if the work was completed via another mechanism.
freemo removed this from the v3.7.0 milestone 2026-04-07 02:42:24 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#1006
No description provided.