Skip to content

Commit e58d076

Browse files
committed
Fix save_outputs error: correct structure access for saved file paths
- Fix AttributeError when accessing saved file paths - save_all_markmaps returns {"md": Path, "html": Path}, not nested dict - Correctly display saved file names for both MD and HTML outputs
1 parent e99ac5e commit e58d076

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

tools/ai-markmap-agent/src/graph.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,11 +1163,18 @@ def save_outputs(state: WorkflowState) -> WorkflowState:
11631163
# Show what was actually saved
11641164
print(f"\n ✓ Saved {len(saved)} output file(s):")
11651165
for output_key, file_paths in saved.items():
1166-
md_file = file_paths.get("markdown", {}).get("path", "N/A")
1167-
html_file = file_paths.get("html", {}).get("path", "N/A")
1166+
# save_all_markmaps returns: {"md": Path, "html": Path}
1167+
md_file = file_paths.get("md", "N/A")
1168+
html_file = file_paths.get("html", "N/A")
11681169
print(f" - {output_key}:")
1169-
print(f" MD: {md_file.name if hasattr(md_file, 'name') else md_file}")
1170-
print(f" HTML: {html_file.name if hasattr(html_file, 'name') else html_file}")
1170+
if isinstance(md_file, Path):
1171+
print(f" MD: {md_file.name}")
1172+
else:
1173+
print(f" MD: {md_file}")
1174+
if isinstance(html_file, Path):
1175+
print(f" HTML: {html_file.name}")
1176+
else:
1177+
print(f" HTML: {html_file}")
11711178
except Exception as e:
11721179
error_msg = f"Error saving outputs: {e}"
11731180
state["errors"].append(error_msg)

0 commit comments

Comments
 (0)