Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

Disable `close_context_item` when context is empty

Reinier van der Leer249226c1e4e8
diff --git a/autogpt/commands/system.py b/autogpt/commands/system.py
index 643b67fe65..91cf6572ff 100644
--- a/autogpt/commands/system.py
+++ b/autogpt/commands/system.py
@@ -53,7 +53,7 @@ def task_complete(reason: str, agent: Agent) -> None:
"required": True,
}
},
- available=lambda a: get_agent_context(a) is not None,
+ available=lambda a: bool(get_agent_context(a)),
)
def close_context_item(index: int, agent: Agent) -> str:
assert (context := get_agent_context(agent)) is not None