Skip to content

Conversation

@jorgenwh
Copy link
Contributor

@jorgenwh jorgenwh commented Dec 7, 2025

Add a chat messages transform hook to allow plugins to alter chat messages.

We expose the MessageV2.WithParts through the new hook, but give deep copies of the chat history to avoid plugins altering the original messages

Previously, the chain would look something like this:

MessageV2.WithParts -> ModelMessage -> ...

Now, with the new changes:

MessageV2.WithParts -> MessageV2.WithParts (in-memory copy) -> ModelMessage -> ...
                              |
                   chat.messages.transform
                              |
                     |-----------------|
                     |     Plugin      |
                     |-----------------|

@rekram1-node
Copy link
Collaborator

/review

jorgenwh and others added 3 commits December 7, 2025 20:28
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@rekram1-node
Copy link
Collaborator

/review

@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

lgtm

@rekram1-node
Copy link
Collaborator

/review

@github-actions
Copy link
Contributor

lgtm

@rekram1-node rekram1-node changed the title Chat messages transform hook add experimental.chat.messages.transform hook Dec 11, 2025
@rekram1-node rekram1-node merged commit 2a9269c into sst:dev Dec 11, 2025
3 checks passed
shuv1337 added a commit to Latitudes-Dev/shuvcode that referenced this pull request Dec 11, 2025
Merge origin/dev containing:
- v1.0.150 release
- fix: Writing to Bun.stderr causes CPU pinning to 100% (sst#5396)
- feat: add caching for opencode binary in GitHub Actions (sst#5384)
- add experimental.chat.messages.transform hook (sst#5207)

This merge preserves all local fork customizations:
- Night Owl theme and OpenCode theme
- AsciiMark/AsciiLogo branding
- Font/Theme pickers in header
- Go-to-parent session navigation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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