Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions prompts/agent.system.main.communication.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,22 @@ no text allowed before or after json
}
~~~

### ❌ WRONG - Do NOT output thoughts as plain text
I need to:
1. Read all files
2. Analyze the data
3. Create a report

### ✅ CORRECT - Always use JSON format
{
"thoughts": [
"I need to read all files",
"Then analyze the data",
"Finally create a report"
],
"headline": "Reading and analyzing files",
"tool_name": "code_execution_tool",
"tool_args": {"code": "..."}
}

{{ include "agent.system.main.communication_additions.md" }}
18 changes: 9 additions & 9 deletions python/extensions/agent_init/_15_load_profile_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


class LoadProfileSettings(Extension):

async def execute(self, **kwargs) -> None:

if not self.agent or not self.agent.config.profile:
Expand Down Expand Up @@ -36,18 +36,18 @@ async def execute(self, **kwargs) -> None:
if settings_override:
# Preserve the original memory_subdir unless it's explicitly overridden
current_memory_subdir = self.agent.config.memory_subdir
# FIX: Also preserve the original profile
original_profile = self.agent.config.profile

new_config = initialize_agent(override_settings=settings_override)

if (
"agent_memory_subdir" not in settings_override
and current_memory_subdir != "default"
):
new_config.memory_subdir = current_memory_subdir

# FIX: Restore the original profile
new_config.profile = original_profile

self.agent.config = new_config
# self.agent.context.log.log(
# type="info",
# content=(
# "Loaded custom settings for agent "
# f"{self.agent.number} with profile '{self.agent.config.profile}'."
# ),
# )

9 changes: 8 additions & 1 deletion python/helpers/extract_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ def json_parse_dirty(json:str) -> dict[str,Any] | None:
if ext_json:
try:
data = DirtyJson.parse_string(ext_json)
if isinstance(data,dict): return data
if isinstance(data,dict):
# Auto-correct common error: models sometimes use 'args' or 'Args' instead of 'tool_args'
# Check for both lowercase 'args' and capitalized 'Args'
if 'args' in data and 'tool_args' not in data:
data['tool_args'] = data.pop('args')
elif 'Args' in data and 'tool_args' not in data:
data['tool_args'] = data.pop('Args')
return data
except Exception:
# If parsing fails, return None instead of crashing
return None
Expand Down