Skip to content

Commit b7a3ffb

Browse files
committed
fix: better logging
Signed-off-by: Marco Trinelli (mtrinell) <[email protected]>
1 parent 5a2f2f4 commit b7a3ffb

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Diff for: src/agent_workflow_server/agents/load.py

+8
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ def _read_manifest(path: str) -> AgentACPDescriptor:
7171

7272

7373
def _resolve_agent(name: str, path: str) -> AgentInfo:
74+
if ":" not in path:
75+
raise ValueError(
76+
f"""Invalid format for AGENTS_REF environment variable. \
77+
Value must be a module:var pair. \
78+
Example: "agent1_module:agent1_var" or "path/to/file.py:agent1_var"
79+
Got: {path}"""
80+
)
81+
7482
module_or_file, export_symbol = path.split(":", 1)
7583
if not os.path.isfile(module_or_file):
7684
# It's a module (name), try to import it

Diff for: src/agent_workflow_server/services/queue.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,13 @@ async def worker(worker_id: int):
126126
DB.update_run_info(run_id, run_info)
127127

128128
try:
129-
validate_output(run_id, run["agent_id"], last_message.data)
130129
log_run(
131130
worker_id,
132131
run_id,
133132
"got message",
134133
message_data=json.dumps(last_message.data),
135134
)
135+
validate_output(run_id, run["agent_id"], last_message.data)
136136
DB.add_run_output(run_id, last_message.data)
137137
await Runs.Stream.publish(run_id, Message(type="control", data="done"))
138138
if last_message.type == "interrupt":

0 commit comments

Comments
 (0)