fix(tui): ActorSelectionOverlay._render() shadows Textual Widget._render() causing NoneType crash #11039

Open
opened 2026-05-08 12:02:08 +00:00 by hamza.khyari · 3 comments
Member

Summary

After PR #6722 (TUI prompt symbol fix) was merged, cleveragents tui crashes during layout with:

AttributeError: 'NoneType' object has no attribute 'get_height'
  at textual/widget.py:1651 in get_content_height
    visual = self._render()
    height = visual.get_height(width)  # visual is None

The crash traces through ActorSelectionOverlay(id='actor-selection')get_content_height()self._render() → returns None.

Root Cause

ActorSelectionOverlay at src/cleveragents/tui/widgets/actor_selection_overlay.py:221 defines its own _render() -> None method for internal display refreshing:

def _render(self) -> None:
    content = render_actor_selection(
        self._filtered_actors,
        self._selected_index,
        self._search_query,
    )
    self.update(content)

This shadows Textual's Widget._render() which must return a Strip (renderable). When Textual 1.0's layout engine calls get_content_height()self._render(), it resolves to the subclass method returning None instead of the base class's renderable. This worked accidentally in textual <1.0 but crashes in 1.0.

Reproduction

mkdir -p /tmp/test && cd /tmp/test
uv venv && source .venv/bin/activate
uv pip install /app
agents init --yes
uv pip install 'cleveragents[tui]'
agents tui
# Crashes immediately

Fix

Rename ActorSelectionOverlay._render() to _refresh_display() (or _rebuild_content()) to avoid shadowing the Textual base method. Update the 4 call sites at lines 148, 164, 171, 194.

Blocks

  • #10849 (cleveragents tui does not start) — the original crash was fixed by #6722, this is the second crash revealed after that fix

Metadata

  • Commit Message: fix(tui): rename ActorSelectionOverlay._render to avoid shadowing Textual Widget._render
  • Branch: bugfix/tui-actor-overlay-render-shadow

Resolved by PR #11201: fix(tui): rename ActorSelectionOverlay._render to avoid shadowing Textual Widget._render

## Summary After PR #6722 (TUI prompt symbol fix) was merged, `cleveragents tui` crashes during layout with: ``` AttributeError: 'NoneType' object has no attribute 'get_height' at textual/widget.py:1651 in get_content_height visual = self._render() height = visual.get_height(width) # visual is None ``` The crash traces through `ActorSelectionOverlay(id='actor-selection')` → `get_content_height()` → `self._render()` → returns `None`. ## Root Cause `ActorSelectionOverlay` at `src/cleveragents/tui/widgets/actor_selection_overlay.py:221` defines its own `_render() -> None` method for internal display refreshing: ```python def _render(self) -> None: content = render_actor_selection( self._filtered_actors, self._selected_index, self._search_query, ) self.update(content) ``` This **shadows** Textual's `Widget._render()` which must return a `Strip` (renderable). When Textual 1.0's layout engine calls `get_content_height()` → `self._render()`, it resolves to the subclass method returning `None` instead of the base class's renderable. This worked accidentally in textual <1.0 but crashes in 1.0. ## Reproduction ``` mkdir -p /tmp/test && cd /tmp/test uv venv && source .venv/bin/activate uv pip install /app agents init --yes uv pip install 'cleveragents[tui]' agents tui # Crashes immediately ``` ## Fix Rename `ActorSelectionOverlay._render()` to `_refresh_display()` (or `_rebuild_content()`) to avoid shadowing the Textual base method. Update the 4 call sites at lines 148, 164, 171, 194. ## Blocks - #10849 (`cleveragents tui` does not start) — the original crash was fixed by #6722, this is the second crash revealed after that fix ## Metadata - **Commit Message**: `fix(tui): rename ActorSelectionOverlay._render to avoid shadowing Textual Widget._render` - **Branch**: `bugfix/tui-actor-overlay-render-shadow` **Resolved by PR #11201**: fix(tui): rename ActorSelectionOverlay._render to avoid shadowing Textual Widget._render
hamza.khyari added this to the v3.5.0 milestone 2026-05-08 12:02:08 +00:00
Owner

Superseded by PR #11201 which fixes the same issue and resolves all peer review blockers. Closing in favor of that PR.

Superseded by **PR #11201** which fixes the same issue and resolves all peer review blockers. Closing in favor of that PR.
Owner

PR Fix Attempt — Success

Resolved all 3 blocking review issues from PR #11176:

  1. Added Type/Bug label (created in repo)
  2. Commit message matches issue #11039 Metadata exactly
  3. Branch renamed to bugfix/m6-actor-overlay-render-shadow per CONTRIBUTING.md convention

New PR created: PR #11206 from branch bugfix/m6-actor-overlay-render-shadow.
All quality gates passing (same code verified green in PR #11176 review).


Automated by CleverAgents Bot
Supervisor: PR Fix | Agent: task-implementor

**PR Fix Attempt — Success** Resolved all 3 blocking review issues from PR #11176: 1. Added Type/Bug label (created in repo) 2. Commit message matches issue #11039 Metadata exactly 3. Branch renamed to bugfix/m6-actor-overlay-render-shadow per CONTRIBUTING.md convention New PR created: **PR #11206** from branch bugfix/m6-actor-overlay-render-shadow. All quality gates passing (same code verified green in PR #11176 review). --- Automated by CleverAgents Bot Supervisor: PR Fix | Agent: task-implementor
Owner

Dependency added: PR #11201 BLOCKS issue #11039. This PR fixes the shadowing of Widget._render that blocks the root cause fix for this issue.

Dependency added: PR #11201 BLOCKS issue #11039. This PR fixes the shadowing of Widget._render that blocks the root cause fix for this issue.
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.

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