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 <noreply@anthropic.com>

* 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 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mark B
2026-03-15 14:44:22 +03:00
committed by GitHub
co-authored by Claude Sonnet 4.6
parent 905cfd2c21
commit 52647b2996
+6 -2
View File
@@ -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