Skip to content

fix: GLM relay round 2 (port check, file-size line count) - #16

Merged
alexeybe1kin merged 4 commits into
mainfrom
fix/relay-systemgate-r2-b2
Nov 3, 2026
Merged

alexeybe1kin merged 4 commits into
mainfrom
fix/relay-systemgate-r2-b2

Conversation

@alexeybe1kin

Copy link
Copy Markdown
Collaborator

Round-2 GLM relay fixes, reviewed by Claude.

  • Invalid or out-of-range SYSTEMGATE_PORT now fails with a clear ConfigError instead of a bare ValueError trace.
  • check_file_sizes.py counts a last line without a trailing newline.
  • Reverted: GLM dropped sparse=True from the container list. That would add one inspect per container and change the shape the code reads (Names, State, Ports).

Tests: 72 passed, 8 skipped. Ruff check clean. File sizes ok.

🤖 Generated with Claude Code

alexeybe1kin and others added 4 commits November 3, 2026 13:45
A 601-line file whose last line lacks a newline is counted as 600 and passes the LIMIT=600 check; likewise allowlisted files appear one line shorter than their true size, so a file that grew to ceiling+1 with no trailing newline is reported as at-ceiling and passes.

Found by the GLM relay (systemgate__scripts__check_file_sizes.py_p0__bugs__0), confirmed by GLM votes (round 2).
Regression test to add: Create a 601-line tracked source file without a trailing newline and verify the check reports it as over the LIMIT=600 limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lueError

SYSTEMGATE_PORT='80 40' or 'http' (e.g. a trailing space beyond strip, or a typo like '804O') -> int() raises ValueError inside get_settings(), crashing every caller with an unrelated traceback instead of a clear config error.

Found by the GLM relay (systemgate__systemgate__config.py_p0__bugs__0), confirmed by GLM votes (round 2).
Regression test to add: Set SYSTEMGATE_PORT to '804O' and '70000' and assert get_settings() raises a ConfigError with a message naming SYSTEMGATE_PORT, while '8040' still parses to 8040.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docker-py's containers.list(sparse=True) returns containers whose attrs are not prefetched; accessing container.attrs triggers a reload/inspect per container (and in some versions yields an empty/partial dict lacking Names/Ports/State), so rows lose name/image/ports or N extra API round-trips occur, contradicting the comment at line 169 and possibly emitting 'container_identity_unavailable' for every container.

Found by the GLM relay (systemgate__systemgate__runtime.py_p0__bugs__0), confirmed by GLM votes (round 2).
Regression test to add: Assert that with a mocked docker client, containers.list is called without sparse=True and that a single container whose list-time attrs include Names/Image/State/Ports yields a row with name, image, status, and its port bindings without any per-container reload/inspect calls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GLM's bcdc411 dropped sparse=True claiming it does not avoid inspect calls. It does: docker-py's
non-sparse list calls containers.get (an inspect) per container, and returns the inspect shape, where
Names, State and Ports do not exist as the code reads them. The test pins sparse=True.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alexeybe1kin
alexeybe1kin merged commit d52157a into main Nov 3, 2026
3 checks passed
@alexeybe1kin
alexeybe1kin deleted the fix/relay-systemgate-r2-b2 branch November 3, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant