fix: coerce supporting_cluster_ids items to str in hypothesizer LLM response parsing #38

Closed
opened 2026-05-25 18:58:34 -07:00 by pyr0ball · 0 comments
Owner

Context

In app/services/diagnose/hypothesizer.py, the LLM response parsing does:

supporting_cluster_ids=tuple(item.get("supporting_clusters") or []),

If the LLM returns integers (e.g., [1, 2]) instead of strings, they are silently stored in a tuple[str, ...] typed field as ints.

Fix

supporting_cluster_ids=tuple(str(x) for x in (item.get("supporting_clusters") or [])),

Found by

Post-implementation code review of feat/29-multi-agent-diagnose.

## Context In `app/services/diagnose/hypothesizer.py`, the LLM response parsing does: ```python supporting_cluster_ids=tuple(item.get("supporting_clusters") or []), ``` If the LLM returns integers (e.g., `[1, 2]`) instead of strings, they are silently stored in a `tuple[str, ...]` typed field as ints. ## Fix ```python supporting_cluster_ids=tuple(str(x) for x in (item.get("supporting_clusters") or [])), ``` ## Found by Post-implementation code review of feat/29-multi-agent-diagnose.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Circuit-Forge/turnstone#38
No description provided.