Skip to content

fix(tui): make action_show_agent_picker async#5685

Open
alidevh wants to merge 1 commit intoaden-hive:mainfrom
alidevh:fix/5627-agents-async-contract
Open

fix(tui): make action_show_agent_picker async#5685
alidevh wants to merge 1 commit intoaden-hive:mainfrom
alidevh:fix/5627-agents-async-contract

Conversation

@alidevh
Copy link

@alidevh alidevh commented Mar 3, 2026

Description

Fix crash in TUI when /agents is invoked. The AdenTUI.action_show_agent_picker method is now defined as async def to match the awaited call in the chat REPL. This prevents TypeError: object NoneType cannot be used in 'await' expression.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Related Issues

Fixes #5627

Changes Made

  • Declared AdenTUI.action_show_agent_picker as async def.

Testing

Describe the tests you ran to verify your changes:

  • Manual verification:

    1. Launch Hive TUI (hive tui --model ollama/llama2 or set HIVE_MODEL).
    2. Enter /agents.
    3. Agent picker appears without exception.
    4. Selecting an agent works normally.
  • Existing unit tests pass (no TUI tests currently exist for this flow).

  • Lint passes (ruff check .).


Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • My changes include unit tests where applicable (manual verification used)
  • New and existing unit tests pass locally with my changes

Screenshots (if applicable)

N/A — no UI changes, only TUI behavior fix.

The chat-repl command handler unconditionally awaited
app.action_show_agent_picker().  Previously the action was a plain
method, causing a TypeError (“await NoneType”) and crashing the TUI
whenever `/agents` was executed.

This change declares the method as an async coroutine so the caller and
callee agree.  No behaviour change beyond fixing the crash.

Manual smoke test:

  1. start Ollama (or any LiteLLM provider)
  2. launch `hive tui --model ollama/llama2`
  3. type `/agents` – picker appears without error

No unit tests exist for the TUI widgets; the issue can be reproduced
and verified interactively.

Closes aden-hive#5627.
@alidevh alidevh changed the title tui: make action_show_agent_picker async fix(tui): make action_show_agent_picker async Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: /agents command crashes TUI due to awaiting non-async action_show_agent_picker()

1 participant