[hermes] atlasbot: python:S1871 #8

Open
opened 2026-08-08 05:18:03 +00:00 by bstein · 0 comments
Owner

SonarQube reports python:S1871 in atlasbot/matrix/bot.py. The build is green; this is a standing finding, not a failure.

What is wrong

The timeout handler has two adjacent branches for "quick" and "fast" that execute the same code. Combine their conditions into one membership check without changing the produced message or control flow.

Ariadne opened no pull request for it: no automated patch was possible for this finding.

Facts

  • gitea — Either merge this branch with the identical one on line "168" or change one of the implementations. (MAJOR, 10min estimated) (atlasbot/matrix/bot.py:170)

Suggested fix (not applied)

Hermes could not open a pull request for this, so the change below was not written, validated, or pushed anywhere. It is a starting point for whoever picks this up, not a reviewed patch.

atlasbot/matrix/bot.py — The "quick" and "fast" branches produce the identical timeout message. Testing both modes in one condition removes the duplicated implementation while preserving behavior exactly.

if mode in {"quick", "fast"}:
    msg = (
        f"Quick mode hit {timeout_sec}s time budget before finishing. "
        "Try atlas-smart for a deeper answer."
    )
elif mode == "smart":
    msg = (
        f"Smart mode hit {timeout_sec}s time budget before finishing. "
        "Try atlas-genius or ask a narrower follow-up."
    )
else:
    msg = "I ran out of time before I could finish this answer."

Filed automatically by Ariadne from a Hermes Agent diagnosis (run run_f4482cb89561459c830899a3ca2db15b). Hermes has no write access to this repository; no files or infrastructure were changed.

SonarQube reports **python:S1871** in `atlasbot/matrix/bot.py`. The build is green; this is a standing finding, not a failure. ## What is wrong The timeout handler has two adjacent branches for "quick" and "fast" that execute the same code. Combine their conditions into one membership check without changing the produced message or control flow. Ariadne opened no pull request for it: no automated patch was possible for this finding. ## Facts - **gitea** — Either merge this branch with the identical one on line "168" or change one of the implementations. (MAJOR, 10min estimated) (`atlasbot/matrix/bot.py:170`) ## Suggested fix (not applied) Hermes could not open a pull request for this, so the change below was not written, validated, or pushed anywhere. It is a starting point for whoever picks this up, not a reviewed patch. **`atlasbot/matrix/bot.py`** — The "quick" and "fast" branches produce the identical timeout message. Testing both modes in one condition removes the duplicated implementation while preserving behavior exactly. ``` if mode in {"quick", "fast"}: msg = ( f"Quick mode hit {timeout_sec}s time budget before finishing. " "Try atlas-smart for a deeper answer." ) elif mode == "smart": msg = ( f"Smart mode hit {timeout_sec}s time budget before finishing. " "Try atlas-genius or ask a narrower follow-up." ) else: msg = "I ran out of time before I could finish this answer." ``` ## Links - SonarQube finding: https://quality.bstein.dev/project/issues?resolved=false&id=atlasbot&open=AZ2y3T24Ky9i4pkIpSiI - Full evidence bundle and audit trail live in Ariadne at `/api/admin/audit/events`, event types `hermes_autotriage_incident` and `hermes_autotriage_diagnosis`. Filed automatically by Ariadne from a Hermes Agent diagnosis (run [run_f4482cb89561459c830899a3ca2db15b](https://agent.bstein.dev/chat?resume=run_f4482cb89561459c830899a3ca2db15b)). Hermes has no write access to this repository; no files or infrastructure were changed. <!-- hermes-triage job=atlasbot classification=python:S1871 incident=sonar/atlasbot/python:S1871/AZ2y3T24Ky9i4pkIpSiI -->
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bstein/atlasbot#8
No description provided.