Skip to content

feat: regenerate the client from the current Stream API - #321

Merged
mogita merged 1 commit into
mainfrom
feat/regen-agent-review
Nov 12, 2026
Merged

mogita merged 1 commit into
mainfrom
feat/regen-agent-review

Conversation

@mogita

@mogita mogita commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Since 8.0.0, the Stream API has added agent review and a review queue count, and it now publishes expected_value on custom-property moderation rules. The webhook helper also decompresses gzip bodies before the signature check, with no size cap.

Solution

This PR regenerates the client from chat 0cdfce10f9c, the current master. That commit includes GetStream/chat#20571 (expected_value) and GetStream/chat#20645 (gzip cap). The same two changes go to v7 in #320.

Compared with 8.0.0, no API is removed and no types change, so this is a minor release. The new optional parameters are inserted in alphabetical order:

  • In update_app, agent_review comes before apn_config.
  • In submit_action, agent_recommendation comes before ban.

The optional parameters that follow move one position. Since v8, optional parameters are passed by keyword (see MIGRATION_v7_to_v8.md).

How to verify

  1. make lint
  2. uv sync --all-extras --dev --no-install-package getstream-rtc && make typecheck
  3. make test (507 passed locally)

BEGIN_COMMIT_OVERRIDE
feat(moderation): add agent review: submit_agent_feedback, list_agent_feedback and get_agent_review_status, plus agent_review on update_app and agent_recommendation on submit_action
feat(moderation): add count_review_queue to count the review queue items that match a filter
feat(moderation): add expected_value to UserCustomPropertyParameters, CallCustomPropertyParameters, ContentCustomPropertyParameters and ContentCustomPropertyCountParameters, so value-operator custom-property rules can be set
fix: cap decompressed gzip webhook bodies at 10 MiB (getstream.webhook.MAX_WEBHOOK_PAYLOAD_BYTES) and reject data after the gzip stream, because decompression runs before the signature check
END_COMMIT_OVERRIDE


Note

Medium Risk
Adds many optional moderation APIs and types (low breakage risk), but webhook gzip handling changes behavior for malicious or oversized compressed payloads—intentional hardening that may reject previously accepted bad input.

Overview
Regenerates the Python client from the current Stream API to expose agent review (Nora) moderation: app-level agent_review settings on update_app, review-queue payloads with agent verdicts, submit_action support for agent_recommendation, and new moderation calls list_agent_feedback, submit_agent_feedback, and get_agent_review_status, plus count_review_queue for filter-matched queue totals.

Moderation models gain stream-engine options (provider stream, strictness) and expected_value on custom-property rule parameters (user, call, content) for value-based operators.

Webhook security: gunzip_payload now caps decompressed bodies at MAX_WEBHOOK_PAYLOAD_BYTES (10 MiB) and rejects truncated or trailing data after gzip, because decompression runs before signature verification. Tests cover oversized and trailing-data cases.

Reviewed by Cursor Bugbot for commit d0d76ff. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • New Features

    • Added agent-review configuration, status, feedback, and recommendation support, including review-queue counts.
    • Added moderation settings for strictness and custom-property expected values.
    • Added review-queue item counts to moderation responses.
  • Bug Fixes

    • Webhook verification now rejects compressed payloads larger than 10 MiB, as well as malformed, truncated, or trailing-data gzip streams.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The changes add agent-review models and client methods, including app configuration, feedback, review status, queue counts, and recommendations. Webhook gzip decompression now has a 10 MiB output limit and rejects malformed, incomplete, or trailing data.

Changes: Agent Review and Moderation APIs

Layer / File(s) Summary
Agent-review and moderation contracts
getstream/models/__init__.py
Adds agent-review and feedback models, app and review-queue fields, recommendation data, queue-count models, and moderation configuration fields.
Client methods and app updates
getstream/moderation/*_rest_client.py, getstream/common/*_rest_client.py
Adds feedback, review-status, and review-queue count methods to both clients. submit_action accepts an agent recommendation, and update_app accepts agent-review settings.

Webhook Gzip Validation

Layer / File(s) Summary
Bounded decompression and validation
getstream/webhook.py, getstream/tests/test_webhook.py, tests/assets/webhooks/_invalid/oversized_compression/*
Limits decompressed gzip payloads to 10 MiB and raises InvalidWebhookError for oversized, incomplete, corrupt, or trailing-data input. Adds tests and an oversized-payload fixture.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Possibly related PRs

  • GetStream/stream-py#313: Regenerates overlapping client signatures and webhook fixtures from another specification revision.

Suggested reviewers: itsmeadi, hifaizsk

Merge Risk: Minimal · up to d0d76

This change adds agent-review APIs and caps webhook gzip decompression at 10 MiB. No concrete merge-blocking issue was found. The binary gzip fixture was not available for direct inspection, but that alone does not establish a defect.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "feat: regenerate the client from the current Stream API" is related to the changeset. The PR regenerates the client from a Stream chat commit and adds agent review methods, count_review_que…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feat: regenerate the client from the current Stream API" is related to the changeset. The PR regenerates the client from a Stream chat commit and adds agent review methods, count_review_queue, expected_value fields, and webhook gzip limits. The title names the regeneration, which is the main change, but does not name a specific feature such as agent review. It is therefore a partial match that is broad but still accurate.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b8d3f400-ebd6-44e2-b2c5-d980e33d3085
Commits

Reviewing files that changed from the base of the PR and between 1cd6707 and d0d76ff.

Files ignored due to path filters: 1

  • tests/assets/webhooks/_invalid/oversized_compression/body.gz is excluded by !**/*.gz
Files selected for processing: 13

  • getstream/common/async_rest_client.py
  • getstream/common/rest_client.py
  • getstream/models/__init__.py
  • getstream/moderation/async_rest_client.py
  • getstream/moderation/rest_client.py
  • getstream/tests/test_webhook.py
  • getstream/webhook.py
  • tests/assets/webhooks/_invalid/oversized_compression/body.json
  • tests/assets/webhooks/_invalid/oversized_compression/expected.json
  • tests/assets/webhooks/_invalid/oversized_compression/signature.txt
  • tests/assets/webhooks/_invalid/oversized_compression/sns_notification.txt
  • tests/assets/webhooks/_invalid/oversized_compression/sqs_body.txt
  • tests/assets/webhooks/_invalid/oversized_compression/sqs_body_uncompressed.txt

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@mogita
mogita merged commit 6fce09c into main Nov 12, 2026
25 checks passed
@mogita
mogita deleted the feat/regen-agent-review branch November 12, 2026 16:49
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