Skip to content

Build and run agents you can see, understand and trust.

fix(app): make workspace skill deletion idempotent (#2892)

lihongyuan990d261bc1be25
diff --git a/src/agentscope/app/_router/_workspace.py b/src/agentscope/app/_router/_workspace.py
index 90f1e7235..3f5055b75 100644
--- a/src/agentscope/app/_router/_workspace.py
+++ b/src/agentscope/app/_router/_workspace.py
@@ -395,7 +395,12 @@ async def remove_skill(
agent_id,
session_id,
)
- await workspace.remove_skill(skill_name, agent_id=agent_id)
+ try:
+ await workspace.remove_skill(skill_name, agent_id=agent_id)
+ except KeyError:
+ # ``LocalWorkspace`` already treats a missing skill as a no-op.
+ # Keep DELETE idempotent for the other workspace implementations.
+ return
# ---------------------------------------------------------------------------