UAT: TUI session:export and session:import slash commands not implemented in TuiCommandRouter #1341

Open
opened 2026-04-02 16:56:17 +00:00 by freemo · 0 comments
Owner

Bug Report

Feature Area: Session export/import — TUI slash commands

What Was Tested

The TUI TuiCommandRouter._session_command() method in src/cleveragents/tui/commands.py was tested against the slash command catalog in src/cleveragents/tui/slash_catalog.py.

Expected Behavior (from spec)

The slash command catalog (slash_catalog.py lines 25–26) defines two session export/import commands:

SlashCommandSpec("session:export", "Session", "Export session to JSON"),
SlashCommandSpec("session:import", "Session", "Import session from JSON"),

These should be functional when invoked from the TUI prompt (e.g., /session export, /session import).

Actual Behavior

The TuiCommandRouter._session_command() method (lines 44–48 of src/cleveragents/tui/commands.py) only handles the show subcommand:

@staticmethod
def _session_command(tokens: list[str], *, session_id: str) -> str:
    if not tokens or tokens[0] == "show":
        return f"Current session: {session_id}"
    return f"Unknown session command: {' '.join(tokens)}"

All other session subcommands — including export and import — return "Unknown session command: export" / "Unknown session command: import".

Steps to Reproduce

from cleveragents.tui.commands import TuiCommandRouter
from cleveragents.tui.persona.registry import PersonaRegistry
from cleveragents.tui.persona.state import PersonaState
from pathlib import Path
import tempfile

with tempfile.TemporaryDirectory() as tmpdir:
    registry = PersonaRegistry(config_dir=Path(tmpdir))
    state = PersonaState(registry=registry)
    router = TuiCommandRouter(persona_registry=registry, persona_state=state)
    
    print(router.handle('session export', session_id='test-session'))
    # Output: 'Unknown session command: export'
    
    print(router.handle('session import', session_id='test-session'))
    # Output: 'Unknown session command: import'

Code Location

  • Catalog definition: src/cleveragents/tui/slash_catalog.py lines 25–26
  • Missing implementation: src/cleveragents/tui/commands.py lines 44–48 (_session_command method)

Severity

High — The TUI slash commands for session export/import are advertised in the command catalog (visible to users via the slash overlay) but silently return an error string instead of performing the operation. This is a functional gap between the slash catalog and the router implementation.

Additional Context

The same issue affects other session subcommands: list, create, switch, close, delete, rename all return "Unknown session command: ...". Only show is implemented.

## Bug Report **Feature Area:** Session export/import — TUI slash commands ### What Was Tested The TUI `TuiCommandRouter._session_command()` method in `src/cleveragents/tui/commands.py` was tested against the slash command catalog in `src/cleveragents/tui/slash_catalog.py`. ### Expected Behavior (from spec) The slash command catalog (`slash_catalog.py` lines 25–26) defines two session export/import commands: ```python SlashCommandSpec("session:export", "Session", "Export session to JSON"), SlashCommandSpec("session:import", "Session", "Import session from JSON"), ``` These should be functional when invoked from the TUI prompt (e.g., `/session export`, `/session import`). ### Actual Behavior The `TuiCommandRouter._session_command()` method (lines 44–48 of `src/cleveragents/tui/commands.py`) only handles the `show` subcommand: ```python @staticmethod def _session_command(tokens: list[str], *, session_id: str) -> str: if not tokens or tokens[0] == "show": return f"Current session: {session_id}" return f"Unknown session command: {' '.join(tokens)}" ``` All other session subcommands — including `export` and `import` — return `"Unknown session command: export"` / `"Unknown session command: import"`. ### Steps to Reproduce ```python from cleveragents.tui.commands import TuiCommandRouter from cleveragents.tui.persona.registry import PersonaRegistry from cleveragents.tui.persona.state import PersonaState from pathlib import Path import tempfile with tempfile.TemporaryDirectory() as tmpdir: registry = PersonaRegistry(config_dir=Path(tmpdir)) state = PersonaState(registry=registry) router = TuiCommandRouter(persona_registry=registry, persona_state=state) print(router.handle('session export', session_id='test-session')) # Output: 'Unknown session command: export' print(router.handle('session import', session_id='test-session')) # Output: 'Unknown session command: import' ``` ### Code Location - **Catalog definition:** `src/cleveragents/tui/slash_catalog.py` lines 25–26 - **Missing implementation:** `src/cleveragents/tui/commands.py` lines 44–48 (`_session_command` method) ### Severity **High** — The TUI slash commands for session export/import are advertised in the command catalog (visible to users via the slash overlay) but silently return an error string instead of performing the operation. This is a functional gap between the slash catalog and the router implementation. ### Additional Context The same issue affects other session subcommands: `list`, `create`, `switch`, `close`, `delete`, `rename` all return `"Unknown session command: ..."`. Only `show` is implemented.
freemo self-assigned this 2026-04-02 18:45:21 +00:00
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.

Dependencies

No dependencies set.

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