发布

  • Use shared MAX_MESSAGE_SIZE in gateway output sink (DR-07) (#3781)

    frostbyte_neo 发布于 2026-07-07 00:56:41 +00:00

    GatewayOutputSink truncated preview and final messages against a
    local _MESSAGE_LIMIT = 4096 literal that duplicates
    platform.notifications.limits.MAX_MESSAGE_SIZE. Any future limit
    change would have to be made in two places.

    Import the shared constant and drop the local one. Truncation call
    sites are identical, so no behaviour change.

    Verified:

    • uv run pytest gateway/tests/test_gateway_output_sink.py -q — 6 passed
    • uv run ruff check gateway/gateway_output_sink.py — clean
    • uv run mypy gateway/gateway_output_sink.py — no issues

    Fixes #3529.

    下载附件