Skip to main content

Module thread

Module thread 

Source
Expand description

RuntimeThreadManager split per #3313 (issue #5261).

The TUI’s crates/tui/src/runtime_threads.rs (≈8,259 lines, monitor_turn ≈1,035 lines) is the largest file in the tree. The split is pure code motion, persisted JSON shape unchanged:

  • storeRuntimeThreadStore / persisted JSON state (<root>/{threads,turns,items,events} + state.json)
  • executor — turn execution (monitor_turn, handle_deepseek_turn, steer/subagent drains, refresh_system_prompt, compaction, parallel tool exec, StuckGuard/ReadRepeatGuard/ToolCallBudget, stream retry)
  • eventsRuntimeEventEnvelope mapping + EventMsg fan-out
  • typesThreadId/SessionId, ThreadStatus, Thread etc

This cut lands the four files and the re-exports so crates/tui can pub use codewhale_core::engine::thread::* and the next slice can git mv the impls file-by-file without a flag day. The behaviour stays in the TUI until the move completes; core already owns the boundary.

Re-exports§

pub use events::*;
pub use store::*;
pub use types::*;

Modules§

events
Thread events — RuntimeEventEnvelope mapping + EventMsg fan-out (issue #5261 / #3313).
executor
Turn executor — the monitor_turn / handle_deepseek_turn leg (issue #5261 / #3313).
store
RuntimeThreadStore — persisted JSON state (issue #5261 / #3313).
types
Thread types for the crates/core boundary (issue #5261 / #3313).