Registry Mirror
Skip to content

Conversation

@oliverlaz

Copy link
Copy Markdown
Member

Ticket: https://linear.app/stream/issue/REACT-1512

🎯 Goal

Make fromStreamMessage generic on v9, as it is on develop, so the same code compiles on both lines. With it, adapt: fromStreamMessage<LocalMessage> (as useAgentConversation from @stream-io/stream-agents/react takes it) works on v9, isAssistant gets the caller's message type, so isAssistant: (message) => message.user?.id === 'juno' compiles, and a MessageResponse, such as an event's message, is accepted.

πŸ›  Implementation details

The types from develop, none of its v10 field changes (custom):

  • fromStreamMessage = <M extends AdaptableMessage>(message: M, options?: FromStreamMessageOptions<M>), where AdaptableMessage (internal) is Pick<LocalMessage | MessageResponse, 'attachments' | 'id' | 'text'>, without the Record<string, unknown> that MessageResponse failed (TS2345). The body reads the other fields (ai_generated, generating, ai_ui, support_branch, resent_from) through a cast, as on develop
  • createFromStreamMessage<M>(options?) takes and caches the same M
  • FromStreamMessageOptions<M>: isAssistant takes M. The exported AIStreamMessage is unchanged and is the default for both, so code that names them still compiles

No runtime change, and not breaking: M is inferred from the message.

🎨 UI Changes

None.

πŸ§ͺ Testing

conversation.test.tsx gains a test that passes a LocalMessage and reads message.user in isAssistant, and one that passes a MessageResponse. yarn test:typecheck, tsc -p tsconfig.json and the src/ai-components Jest suites pass.

β˜‘οΈ Checklist

  • I have signed the Stream CLA (required)
  • PR targets the develop branch (targets v9-release: a v9 backport)
  • Documentation is updated
  • New code is tested in main example apps, including all possible scenarios
    • SampleApp iOS and Android
    • Expo iOS and Android

@getstream-metis

Copy link
Copy Markdown

πŸ‘‹ Hi Oliver, want a second pair of eyes on this?

I'm Jeffery, Stream's review agent. I look for bugs, regressions, missing tests and slow paths, and I only post findings I've checked against the code.

  • Review this PR

Or comment /jeffery review. I'll stay quiet unless you ask.

@oliverlaz
oliverlaz requested a review from isekovanic December 4, 2026 12:27
@oliverlaz
oliverlaz merged commit a3739c4 into v9-release Dec 4, 2026
3 of 9 checks passed
@oliverlaz
oliverlaz deleted the fix/generic-from-stream-message-v9 branch December 4, 2026 13:26
isekovanic added a commit that referenced this pull request Dec 4, 2026
…4054)

Ticket: https://linear.app/stream/issue/RN-561

## 🎯 Goal

With the `GetStream` organization IP allow list enabled, GitHub-hosted
`ubuntu-latest` runners can no longer make authenticated GitHub API
calls. #4024 moved `develop`'s Linux jobs to the static-IP
`github-public-amd64` runner group, but `v9-release` was never updated.
As a result, every PR into `v9-release` fails `Lint PR title` with "your
IP address is not permitted to access this resource" (for example
#4053).

## πŸ›  Implementation details

Switches every `runs-on: ubuntu-latest` on `v9-release` to `runs-on: {
group: github-public-amd64 }`, the same change #4024 made on `develop`:

- `lint-pr-title.yml` (`lint_pr_title`)
- `cancel-pr-checks.yml` (`cancel`)
- `changelog-preview.yml`
- `sdk-size-metrics.yml` (`sdk_size`)
- `release.yml` (`publish`, for v9 maintenance releases)
- `e2e-test.yml` (`check`, `android`, `result`)

Unchanged:

- `check-pr.yml` already runs on the self-hosted `public` runner.
- The `macos-15` jobs make no authenticated GitHub calls (#4046 moved
their `develop` counterparts to GitHub-hosted `macos-26`, not to an
allow-listed group).
- `sample-distribution.yml` on `v9-release` only runs on pushes to
`develop` or a manual dispatch.

## 🎨 UI Changes

None.

## πŸ§ͺ Testing

This PR's own `Lint PR title` run uses the updated workflow, so it
should pass. Once this is merged, re-running the title check on #4053
should pass as well.

## β˜‘οΈ Checklist

- [x] I have signed the [Stream
CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform)
(required)
- [ ] PR targets the `develop` branch (targets `v9-release`)
- [ ] Documentation is updated (not applicable)
- [ ] New code is tested in main example apps, including all possible
scenarios (CI only)
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.

2 participants