feat(plugin): add hook for PII and sensitive data redaction#35524
Open
agnusdei1207 wants to merge 1 commit into
Open
feat(plugin): add hook for PII and sensitive data redaction#35524agnusdei1207 wants to merge 1 commit into
agnusdei1207 wants to merge 1 commit into
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Based on my search results, I found one potentially related PR: #33523 - This PR might be related as it also deals with LLM/model hooks and observability, which could have overlapping functionality with the model request hook being added in PR #35524. You may want to verify whether these PRs address different aspects of hooks (observability vs. mutation) or if they have conflicting scope. All other results appear to be related to different aspects of plugins and tools, but not directly addressing the same model request hook feature. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
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.
Issue for this PR
No issue. Small plugin API addition.
Type of change
What does this PR do?
Adds a
model.request.beforeserver plugin hook after OpenCode prepares the provider request and before it is sent. It exposes system messages, model messages, tools, params, and headers for final request mutation.This is intended for plugins that need a last-mile request policy, such as redacting sensitive data or PII before provider calls. It does not add any redaction policy to OpenCode itself.
Tool arguments and results remain covered by the existing
tool.execute.beforeandtool.execute.afterhooks.How did you verify your code works?
bun typecheckinpackages/pluginbun typecheckinpackages/opencodebun test test/session/llm-request.test.ts test/provider/transform.test.ts test/plugin/trigger.test.ts --timeout 30000inpackages/opencodeScreenshots / recordings
N/A
Checklist