From 5ba8399bb27cd44144222eba34747bfb79dd368f Mon Sep 17 00:00:00 2001 From: robertcprice Date: Wed, 3 Jun 2026 20:29:48 -0400 Subject: [PATCH] Fix crash when tool_use input is a list instead of dict Some Claude Code JSONL transcripts have tool_use blocks where the `input` field is a list rather than a dict (e.g. multi-content tool calls). This causes an AttributeError on line 554 when code tries to call `.get()` on the list. Guard by normalizing list inputs to an empty dict, allowing mining to proceed without losing other tool metadata. Fixes: mining Claude Code conversations crashes with AttributeError: 'list' object has no attribute 'get' at normalize.py:554 --- mempalace/normalize.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mempalace/normalize.py b/mempalace/normalize.py index ca62cca..c34a225 100644 --- a/mempalace/normalize.py +++ b/mempalace/normalize.py @@ -523,6 +523,8 @@ def _format_tool_use(block: dict) -> str: """Format a tool_use block into a human-readable one-liner.""" name = block.get("name", "Unknown") inp = block.get("input", {}) + if isinstance(inp, list): + inp = {} if name == "Bash": cmd = inp.get("command", "")