Skip to content

[codex] fix OmniLogic compressed response boundaries#2

Merged
djrobx merged 2 commits into
heater_as_thermostatfrom
codex/fix-zlib-decompression
Jul 4, 2026
Merged

[codex] fix OmniLogic compressed response boundaries#2
djrobx merged 2 commits into
heater_as_thermostatfrom
codex/fix-zlib-decompression

Conversation

@djrobx

@djrobx djrobx commented Jul 4, 2026

Copy link
Copy Markdown
Owner

What changed

Applies the protocol-level boundary fix in the integration compatibility layer:

  • trim multi-part responses to the controller-provided MsgSize;
  • do not strip trailing zero bytes before zlib decompression.

Why

The prior streaming fallback kept the integration working, but the source problem is the rstrip(b"\x00") heuristic. A valid zlib trailer can end with 0x00; removing it makes a complete response look truncated. The controller already declares the exact response length in its lead message.

The new code uses that length and keeps one-shot zlib decompression strict. It continues to accept protocol padding after a completed zlib stream and rejects truly incomplete compressed data.

Validation

  • synthetic valid-zlib-trailer regression check
  • Python compilation and Ruff lint/format checks
  • live Tera controller refresh using the exact-boundary implementation (MsgSize=3937, reassembled payload 3937 bytes)

The separate upstream library fix is tracked in cryptk/python-omnilogic-local#153. This compatibility code can be removed once a released library contains that fix.

@djrobx djrobx changed the title [codex] fix OmniLogic zlib decompression fallback [codex] fix OmniLogic compressed response boundaries Jul 4, 2026
@djrobx djrobx marked this pull request as ready for review July 4, 2026 20:19
@djrobx djrobx merged commit 455782b into heater_as_thermostat Jul 4, 2026
@djrobx djrobx deleted the codex/fix-zlib-decompression branch July 4, 2026 20:19
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