-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
client.agents.modify reverts unspecifiable mutable arguments to default values
Describe the bug
The client.agents.modify method has critical issues when dealing with agent properties that were set during creation using client.agents.create:
modifydoes not accept all mutable arguments thatcreatedoes. For example,context_window_limit(and potentially others likeinclude_multi_agent_tools) cannot be passed as an argument toclient.agents.modify.- Because these mutable arguments cannot be specified in
modify, their values are reverted to defaults when any other modification is made. For instance, if an agent is created with a customcontext_window_limit, and thenclient.agents.modifyis used to change only the agent'sname, thecontext_window_limitwill be reset to its default value, losing the initially configured setting.
This makes client.agents.modify unusable for agents that rely on non-default settings for these particular arguments, as any modification effectively corrupts the agent's intended configuration.
To Reproduce
Steps to reproduce the behavior:
- Create an agent with a non-default
context_window_limit:initial_context_limit = 4096 # Example non-default new_agent = client.agents.create( # ... other required args ... name="Agent with Custom Context", context_window_limit=initial_context_limit ) print(f"Agent created with context_window_limit: {new_agent.context_window_limit}")
- Attempt to modify another property of the agent (e.g., its name) using
client.agents.modify. Note thatcontext_window_limitcannot be included in themodifycall's arguments.client.agents.modify( agent_id=new_agent.id, name="Updated Agent Name" )
- Fetch or inspect the agent again:
updated_agent = client.agents.get(agent_id=new_agent.id) # Or however you fetch print(f"Agent updated. Current context_window_limit: {updated_agent.context_window_limit}")
- Observe that
updated_agent.context_window_limithas reverted to the default value, instead of retaininginitial_context_limit.
Expected behavior
Ideally, client.agents.modify should:
- Accept all mutable arguments that
client.agents.createaccepts. If an agent property can be set at creation and is mutable, it should be modifiable via themodifymethod. - Preserve existing values for any mutable arguments not explicitly passed in the
modifycall. It should only change what is specified, not revert other settings to their defaults.
Environment (please complete the following information):
- Letta Client Version:
0.1.146 - Python Version:
[3.10.14]
Impact
This bug forces users to delete and recreate agents if they need to preserve non-default settings for arguments like context_window_limit while modifying other aspects, which is highly impractical.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels