Fix bracket field handling: support both int and dict from AI response

This commit is contained in:
KoalaTrapLord authored and GitHub committed 2026-03-19 08:25:23 -04:00
1 parent 0f2d3583ac
commit c6d02fd38c
1 file changed
+1 -1
+1 -1
View File
@@ -247,7 +247,7 @@ class DeckGeneratorV3:
truncated = card_count < 90 # Commander decks should have ~100 cards
logger.info("Deck generated: %d cards, bracket %d%s",
card_count,
raw_deck.get("bracket", {}).get("level", 0),
(raw_deck.get("bracket", {}).get("level", 0) if isinstance(raw_deck.get("bracket"), dict) else raw_deck.get("bracket", 0)),
" (TRUNCATED — response may have hit token limit)" if truncated else "")
# Step 5: Check ownership and build enriched card list