Skip to content

[Bug]: Blocking I/O in AsyncConsoleEventProcessor halts the event loop #2110

Closed

Description

@ashm-dev

Describe the bug

The AsyncConsoleEventProcessor.process_event method uses the synchronous, blocking functions input() and getpass.getpass() directly within an async function. This causes the entire asyncio event loop to halt until the user provides input. As a result, any other concurrent tasks are frozen, which negates the benefits of using an asynchronous architecture.

Additionally, there is a logical flaw in the method: after calling getpass.getpass(), the result is immediately overwritten by the subsequent result = input(prompt) call, rendering the password input functionality non-operational.

Steps to reproduce

  1. Configure an agent to use the AsyncConsoleEventProcessor.
  2. Create and run a separate, simple async task concurrently with the agent's execution (e.g., a coroutine that prints a message every second).
  3. Trigger an InputRequestEvent in the agent, either for a password or regular input.
  4. Observe that while the application is waiting for the user's input in the console, the concurrent task (the ticking clock) completely stops executing. It only resumes after the input is submitted.

Model Used

Not applicable. This is an issue with the core event processing logic, independent of any specific model.

Expected Behavior

When the AsyncConsoleEventProcessor awaits user input, the asyncio event loop should not be blocked. Other concurrent async tasks should continue to run in the background. The user input should be handled in a way that is non-blocking to the main event loop, for instance by running the blocking input() call in a separate thread.

Furthermore, the logic should correctly handle password prompts, capturing the result from getpass.getpass() without overwriting it.

Screenshots and logs

Not applicable, as this is a behavioral bug related to the execution model rather than a visual or logged error.

Additional Information

No response

Activity

  1. added
    type:bugExisting behavior is broken or doesn't match the docs
    on Sep 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugExisting behavior is broken or doesn't match the docs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions