From f6ce763a490775bebb2bfb915d992c22f6e941be Mon Sep 17 00:00:00 2001 From: rob Date: Sat, 1 Nov 2025 21:58:32 -0300 Subject: [PATCH] fix: default missing status field to OPEN in question formatting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix question extraction bug where AI-generated questions were being filtered out due to missing 'status' field. **Root Cause:** The AI agents module returns questions without a 'status' field: {'participant': 'Bob', 'question': 'text', 'line': 'original'} But format_questions_section() filtered for status == "OPEN": open_questions = [q for q in questions if q.get("status") == "OPEN"] Since AI questions had no status, q.get("status") returned None, which didn't match "OPEN", so questions were filtered out. **Fix:** Default missing status to "OPEN" in the filter: open_questions = [q for q in questions if q.get("status", "OPEN") == "OPEN"] This makes the function defensive - questions without explicit status are treated as OPEN, which matches the basic extraction behavior. **Impact:** - Questions extracted by AI agents now appear in summaries - Maintains backward compatibility with basic extraction (has status) - All 18 tests now pass (was 17/18) **Testing:** - Verified with test_run_status_updates_summary_sections - Question "What is the rollout plan?" now correctly appears in summary - No regressions in other tests Resolves test failure identified in comprehensive project review. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- automation/summary.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/automation/summary.py b/automation/summary.py index e7d8323..f4ba66d 100644 --- a/automation/summary.py +++ b/automation/summary.py @@ -85,7 +85,8 @@ def format_questions_section(questions: list[dict[str, Any]]) -> str: # Split questions by status so OPEN items stay at the top and partial answers # can be rendered with their follow-up context. - open_questions = [q for q in questions if q.get("status") == "OPEN"] + # Default to "OPEN" if status field is missing (for AI-extracted questions) + open_questions = [q for q in questions if q.get("status", "OPEN") == "OPEN"] partial_questions = [q for q in questions if q.get("status") == "PARTIAL"] if open_questions: