diff --git a/src/coding_agent_telegram/session_runtime.py b/src/coding_agent_telegram/session_runtime.py index 7beb383..3690408 100644 --- a/src/coding_agent_telegram/session_runtime.py +++ b/src/coding_agent_telegram/session_runtime.py @@ -85,7 +85,13 @@ def _detect_reply_options(text: str) -> tuple[str, ...]: for line in tail_lines: match = _OPTION_LINE_RE.match(line) if match: - options.append(match.group(1).strip()) + label = match.group(1).strip() + if label.endswith("?"): + # Each line is its own question (e.g. "1. Should I use A or B?"), + # not a choice for one decision — bail out rather than offering + # buttons that would resend a question as if it were an answer. + return () + options.append(label) if len(options) < 2: return () diff --git a/tests/test_session_runtime_diff_merge.py b/tests/test_session_runtime_diff_merge.py index 477da3c..d1023d0 100644 --- a/tests/test_session_runtime_diff_merge.py +++ b/tests/test_session_runtime_diff_merge.py @@ -155,3 +155,12 @@ def test_detect_reply_options_caps_at_max_options(): def test_detect_reply_options_returns_empty_for_blank_text(): assert _detect_reply_options(" ") == () + + +def test_detect_reply_options_ignores_multiple_independent_questions(): + text = ( + "I have a couple of questions before proceeding:\n" + "1. Should I use approach A or B for the caching layer?\n" + "2. Do you want unit tests included in this PR?" + ) + assert _detect_reply_options(text) == ()