Conversation
prompt_toolkit 3.0+ changed run_in_terminal() to return an Awaitable[_T] (asyncio.Future). Hermes discarded it at two call sites, causing RuntimeWarning on /new, /reset, /undo confirmation. Capture the returned Future and block until completion via threading.Event + add_done_callback, with a 60s timeout. Closes NousResearch#23297, closes NousResearch#22970 Co-authored-by: Bartok9 <...@...>
Contributor
Collaborator
|
This looks implemented on current Evidence from this automated hermes-sweeper review:
Thanks for the PR and the clear analysis. The specific warning path it targeted has been resolved on main by the merged fixes above. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
prompt_toolkit.application.run_in_terminal()returns anAwaitable[_T](anasyncio.Future) since prompt_toolkit 3.0+. Hermes discards the return value at two call sites, triggering:Affects
/new,/reset,/undoslash commands dispatched from theprocess_loopdaemon thread.Fix
Capture the returned Future and block until completion via
threading.Event+add_done_callback, with a 60s timeout.Changed
_run_curses_picker()— block on_pick()future_prompt_text_input()— block on_ask()futureWhy not
asyncio.ensure_future()?These call sites depend on
result[0]being set before returning, so fire-and-forget is insufficient. Thethreading.Eventpattern ensures the scheduled coroutine completes before we read the result.Related
_pt_print_safe._scheduleviaensure_future)