You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
1.1 KiB
Markdown
22 lines
1.1 KiB
Markdown
---
|
|
# claudbg-eej6
|
|
title: 'TUI session select panics: Handle::block_on called from within async context'
|
|
status: completed
|
|
type: bug
|
|
priority: normal
|
|
created_at: 2026-03-31T22:15:18Z
|
|
updated_at: 2026-03-31T22:16:16Z
|
|
---
|
|
|
|
When selecting a session in the TUI, a panic occurs because load_transcript_for_session (and load_transcript_for_agent) calls tokio::runtime::Handle::current().block_on() from within the tokio::main async context. block_on cannot be called from within an async context — the thread is already driving async tasks.
|
|
|
|
Root cause: transcript.rs lines 487-489 and 528-530 use Handle::current().block_on() which panics when the calling thread is already inside a tokio runtime (as it is, since main.rs uses #[tokio::main]).
|
|
|
|
Fix: Wrap both block_on calls with tokio::task::block_in_place(), which tells the multi-thread scheduler to move other tasks off the current thread before blocking.
|
|
|
|
## Summary of Changes
|
|
|
|
Replaced with in both and (transcript.rs).
|
|
|
|
signals the tokio multi-thread scheduler to move other tasks off the current OS thread before blocking it, which is required when blocking from synchronous code called within an async context.
|