Skip to content
This repository was archived by the owner on Jul 16, 2026. It is now read-only.

fix(agent-api): surface "## Open" bullet questions in the Asks panel - #46

Merged
rickchen007 merged 1 commit into
mainfrom
fix/agent-api-asks-bullet-format
May 22, 2026
Merged

rickchen007 merged 1 commit into
mainfrom
fix/agent-api-asks-bullet-format

Conversation

@jsun-m

@jsun-m jsun-m commented May 22, 2026

Copy link
Copy Markdown

Problem

The web UI Asks panel is empty even when pending-questions.md has open questions.

The /tasks/active question parser in agent-api.py splits the file on ## headers and only treats a section as a question if its body contains **Status:** or **Options:** metadata. But the proactive loop writes pending questions as plain bullet items under a single ## Open header (per CLAUDE.md and the proactive-loop skill) — no per-question metadata. So every loop-written question is silently skipped and the panel stays empty.

(Note: this is a separate issue from the workspace-path bug fixed in #44 — that fixed which file is read; this fixes how it's parsed.)

Fix

Parse each top-level bullet under ## Open as its own question:

  • bullets annotated FIXED / RESOLVED / ANSWERED are skipped;
  • the ## Resolved section is never surfaced;
  • standalone ## <question> + **Status:**/**Options:** sections are unaffected (backward compatible).

Bullet title = the leading **bold** span (falls back to first 80 chars). IDs are Q{section}-{bullet}.

Verification

Ran the new logic against the live pending-questions.md: 0 → 5 questions parsed (4 ## Open bullets + 1 standalone metadata section; the FIXED-annotated bullet correctly skipped). python3 -m py_compile src/agent-api.py passes.

Known limitation / follow-up

The POST /answer write-back flips a **Status:** line to answered — bullet-format questions have no such line, so answering them from the panel won't persist a status change yet. Out of scope here (the goal is visibility); a follow-up can extend write-back to bullets, or extract the parser into a unit-testable function.

🤖 Generated with Claude Code

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 `## <question>` + `**Status:**` sections
are unaffected.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@bassilkhilo-ag2 bassilkhilo-ag2 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean. The proactive loop writes questions to pending-questions.md under ## Open as bullet items, but do_GET in agent-api.py was only surfacing questions with **Status:** or **Options:** metadata — so loop-written questions never appeared in the web UI Asks panel.

The FIXED|RESOLVED|ANSWERED bullet filter is a good inclusion — prevents resolved items from re-appearing on each parse. The \*\*title\*\* extraction with fallback to first 80 chars handles both structured and freeform bullets.

Minor: the composite ID (f"Q{i}-{j}") assumes the i (section index) is stable across reads. If sections are added/removed in pending-questions.md, question IDs would shift, potentially breaking any cross-reference that stores them externally. If IDs need stability, a hash of the question text would be more robust — not urgent since the panel is mostly read-only display.

@rickchen007 rickchen007 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved (admin) — surfaces ## Open bullet questions in the Asks panel; backward-compatible with Status: sections. Clean.

@rickchen007
rickchen007 merged commit 4e2c4ed into main May 22, 2026
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants