[hermes] atlasbot: python:S1871 #121

Open
opened 2026-09-23 20:20:29 +00:00 by hermes-automation · 0 comments

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

What is wrong

In the heartbeat() coroutine's should_send logic, the if/elif at lines 167-170 has two branches with identical bodies (both just execute should_send = True), which is exactly what S1871 flags as duplicate branch logic that should be merged into one condition.

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 if snippet and snippet != last_note: and elif now - last_sent >= max(60.0, ...): branches both do nothing but set should_send = True, so Sonar treats them as one branch mistakenly duplicated. Combining the two conditions with or into a single if eliminates the duplicate branch while leaving should_send's resulting value identical for every possible input.

if (snippet and snippet != last_note) or (
                    now - last_sent >= max(60.0, self._settings.thinking_interval_sec * 2)
                ):
                    should_send = True

Filed automatically by Ariadne from a Hermes Agent diagnosis (run run_9d944971f9014877924b26e26079074b). 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 In the heartbeat() coroutine's should_send logic, the if/elif at lines 167-170 has two branches with identical bodies (both just execute `should_send = True`), which is exactly what S1871 flags as duplicate branch logic that should be merged into one condition. 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 `if snippet and snippet != last_note:` and `elif now - last_sent >= max(60.0, ...):` branches both do nothing but set `should_send = True`, so Sonar treats them as one branch mistakenly duplicated. Combining the two conditions with `or` into a single `if` eliminates the duplicate branch while leaving `should_send`'s resulting value identical for every possible input. ``` if (snippet and snippet != last_note) or ( now - last_sent >= max(60.0, self._settings.thinking_interval_sec * 2) ): should_send = True ``` ## 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_9d944971f9014877924b26e26079074b](https://triage.bstein.dev/chat?resume=run_9d944971f9014877924b26e26079074b)). 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#121
No description provided.