consciousness/src/subconscious
ProofOfConcept fb54488f30 agent: don't hold agent lock across I/O
The agent lock was held for the entire duration of turn() — including
API streaming and tool dispatch awaits. This blocked the UI thread
whenever it needed the lock (render tick, compaction check, etc.),
causing 20+ second freezes.

Fix: turn() takes Arc<Mutex<Agent>> and manages locking internally.
Lock is held briefly for prepare/process phases, released during all
I/O (streaming, tool awaits, sleep retries). Also:

- check_compaction: spawns task instead of awaiting on event loop
- start_memory_scoring: already spawned, no change needed
- dispatch_tool_call_unlocked: drops lock before tool handle await
- Subconscious screen: renders all agents from state dynamically
  (no more hardcoded SUBCONSCIOUS_AGENTS list)
- Memory scoring shows n/m progress in snapshots

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-04-04 04:23:29 -04:00
..
agents replace hardcoded personal names with config values 2026-04-02 19:45:35 -04:00
prompts Delete dead prompts 2026-04-03 19:29:52 -04:00
api.rs Move API code from user/ to agent/ 2026-04-04 00:34:48 -04:00
audit.rs subconscious: flatten agents/ nesting, move prompts in 2026-03-25 01:10:25 -04:00
consolidate.rs subconscious: flatten agents/ nesting, move prompts in 2026-03-25 01:10:25 -04:00
daemon.rs move Claude Code-specific code from thalamus/ to claude/ 2026-04-03 19:26:24 -04:00
defs.rs remove dead transcript mining pipeline 2026-04-02 21:42:03 -04:00
digest.rs digest: use created_at instead of timestamp for date matching 2026-03-26 19:18:14 -04:00
knowledge.rs fixup: consolidate tool types, fix build after reorganization 2026-04-03 23:21:16 -04:00
llm.rs vLLM priority scheduling for agents 2026-04-01 23:21:39 -04:00
mod.rs move Claude Code-specific code from thalamus/ to claude/ 2026-04-03 19:26:24 -04:00
prompts.rs delete dead load_prompt (orphaned by split_* removal) 2026-04-02 16:22:34 -04:00
subconscious.rs agent: don't hold agent lock across I/O 2026-04-04 04:23:29 -04:00