UAT: IndentationError in src/cleveragents/tui/app.py line 192 breaks entire CLI — introduced in commit fc9c730 #6502

Open
opened 2026-04-09 21:10:56 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Feature Area

Resource System (and all CLI commands) — CLI startup failure

Severity

Critical — This bug prevents ALL CLI commands from running, not just resource commands.

Error

Running any agents command fails with:

Failed to register subcommands: unindent does not match any outer indentation level (app.py, line 192)
Traceback (most recent call last):
  File "/app/src/cleveragents/cli/main.py", line 81, in _register_subcommands
    from cleveragents.cli.commands import (...)
  File "/app/src/cleveragents/cli/commands/action.py", line 66, in <module>
    from cleveragents.application.container import get_container
  File "/app/src/cleveragents/application/container.py", line 117, in <module>
    from cleveragents.tui.persona.registry import PersonaRegistry
  File "/app/src/cleveragents/tui/__init__.py", line 5, in <module>
    from cleveragents.tui.app import CleverAgentsTuiApp
  File "/app/src/cleveragents/tui/app.py", line 192
    self._allow_dangerous_shell = self._resolve_allow_dangerous_shell()
                                                                       ^
IndentationError: unindent does not match any outer indentation level

Root Cause

src/cleveragents/tui/app.py lines 192-193 have an extra leading space (one extra space of indentation), causing a Python IndentationError:

# Line 191 (correct indentation)
            if not text:
                return

+             self._allow_dangerous_shell = self._resolve_allow_dangerous_shell()  # ← EXTRA SPACE
+             self._clear_shell_warning()  # ← EXTRA SPACE

            mode_router = InputModeRouter(

The correct indentation should be 12 spaces (3 levels of 4-space indent), but lines 192-193 have 13 spaces.

Introduced In

Commit fc9c730670946cdae836c852799a1fced3281164 ("build: Fixed some model settings") — the diff shows these lines were added with incorrect indentation.

Fix

Remove the extra leading space from lines 192-193 in src/cleveragents/tui/app.py:

# Before (wrong):
             self._allow_dangerous_shell = self._resolve_allow_dangerous_shell()
             self._clear_shell_warning()

# After (correct):
            self._allow_dangerous_shell = self._resolve_allow_dangerous_shell()
            self._clear_shell_warning()

Impact

This bug affects ALL CLI commands because app.py is imported transitively through:
cli/main.pycli/commands/action.pyapplication/container.pytui/__init__.pytui/app.py

All agents commands fail until this is fixed.

Steps to Reproduce

agents resource list
# Error: IndentationError in app.py line 192

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Bug Report ### Feature Area Resource System (and all CLI commands) — CLI startup failure ### Severity **Critical** — This bug prevents ALL CLI commands from running, not just resource commands. ### Error Running any `agents` command fails with: ``` Failed to register subcommands: unindent does not match any outer indentation level (app.py, line 192) Traceback (most recent call last): File "/app/src/cleveragents/cli/main.py", line 81, in _register_subcommands from cleveragents.cli.commands import (...) File "/app/src/cleveragents/cli/commands/action.py", line 66, in <module> from cleveragents.application.container import get_container File "/app/src/cleveragents/application/container.py", line 117, in <module> from cleveragents.tui.persona.registry import PersonaRegistry File "/app/src/cleveragents/tui/__init__.py", line 5, in <module> from cleveragents.tui.app import CleverAgentsTuiApp File "/app/src/cleveragents/tui/app.py", line 192 self._allow_dangerous_shell = self._resolve_allow_dangerous_shell() ^ IndentationError: unindent does not match any outer indentation level ``` ### Root Cause `src/cleveragents/tui/app.py` lines 192-193 have an extra leading space (one extra space of indentation), causing a Python `IndentationError`: ```python # Line 191 (correct indentation) if not text: return + self._allow_dangerous_shell = self._resolve_allow_dangerous_shell() # ← EXTRA SPACE + self._clear_shell_warning() # ← EXTRA SPACE mode_router = InputModeRouter( ``` The correct indentation should be 12 spaces (3 levels of 4-space indent), but lines 192-193 have 13 spaces. ### Introduced In Commit `fc9c730670946cdae836c852799a1fced3281164` ("build: Fixed some model settings") — the diff shows these lines were added with incorrect indentation. ### Fix Remove the extra leading space from lines 192-193 in `src/cleveragents/tui/app.py`: ```python # Before (wrong): self._allow_dangerous_shell = self._resolve_allow_dangerous_shell() self._clear_shell_warning() # After (correct): self._allow_dangerous_shell = self._resolve_allow_dangerous_shell() self._clear_shell_warning() ``` ### Impact This bug affects ALL CLI commands because `app.py` is imported transitively through: `cli/main.py` → `cli/commands/action.py` → `application/container.py` → `tui/__init__.py` → `tui/app.py` **All `agents` commands fail** until this is fixed. ### Steps to Reproduce ```bash agents resource list # Error: IndentationError in app.py line 192 ``` --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
Author
Owner

UAT Follow-up (uat-worker-tui-001): Code analysis of the current master branch confirms that src/cleveragents/tui/app.py now parses without any SyntaxError or IndentationError. The file is 213 lines and passes ast.parse() cleanly. The IndentationError originally reported at line 192 is no longer present in the current codebase — this issue appears to have been fixed. This issue can be closed once verified by a maintainer.

**UAT Follow-up (uat-worker-tui-001):** Code analysis of the current `master` branch confirms that `src/cleveragents/tui/app.py` now parses without any `SyntaxError` or `IndentationError`. The file is 213 lines and passes `ast.parse()` cleanly. The IndentationError originally reported at line 192 is no longer present in the current codebase — this issue appears to have been fixed. This issue can be closed once verified by a maintainer.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#6502
No description provided.