[hermes] atlasbot: python:S1871 #124

Open
opened 2026-09-24 05:20:23 +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

The heartbeat's if and elif branches both assign should_send = True, triggering S1871 for identical branch bodies. Merging their conditions with short-circuiting or removes the duplication without changing when heartbeat messages are sent or when the interval expression is evaluated.

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 — In heartbeat(), replace the should_send initialization and its following if/elif block with this merged condition, leaving the subsequent if should_send block unchanged. Keeping the initialization and boolean assignment preserves the flag's type, while or preserves the original evaluation order and skips the interval check whenever the first condition succeeds.

should_send = False
                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_6fe1d0df1e18421ebb0a83b4717f9e38). 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 heartbeat's if and elif branches both assign should_send = True, triggering S1871 for identical branch bodies. Merging their conditions with short-circuiting or removes the duplication without changing when heartbeat messages are sent or when the interval expression is evaluated. 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`** — In heartbeat(), replace the should_send initialization and its following if/elif block with this merged condition, leaving the subsequent if should_send block unchanged. Keeping the initialization and boolean assignment preserves the flag's type, while or preserves the original evaluation order and skips the interval check whenever the first condition succeeds. ``` should_send = False 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_6fe1d0df1e18421ebb0a83b4717f9e38](https://triage.bstein.dev/chat?resume=run_6fe1d0df1e18421ebb0a83b4717f9e38)). 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#124
No description provided.