Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ jobs:
- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler

# Toolchain pinned to match rust-toolchain.toml — bump both together.
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.97.1
components: clippy

- uses: Swatinem/rust-cache@v2
Expand All @@ -40,6 +42,7 @@ jobs:

- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.97.1
components: rustfmt

- name: cargo fmt
Expand All @@ -55,6 +58,8 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler

- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.97.1

- uses: Swatinem/rust-cache@v2

Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Pinned so local builds and CI compile with the same rustc/clippy.
# CI reads this version via .github/workflows/ci.yml — bump both together.
[toolchain]
channel = "1.97.1"
components = ["clippy", "rustfmt"]
2 changes: 1 addition & 1 deletion src/api/activity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ pub(super) async fn get_activity(

let mut days: HashMap<String, ActivityDay> = HashMap::new();

for (_agent_id, pool) in pools.iter() {
for pool in pools.values() {
query_count(
pool,
"conversation_messages",
Expand Down
4 changes: 2 additions & 2 deletions src/api/channels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ pub(super) async fn channel_messages(
let limit = query.limit.min(100);
let fetch_limit = limit + 1;

for (_agent_id, pool) in pools.iter() {
for pool in pools.values() {
let logger = ProcessRunLogger::new(pool.clone());
match logger
.load_channel_timeline(&query.channel_id, fetch_limit, query.before.as_deref())
Expand Down Expand Up @@ -424,7 +424,7 @@ pub(super) async fn cancel_process(
// Fallback for detached workers (for example after restart): no live
// channel state exists, but the DB row is still marked running.
let pools = state.agent_pools.load();
for (_agent_id, pool) in pools.iter() {
for pool in pools.values() {
let logger = ProcessRunLogger::new(pool.clone());
match logger.cancel_running_detached_worker(worker_id).await {
Ok(true) => {
Expand Down
2 changes: 1 addition & 1 deletion src/api/workers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ pub(super) async fn list_workers(
let live_statuses = {
let blocks = state.channel_status_blocks.read().await;
let mut map = std::collections::HashMap::new();
for (_channel_id, status_block) in blocks.iter() {
for status_block in blocks.values() {
let block = status_block.read().await;
for worker in &block.active_workers {
map.insert(
Expand Down
9 changes: 3 additions & 6 deletions src/llm/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2318,12 +2318,9 @@ fn completion_choice_to_streaming_choices(
}

fn extract_sse_block(buffer: &mut String) -> Option<String> {
let (block_end, separator_len) = if let Some(index) = buffer.find("\n\n") {
(index, 2)
} else if let Some(index) = buffer.find("\r\n\r\n") {
(index, 4)
} else {
return None;
let (block_end, separator_len) = match buffer.find("\n\n") {
Some(index) => (index, 2),
None => (buffer.find("\r\n\r\n")?, 4),
};

let block = buffer[..block_end].to_string();
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ fn task_from_row(row: sqlx::sqlite::SqliteRow) -> Result<Task> {
.try_get::<Option<String>, _>("worker_id")
.ok()
.flatten()
.and_then(|value| if value.is_empty() { None } else { Some(value) }),
.filter(|value| !value.is_empty()),
created_by: row
.try_get("created_by")
.context("failed to read task created_by")?,
Expand Down
2 changes: 1 addition & 1 deletion src/tools/spawn_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ impl Tool for DetachedSpawnWorkerTool {
.working_memory
.emit(
crate::memory::WorkingMemoryEventType::WorkerSpawned,
format!("Worker spawned (cortex): {}", &args.task),
format!("Worker spawned (cortex): {}", args.task),
)
.importance(0.5)
.record();
Expand Down
Loading