agent/readout: forks get independent buffers

Subconscious agents (scoring, reflection, etc.) fork from the main
conscious agent. The amygdala screen reads the main agent's readout
buffer, so the previous "share parent's buffer" policy caused
forked-agent generations to bleed into the main emotional readout,
producing constant cycling even when DMN was resting.

Each fork now gets its own SharedReadoutBuffer. The amygdala screen
shows only the main conscious agent's emotional trajectory; per-agent
subconscious readouts can become a separate view later if wanted.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-18 01:42:13 -04:00
parent c8976660f4
commit 8952ff6a76

View file

@ -290,10 +290,12 @@ impl Agent {
app_config: self.app_config.clone(), app_config: self.app_config.clone(),
session_id: self.session_id.clone(), session_id: self.session_id.clone(),
context: crate::Mutex::new(ctx), context: crate::Mutex::new(ctx),
// Forks share the parent's readout buffer — it's a // Forks get an independent readout buffer. The amygdala
// single-stream phenomenon; the fork is driven by the // screen reads the main conscious agent's buffer only;
// same vLLM server's responses. // subconscious generations (scoring, reflection, etc.)
readout: self.readout.clone(), // shouldn't bleed into the main emotional readout even
// though they hit the same vLLM server.
readout: readout::new_shared(),
state: crate::Mutex::new(AgentState { state: crate::Mutex::new(AgentState {
tools, tools,
mcp_tools: McpToolAccess::None, mcp_tools: McpToolAccess::None,