Skip to content

Cap error fields in every error event and build release notes from CHANGELOG.md - #99

Merged
piotrekno1 merged 3 commits into
release/0.3.0from
fix/truncate-error-fields
Oct 22, 2026
Merged

piotrekno1 merged 3 commits into
release/0.3.0from
fix/truncate-error-fields

Conversation

@piotrekno1

@piotrekno1 piotrekno1 commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

For 0.3.0. Merging this into release/0.3.0 adds it to the release PR #98.

Problem

  • The integrations cut error_message to its first 200 characters. The public handle.track_error() applied no limit, so apps that track errors by hand had to truncate the message themselves.
  • I measured 37 typical failures across openai, anthropic, onnxruntime, torch, llama.cpp, faster-whisper, mlx-whisper and huggingface_hub. The median message is 123 characters, but 9 are over 200, and several put the cause at the end:
    • mlx-whisper audio errors (about 1,000 characters) are the ffmpeg banner followed by the actual error. The first 200 characters hold only the banner.
    • torch load_state_dict errors (301) end with the mismatched shapes.
    • Hugging Face Hub errors (209 to 507) start with about 100 characters of request ID.

Fix

  • ErrorEvent.to_dict() applies the limits, so every error event gets them, from an integration or from a manual track_error() call.
  • ERROR_MSG_MAX_LEN goes from 200 to 500. A longer message keeps its start and its end, with … between them.
  • provider_error_code is capped at 64.
  • The integrations and decorators no longer slice the message themselves, so the limit is applied in one place.
  • The transmitter and attachment log lines still use ERROR_MSG_MAX_LEN to cap server responses in logs, so those can now be up to 500 characters.

Note

The Android and Swift SDKs still use 200 with a head-only cut. They should follow.

Testing

  • New tests in tests/test_event_serialization.py cover the cap, start-and-end truncation and short messages.
  • Full suite: 913 passed, 28 skipped.
  • The 3 measured messages over 500 characters keep their cause after truncation.
  • Against the local ingest, a 2,100-character manual error was accepted (202). It arrived as 500 characters ending with its cause, with a provider code of 64 characters.

Release notes from CHANGELOG.md

The changelog preview on #98, and the GitHub release notes the tag build creates, listed every commit subject since v0.2.2. That included merge commits ("Merge 6c3a54e… into c3896d9…") and release housekeeping such as changelog moves. scripts/build_changelog_comment.py now uses the version's section of CHANGELOG.md instead. A missing or empty section fails the build rather than publishing empty notes. A test checks that the current version has a section, and CONTRIBUTING.md says to move the Unreleased entries at release time.

Full suite after both changes: 917 passed, 28 skipped.

After the release

Merge main back into devel (as in bf806c9), so this and the changelog commit on release/0.3.0 reach devel.

🤖 Generated with Claude Code

The integrations cut error messages to ERROR_MSG_MAX_LEN and provider codes
to PROVIDER_ERROR_CODE_MAX_LEN before calling track_error(). Manual calls
sent the full text. ErrorEvent now applies both limits when serializing, so
every error event gets them.
Measured across 37 typical failures, 9 messages were over 200 characters.
Several put their cause at the end. mlx-whisper audio errors start with the
ffmpeg banner, and torch state_dict errors end with the shapes. The
integrations kept only the first 200 characters.

ErrorEvent now keeps the start and the end of a message over 500
characters, with an ellipsis between. The integrations and decorators no
longer cut the message themselves, so the limit is applied once.
@piotrekno1 piotrekno1 changed the title Cap error fields for manual track_error calls Cap error fields in every error event, keeping both ends of long messages Oct 22, 2026
The notes listed every commit subject since the previous tag, including
merge commits and release housekeeping such as changelog moves. They are
now the curated CHANGELOG.md section for the version. A missing or empty
section fails the build instead of publishing empty notes.
@piotrekno1 piotrekno1 changed the title Cap error fields in every error event, keeping both ends of long messages Cap error fields in every error event and build release notes from CHANGELOG.md Oct 22, 2026
@piotrekno1
piotrekno1 merged commit b98d2b0 into release/0.3.0 Oct 22, 2026
80 checks passed
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