Skip to content

Commit

Permalink
fix: Remove references to non-existent cells and simplify thought f…
Browse files Browse the repository at this point in the history
…ormatting
  • Loading branch information
swellington committed Nov 14, 2024
1 parent 1116202 commit 496708f
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/api/openrouter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,19 +510,12 @@ impl OpenRouterClient {

// Collect recent thoughts from all cells
let mut all_recent_thoughts = Vec::new();
for cell in self.cells.values() {
all_recent_thoughts.extend(cell.thoughts.iter()
.rev()
.take(10)
.cloned());
}

// Format recent thoughts context
let recent_thoughts_context = if !all_recent_thoughts.is_empty() {
let recent_thoughts_context = if !recent_thoughts.is_empty() {
format!("\nRECENT COLONY THOUGHTS:\n{}",
all_recent_thoughts.iter()
recent_thoughts.iter()
.take(10)
.map(|t| format!("- [{}] {}", t.id, t.content))
.map(|t| format!("- {}", t.content))
.collect::<Vec<_>>()
.join("\n"))
} else {
Expand Down

0 comments on commit 496708f

Please sign in to comment.