Add agent plugins support to AISDKAgent.#8
Open
mm-zacharydavison wants to merge 1 commit intomainfrom
Open
Conversation
masudahiroto
approved these changes
Jan 20, 2026
| // Sanitize messages before sending to ensure no provider-specific fields leak through (e.g. for Anthropic: 'tool_use_id') | ||
| const sanitizedInputMessages = this.sanitizeMessages(messages); | ||
|
|
||
| // Run onUserMessage plugin hook |
Contributor
There was a problem hiding this comment.
This feature itself works fine, but please note that if you modify any of the previous messages in the conversation, prompt caching will no longer work.
https://platform.claude.com/docs/ja/build-with-claude/prompt-caching
Contributor
Author
There was a problem hiding this comment.
This is a good point. I need to think about it.
Contributor
There was a problem hiding this comment.
[FYI] manus famous document about context engineering says KV cache (= prompt caching in anthropic) is very important.
https://manus.im/en/blog/Context-Engineering-for-AI-Agents-Lessons-from-Building-Manus
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.
I was implementing citations feature, and it requires different implementation depending on source of citations (e.g. Anthropic Web Search, OpenAI Web Search, RAG, all operate differently).
It was making the code messy, so I created agent plugin system to use.
I will use it for citations feature.