Skip to content

fix: raise FerroStreamError on malformed streaming chunks#27

Merged
MitulShah1 merged 2 commits into
developmentfrom
fix/stream-error-malformed-chunks
Jun 12, 2026
Merged

fix: raise FerroStreamError on malformed streaming chunks#27
MitulShah1 merged 2 commits into
developmentfrom
fix/stream-error-malformed-chunks

Conversation

@MitulShah1

@MitulShah1 MitulShah1 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the one open bug-labeled issue plus its sibling enhancement, both on the same code path:

Both sync (completions/resource.py) and async (completions/async_resource.py) _stream() paths now raise FerroStreamError on a malformed chunk, with a truncated payload snippet and the original JSONDecodeError chained via raise ... from e. This is the first code path that actually raises FerroStreamError.

Also:

  • Tightens test coverage flagged while reviewing Development #26: admin.plugins.list() {"plugins": [...]} wrapper branch, plus streaming malformed-chunk regression tests (sync + async).
  • Adds .github/release.yml so GitHub's auto-generated release notes (the publish job already runs with generate_release_notes: true) group merged PRs by label and credit every contributor by @handle on each tagged release. Contributor credit lives in the release notes only — not in CHANGELOG.md.

Fixed Issues

Closes #15
Closes #16

Testing

  • pytest tests/67 passed (was 64).
  • ruff check / ruff format --check — clean.
  • mypy ferrolabsai — Success, no issues.
  • .github/release.yml validated as well-formed YAML (10 categories).

Notes

Both the sync and async _stream() paths swallowed JSONDecodeError with a
bare `continue`, silently dropping malformed SSE chunks and losing data
with no error or log. They now raise FerroStreamError instead — the first
code path that actually raises this previously-unused exception.

Also adds the {"plugins": [...]} wrapper coverage for admin.plugins.list()
and streaming malformed-chunk regression tests for both clients.

Closes #15
Closes #16
Add .github/release.yml so GitHub's auto-generated release notes (the
publish job already runs softprops/action-gh-release with
generate_release_notes: true) group merged PRs by label and credit every
contributor by @handle, plus a "New Contributors" section. Contributor
credit lives in the release notes only, not in CHANGELOG.md.
@MitulShah1
MitulShah1 force-pushed the fix/stream-error-malformed-chunks branch from 9ebbb21 to 85f33b9 Compare June 12, 2026 14:02
@MitulShah1
MitulShah1 merged commit 3ea856c into development Jun 12, 2026
5 checks passed
@MitulShah1 MitulShah1 mentioned this pull request Jun 12, 2026
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