fix(claudbg-eej6,claudbg-80fb): fix two TUI session/agent transcript bugs
fix(claudbg-eej6): wrap Handle::block_on with block_in_place in TUI
load_transcript_for_session and load_transcript_for_agent called
Handle::current().block_on() from within the tokio::main async context,
causing a panic on session selection. Wrap with block_in_place() to
signal the scheduler to move other tasks off the thread before blocking.
fix(claudbg-80fb): add #[serde(rename = "sessionId")] to RawEntry.session_id
The JSONL field is camelCase ("sessionId") but serde matched only the
literal field name, so session_id always deserialized as None. This made
AgentRef.session_id default to "", and since any_str.starts_with("") is
always true, load_transcript_for_agent matched the wrong session and
found no agent, leaving sub-agent transcripts permanently empty.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main
parent
5bc207c455
commit
96fc4d948d
@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
# claudbg-80fb
|
||||||
|
title: 'TUI sub-agent transcript always empty: sessionId serde rename missing'
|
||||||
|
status: completed
|
||||||
|
type: bug
|
||||||
|
priority: normal
|
||||||
|
created_at: 2026-03-31T22:32:07Z
|
||||||
|
updated_at: 2026-03-31T22:33:04Z
|
||||||
|
---
|
||||||
|
|
||||||
|
When selecting a sub-agent in the TUI transcript screen, the transcript is always empty.
|
||||||
|
|
||||||
|
Root cause: RawEntry.session_id has no #[serde(rename = "sessionId")] attribute. The JSONL field is camelCase ("sessionId") but serde only matches literal field names, so entry.session_id is always None after deserialization.
|
||||||
|
|
||||||
|
This causes read_session_id_from_first_line (discovery.rs) to always return None, so AgentRef.session_id defaults to empty string.
|
||||||
|
|
||||||
|
In load_transcript_for_agent, the find predicate uses s.session_id.starts_with(parent_session_id) — and in Rust, any_string.starts_with("") is always true. So it matches the first session in filesystem order (wrong session), fails to find the agent there, and returns with no entries loaded.
|
||||||
|
|
||||||
|
Fix: Add #[serde(rename = "sessionId")] to RawEntry.session_id in models/session.rs.
|
||||||
|
|
||||||
|
## Summary of Changes
|
||||||
|
|
||||||
|
Added `#[serde(rename = "sessionId")]` to `RawEntry.session_id` in `src/models/session.rs`.
|
||||||
|
|
||||||
|
This causes `read_session_id_from_first_line` to correctly parse the parent session UUID from agent JSONL files, so `AgentRef.session_id` is populated with the real UUID instead of defaulting to empty string. The TUI `load_transcript_for_agent` function then correctly locates the parent session and loads the agent transcript.
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
# 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.
|
||||||
Loading…
Reference in New Issue