[hermes] atlasbot: python:S1871 #145

Open
opened 2026-09-27 09:30:51 +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 inside MatrixBot._answer_with_heartbeat, the if branch at line 168 and the elif branch at line 170 have identical bodies (should_send = True). The two conditions are just alternative triggers for the same action, which is exactly what python:S1871 flags.

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 — Replace the should_send = False / if / elif block (lines 166-170) with a single assignment that ORs the two conditions. Short-circuit evaluation preserves the original check order (note-changed first, then the resend interval) and yields the same truth value in every case, so behaviour is unchanged while the duplicated branch body is removed.

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

Filed automatically by Ariadne from a Hermes Agent diagnosis (run run_d2af498ffd9a4d24a5cdfe6ec10116a6). 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 inside MatrixBot._answer_with_heartbeat, the if branch at line 168 and the elif branch at line 170 have identical bodies (should_send = True). The two conditions are just alternative triggers for the same action, which is exactly what python:S1871 flags. 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`** — Replace the should_send = False / if / elif block (lines 166-170) with a single assignment that ORs the two conditions. Short-circuit evaluation preserves the original check order (note-changed first, then the resend interval) and yields the same truth value in every case, so behaviour is unchanged while the duplicated branch body is removed. ``` should_send = (snippet and snippet != last_note) or ( now - last_sent >= max(60.0, self._settings.thinking_interval_sec * 2) ) ``` ## 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_d2af498ffd9a4d24a5cdfe6ec10116a6](https://triage.bstein.dev/chat?resume=run_d2af498ffd9a4d24a5cdfe6ec10116a6)). 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#145
No description provided.