Repository navigation
[CHA-5958] feat: add history window team methods - #225
Merged
Merged
Conversation
slavabobik
requested review from
JimmyPettersson85,
nijeesh-stream,
shaljam and
vishalnarkhede
as code owners
October 29, 2026 10:18
nijeesh-stream
approved these changes
Oct 29, 2026
Client#set_history_window_teams, #delete_history_window_teams and #get_history_window_teams call POST /history_window/teams, POST /history_window/teams/delete and GET /history_window/teams: the paid tier of the chat history window, enabled per app by Stream. Other apps get a StreamAPIException with code 17. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…m yet The CI app's region answers the history window endpoints with 404 code 16 until its edge control plane runs a release with them; that is deployment state, not SDK behaviour, so both specs skip there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
slavabobik
force-pushed
the
feat/cha-5958-history-window-teams
branch
from
October 29, 2026 11:14
56241af to
9d7d155
Compare
Closed
slavabobik
pushed a commit
that referenced
this pull request
Oct 29, 2026
standard-version skipped both: their subjects start with a [CHA-...] prefix, so they don't parse as conventional commits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Adds server-side methods for the chat history window team endpoints: mark teams as full history (the paid tier), unmark them, and list them. The endpoints are live and enabled per app by Stream; other apps get a
StreamAPIExceptionwith code 17 (HTTP 403). Risk is low: the change only adds new methods, and existing calls are untouched.Linear: https://linear.app/stream/issue/CHA-5958
CLA
Description of the pull request
Client#set_history_window_teams(teams)POST /history_window/teamswith{"teams": [...]}(1 to 10 unique teams); returns the marked teams withcreated_atandupdated_atClient#delete_history_window_teams(teams)POST /history_window/teams/deletewith{"teams": [...]}; returns the teams that had full historyClient#get_history_window_teamsGET /history_window/teams; returnsdefault_window_hoursand the teams with full historyAll three are server-side only. On an app without the history window, the API answers 403 with code 17:
history window teams are not allowed for this app, please contact support to enable it. The backend is GetStream/chat (CHA-5958); the endpoints are being added to the OpenAPI spec there too, so the generatedgetstream-rubygets them as well.Tests
spec/client_spec.rb,describe 'history window teams', two cases that each skip on the other kind of app:StreamAPIExceptionwitherror_code17 and a "history window teams" message.Run locally (Ruby 3.3 container):
bundle exec rake rubocop: no offenses.bundle exec srb tc: no errors.bundle exec rspec ./spec/client_spec.rb -e 'history window teams'against a staging app that has the history window: 2 examples, 0 failures. The round trip passed; the refusal case was pending, as expected on an enabled app.Note
Low Risk
Additive SDK surface only; no changes to existing client behavior beyond new optional calls.
Overview
Adds three server-side
Clientmethods for Stream’s chat history window team tier: grant teams full history (set_history_window_teams), revert them to the app default (delete_history_window_teams), and readdefault_window_hoursplus the full-history team list (get_history_window_teams). Each wraps the existingpost/gethelpers with Sorbet signatures and YARD docs noting the 1–10 team limit and that apps without the feature getStreamAPIExceptioncode 17 (403).Tests in
spec/client_spec.rbprobe the test app once viaget_history_window_teams, then skip appropriately when endpoints are unrouted (code 16) or the feature is off/on. One example asserts all three calls are rejected with code 17 on disabled apps; the other runs mark → list → unmark on enabled apps.Reviewed by Cursor Bugbot for commit 9d7d155. Bugbot is set up for automated code reviews on this repo. Configure here.