diff --git a/tests/mock_concurrent_mma.py b/tests/mock_concurrent_mma.py index 467268bd..81d5e298 100644 --- a/tests/mock_concurrent_mma.py +++ b/tests/mock_concurrent_mma.py @@ -67,23 +67,19 @@ def main() -> None: return # 2. Sprint Planning (different tickets for different tracks) - # The gemini_cli_adapter reuses the session_id from the epic call - # (mock-epic) for all subsequent calls. We use the global call counter - # to cycle through Track A (call #2) and Track B (call #3). - if session_id == "mock-epic" and call_n == 2: - _emit_sprint_ticket("A") - return - if session_id == "mock-epic" and call_n == 3: - _emit_sprint_ticket("B") - return - if "mock-sprint-A" in session_id: - _emit_sprint_ticket("A") - return - if "mock-sprint-B" in session_id: - _emit_sprint_ticket("B") - return + # Route on prompt content (the production passes the track_brief which + # contains "Track A" or "Track B"). The prior session_id-based routing was + # fragile because: + # 1. The call_n counter is shared across tests in the same session, so + # call_n != 2 for the 1st sprint if a prior test ran. + # 2. session_id="mock-sprint-A" means "this is a follow-up call after + # the 1st sprint returned mock-sprint-A", so the response should be + # sprint-B (2nd track), not sprint-A. if 'generate the implementation tickets' in prompt: - track_label = "A" if "Track A" in prompt else "B" + if "Track A" in prompt: track_label = "A" + elif "Track B" in prompt: track_label = "B" + elif "Track C" in prompt: track_label = "C" + else: track_label = "A" _emit_sprint_ticket(track_label) return