Skip to content

fix(viewer): drop undefined MAX_ENTITIES_PER_ANNOTATION from __all__ - #31

Merged
NiJingzhe merged 1 commit into
NiJingzhe:masterfrom
Anai-Guo:fix/all-undefined-max-entities
Sep 11, 2026
Merged

fix(viewer): drop undefined MAX_ENTITIES_PER_ANNOTATION from __all__#31
NiJingzhe merged 1 commit into
NiJingzhe:masterfrom
Anai-Guo:fix/all-undefined-max-entities

Conversation

@Anai-Guo

Copy link
Copy Markdown
Contributor

Problem

viewer/server/runtime.py exports MAX_ENTITIES_PER_ANNOTATION in __all__, but no such name exists — it is not defined in the module, and grep over the whole repository finds exactly one occurrence: the __all__ entry itself. There is also no annotation-limit logic anywhere that such a constant would serve, so it looks like a leftover from a constant that was planned or removed (MAX_ADJACENCY_IDS, right above it, does exist).

Checked the rest of the list with an AST pass — the other 8 entries all resolve:

__all__ entries: 9
defined:         8 / 9
MISSING:        ['MAX_ENTITIES_PER_ANNOTATION']

Impact

__all__ is what import * iterates, so the star-import form of this module raises. The module imports only stdlib, so this reproduces standalone:

Before

>>> from viewer.server.runtime import *
AttributeError: module 'runtime' has no attribute 'MAX_ENTITIES_PER_ANNOTATION'

After

>>> from viewer.server.runtime import *
OK: star-import succeeded

The existing importers (viewer/server/server.py, tests/test_viewer_re_server.py) all use explicit from ... import (...) lists, so nothing in the repo hits this today — but it also means the entry silently breaks import *, help(), and any autodoc pass over the module.

Fix

Removes the one stale line. No other changes.

🤖 Generated with Claude Code

viewer/server/runtime.py lists MAX_ENTITIES_PER_ANNOTATION in __all__, but
the name is not defined in the module -- it appears nowhere else in the
repository. The other 8 entries all resolve.

`from viewer.server.runtime import *` therefore fails with
AttributeError: module has no attribute 'MAX_ENTITIES_PER_ANNOTATION'.
@NiJingzhe
NiJingzhe merged commit a4ee014 into NiJingzhe:master Sep 11, 2026
4 checks passed
@NiJingzhe

Copy link
Copy Markdown
Owner

Thanks @Anai-Guo — nice catch and a textbook bug report: verified the reproduction, confirmed the stale entry, and appreciated that you checked the other 8 names in __all__ before touching anything. Merged after the CI matrix went green. 👍

@NiJingzhe NiJingzhe added the bug Something isn't working label Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants