Skip to content

_cmd_search runs two independent API round trips sequentially #32

Description

@CryptoJones

Location: src/perplexity_agent/tui/app.py:194-198

_cmd_search awaits assistant.search(rest) and then assistant.answer(rest, ...) sequentially, but the answer call does not consume the search results.

Cost: the user waits the sum of two independent network round trips (often several seconds each) on every /search.

Suggested fix: run them concurrently with asyncio.gather, rendering each as it completes.

Found by /code-review (high effort).

Activity

  1. CryptoJones commented on Jun 15, 2026

    @CryptoJones
    OwnerAuthor

    Fixed: _cmd_search runs search + answer concurrently via asyncio.gather(..., return_exceptions=True) (tui/app.py:216).

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions