From 52647b299693a10ad46cf6cd0c1245ddf3d233a3 Mon Sep 17 00:00:00 2001 From: Mark B Date: Sun, 15 Mar 2026 07:44:22 -0400 Subject: [PATCH] agent rename fix * feat: add release-fast Cargo profile for faster dev builds Introduces a `release-fast` profile that inherits from `release` but uses thin LTO and 8 codegen units instead of full LTO + 1, cutting link time significantly while remaining fast enough for integration testing. Documents usage in CONTRIBUTING.md. Co-Authored-By: Claude Sonnet 4.6 * fix: allow renaming an agent to its current name AgentRegistry::update_name was calling name_index.contains_key() without excluding the agent being renamed. Renaming to the same name always returned AgentAlreadyExists instead of succeeding silently. Fix: only error when a *different* agent owns the target name. Co-Authored-By: Claude Sonnet 4.6 --------- Co-authored-by: Claude Sonnet 4.6 --- crates/openfang-kernel/src/registry.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/openfang-kernel/src/registry.rs b/crates/openfang-kernel/src/registry.rs index f1f18dbf..b3c3a496 100644 --- a/crates/openfang-kernel/src/registry.rs +++ b/crates/openfang-kernel/src/registry.rs @@ -248,8 +248,12 @@ impl AgentRegistry { /// Update an agent's name (also updates the name index). pub fn update_name(&self, id: AgentId, new_name: String) -> OpenFangResult<()> { - if self.name_index.contains_key(&new_name) { - return Err(OpenFangError::AgentAlreadyExists(new_name)); + if let Some(existing_id) = self.name_index.get(&new_name).as_deref().copied() { + if existing_id != id { + return Err(OpenFangError::AgentAlreadyExists(new_name)); + } + // Same agent owns this name — no-op + return Ok(()); } let mut entry = self .agents