mirror of
https://github.com/RightNow-AI/openfang.git
synced 2026-07-30 23:05:08 +00:00
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:
co-authored by
Claude Sonnet 4.6
parent
905cfd2c21
commit
52647b2996
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user