Skip to content

Unused 'websocket' dependency — obsolete package that can shadow websocket-client #158

Description

@ThatMattCat

Severity: Low · Area: Tests / quality · Category: dead-code
Location: services/agent/pyproject.toml:27

What's wrong

The dependency list pins both websocket and websockets. Nothing under selene_agent/ imports the websocket module. The PyPI websocket project is an abandoned 2010-era package that installs a top-level websocket module colliding with websocket-client (the maintained package of that module name, used by e.g. plexapi's AlertListener if enabled); with both present, which module wins depends on install order, making failures environment-dependent.

How it fails

A future feature (or plexapi alert usage) does import websocket expecting websocket-client's WebSocketApp; in images where the obsolete websocket package clobbered the module, the attribute is missing and the agent crashes at import in that container build only.

Suggested fix

Remove "websocket" from dependencies (keep websockets); add websocket-client explicitly if/when any code needs it.

Adversarial verification — both skeptics confirmed

Skeptic 1 (confirmed) — Confirmed: services/agent/pyproject.toml pins both "websocket" (line 27) and "websockets" (line 28). Grep shows zero imports of the websocket module anywhere in selene_agent (websockets is used only transitively by uvicorn for WS endpoints, so it stays). Verified in the live agent container: the obsolete websocket 0.2.1 (2010 package…

Skeptic 2 (confirmed) — Confirmed, not refuted. services/agent/pyproject.toml line 27 pins "websocket" and nothing in selene_agent/ imports that module (all grep hits are FastAPI WebSocket types, URL strings, or route decorators). Verified in the running agent container: the installed package is the abandoned websocket 0.2.1, websocket-client is absent, and the…


Filed from a multi-agent audit of 855f5cc: 16 reviewers over ~42k lines produced 170 raw findings; each was handed to 2 independent agents prompted to refute it, and only findings both confirmed were kept (19 refuted, 10 split-verdict, 127 unique confirmed). Line numbers are 1-indexed against 855f5cc and will drift as the code changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:tests-qualityReview area: Tests / qualityauditFound by the 855f5cc multi-agent code auditcategory:dead-codeFinding category: dead-codeseverity:lowDead code or worthwhile improvement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions