Skip to content
Merged
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
6 changes: 4 additions & 2 deletions src/agentic/actor_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ class AgentPauseContext:
import ray

else:
print("Using simple Thread engine for running agents")
from .ray_mock import ray

_AGENT_REGISTRY = []
Expand Down Expand Up @@ -709,7 +708,7 @@ def custom_callback(kwargs, completion_response, start_time, end_time):


# Debug: Check if we have reasoning content
if self.debug.debug_all():
if self.debug.debug_reasoning():
debug_print(self.debug.debug_all(), f"Checking for reasoning content...")
debug_print(self.debug.debug_all(), f"Choice object attributes: {[attr for attr in dir(choice) if not attr.startswith('_')]}")
debug_print(self.debug.debug_all(), f"Message object attributes: {[attr for attr in dir(message) if not attr.startswith('_')]}")
Expand Down Expand Up @@ -1474,6 +1473,9 @@ def next_turn(self, request: str | Prompt, request_context: dict = {},
request_id=request_id,
)
)
# There's some logical issue where we have inserted 'thread_id' into the request_context, but
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@drbrady8800 this came up in some testing, where thread_context.thread_id inside a tool function was None when I expected a value. Seems like we had a case where the thread ID wouldn't get passed down into the agent loop properly.

# we already made the request a Prompt with a context that was missing the thread id
prompt.request_context.update(request_context)


# Transmit depth through the Prompt
Expand Down
4 changes: 1 addition & 3 deletions src/agentic/db/db_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,11 @@ def _add_depth_column_if_missing(db_path: str):
columns = [column[1] for column in cursor.fetchall()]

if 'depth' not in columns:
print("Adding depth column to thread_logs table...")
try:
cursor.execute("ALTER TABLE thread_logs ADD COLUMN depth INTEGER DEFAULT 0;")
conn.commit()
print("Depth column added successfully!")
except sqlite3.OperationalError as e:
print(f"Error adding depth column: {e}")
pass

conn.close()

Expand Down
9 changes: 8 additions & 1 deletion src/agentic/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,14 @@ def __init__(self, agent: str, name: str, arguments: dict, depth: int = 0, tool_

def __str__(self):
name = self.payload["name"]
return " " * (self.depth + 1) + f"[TOOL: {name} >> ({self.arguments})]\n"
print_args = self.arguments.copy()
if 'run_context' in print_args or 'thread_context' in print_args:
rc_arg = print_args.pop('run_context', print_args.pop('thread_context', None))
print_args.pop('run_context', None)
print_args.pop('thread_context', None)
if rc_arg:
print_args['run_context'] = rc_arg.get_context().keys()
return " " * (self.depth + 1) + f"[TOOL: {name} >> ({print_args})]\n"

def to_llm_message(self) -> Optional[Dict[str, Any]]:
"""Convert event to LLM message format"""
Expand Down
3 changes: 3 additions & 0 deletions src/agentic/swarm/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ def debug_llm(self):
def debug_agents(self):
return self.level == "all" or "agents" in self.level

def debug_reasoning(self):
return "reasoning" in self.level

def debug_all(self):
return self.level == "all"

Expand Down