Skip to content

hexis init crashes on Character path: CharacterPreview.__init__() rejects id kwarg #14

@DrGood01

Description

@DrGood01

Bug Summary

hexis init crashes in the Character path with:

TypeError: CharacterPreview.__init__() got an unexpected keyword argument 'id'

This occurs when navigating to the character gallery screen.

Reproduction

  1. Run hexis init
  2. Configure provider/model and continue
  3. Choose Character path
  4. Crash occurs when CharacterGalleryScreen is composed

Full Error (key line)

From apps/tui/init_screens.py:

yield CharacterPreview(id="char-preview")

From traceback:

TypeError: CharacterGalleryScreen() compose() method returned an invalid result; CharacterPreview.__init__() got an unexpected keyword argument 'id'

Root Cause

CharacterPreview in apps/tui/init_widgets.py defines:

def __init__(self) -> None:
    super().__init__()

so it does not accept standard Textual widget kwargs (id, classes, name, ...).

Proposed Fix

Update CharacterPreview.__init__ to forward kwargs:

def __init__(self, **kwargs: Any) -> None:
    super().__init__(**kwargs)

I also prepared a regression test:

  • tests/core/test_tui_init_widgets.py
  • Asserts CharacterPreview(id="char-preview") works.

Patch Reference

Local commit prepared: 3d9f5b3 (fix(tui/init): allow CharacterPreview widget kwargs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions