Bug Description
Tasks created via the task board UI are written to disk as JSON files in the .codirigent/tasks/ directory, but they are not loaded back when Codirigent restarts. The task board starts empty every time.
Root Cause
In crates/codirigent-ui/src/workspace/gpui.rs, the init_task_manager() function creates a new TaskManager with TaskManager::new() but never calls TaskManager::load() to read existing task files from disk.
The load() method exists and works correctly — it reads all task-*.json files from the storage directory and enqueues them. It's just never invoked during app initialization.
Relevant code (gpui.rs:695-722):
fn init_task_manager(
event_bus: Arc<DefaultEventBus>,
) -> (Arc<dyn codirigent_core::StorageService>, Arc<Mutex<TaskManager>>) {
let data_dir = dirs::data_dir()
.map(|d| d.join("Codirigent"))
.unwrap_or_else(|| std::env::temp_dir().join("codirigent-fallback"));
let storage = Arc::new(FileStorageService::new(&data_dir).unwrap_or_else(|e| {
// ...
}));
let task_manager = Arc::new(Mutex::new(TaskManager::new(
TaskManagerConfig::default(),
storage.clone(),
event_bus as Arc<dyn codirigent_core::EventBus>,
)));
// ← load() is never called here
(storage, task_manager)
}
Steps to Reproduce
- Open Codirigent
- Create a task via the task board UI
- Quit Codirigent
- Reopen Codirigent
- Task board is empty
Expected Behavior
Tasks should persist across restarts. The task files exist on disk (~/Library/Application Support/Codirigent/.codirigent/tasks/task-*.json) and are intact — they're just never read back.
Suggested Fix
Call load() on the task manager after initialization. Since load() is marked async but contains no .await calls (it uses synchronous std::fs I/O), it can be called in a block_on context or spawned as a background task during startup.
Environment
- macOS (Apple Silicon)
- Codirigent v0.1.5 (installed via DMG)
Bug Description
Tasks created via the task board UI are written to disk as JSON files in the
.codirigent/tasks/directory, but they are not loaded back when Codirigent restarts. The task board starts empty every time.Root Cause
In
crates/codirigent-ui/src/workspace/gpui.rs, theinit_task_manager()function creates a newTaskManagerwithTaskManager::new()but never callsTaskManager::load()to read existing task files from disk.The
load()method exists and works correctly — it reads alltask-*.jsonfiles from the storage directory and enqueues them. It's just never invoked during app initialization.Relevant code (
gpui.rs:695-722):Steps to Reproduce
Expected Behavior
Tasks should persist across restarts. The task files exist on disk (
~/Library/Application Support/Codirigent/.codirigent/tasks/task-*.json) and are intact — they're just never read back.Suggested Fix
Call
load()on the task manager after initialization. Sinceload()is markedasyncbut contains no.awaitcalls (it uses synchronousstd::fsI/O), it can be called in ablock_oncontext or spawned as a background task during startup.Environment