From e24060440fc916426819b196cd93f221d00444f7 Mon Sep 17 00:00:00 2001 From: jsun-m <91754185+jsun-m@users.noreply.github.com> Date: Thu, 21 May 2026 17:44:36 -0700 Subject: [PATCH] fix(agent-api): surface "## Open" bullet questions in the Asks panel The /tasks/active question parser only recognised a `## ` section as a question if its body contained `**Status:**` or `**Options:**` metadata. The proactive loop writes pending questions as plain bullet items under a single `## Open` header (per CLAUDE.md and the proactive-loop skill), so every loop-written question was silently skipped and the web UI Asks panel stayed empty. Parse each top-level bullet under `## Open` as its own question; skip bullets already annotated FIXED/RESOLVED/ANSWERED, and never surface the `## Resolved` section. Standalone `## ` + `**Status:**` sections are unaffected. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/agent-api.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/agent-api.py b/src/agent-api.py index 7b18c5f290..c394de1fa7 100644 --- a/src/agent-api.py +++ b/src/agent-api.py @@ -387,6 +387,29 @@ def do_GET(self): lines = section.strip().split('\n') title = lines[0].strip() body = '\n'.join(lines[1:]) + # The "## Open" section holds questions as top-level + # bullet items — the format the proactive loop writes + # (see CLAUDE.md / the proactive-loop skill). Surface + # each bullet as its own question so loop-written + # questions are not invisible to the web UI Asks panel. + if title.lower() == 'open': + for j, bullet in enumerate( + re.findall(r'^- (.+)$', body, flags=re.MULTILINE) + ): + # Skip bullets already annotated fixed/resolved. + if re.search(r'\b(FIXED|RESOLVED|ANSWERED)\b', bullet): + continue + m = re.match(r'\*\*(.+?)\*\*', bullet) + b_title = m.group(1).strip() if m else bullet[:80].strip() + questions.append({ + "id": f"Q{i}-{j}", + "text": b_title, + "detail": bullet.strip(), + }) + continue + # The "## Resolved" section is never surfaced. + if title.lower() == 'resolved': + continue # Skip preamble (sections without question metadata) if '**Status:**' not in body and '**Options:**' not in body: continue