fix(gateway): include export name in hook transform cache key#13855
Merged
mbelinky merged 1 commit intoopenclaw:mainfrom Feb 20, 2026
Merged
fix(gateway): include export name in hook transform cache key#13855mbelinky merged 1 commit intoopenclaw:mainfrom
mbelinky merged 1 commit intoopenclaw:mainfrom
Conversation
Contributor
Author
|
@greptile please re-review this PR. |
fa0dcff to
3977213
Compare
3977213 to
578fd67
Compare
578fd67 to
68c1121
Compare
9894b92 to
8397247
Compare
bfc1ccb to
f92900f
Compare
daf6aef to
4a15fde
Compare
4a15fde to
a9eea91
Compare
Contributor
Closed
6 tasks
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.
Summary
Fixes #10152
loadTransform()cached hook transform functions using onlymodulePathas the key. When two hook mappings referenced different named exports from the same module file, the first loaded export was silently reused for all subsequent lookups — theexportNamewas ignored during cache hits.Fix: Use a composite cache key
${modulePath}::${exportName ?? "default"}so each distinct export is cached independently.Test plan
transformA/transformB)transformA's result ("from-A")pnpm build && pnpm checkpassesGreptile Overview
Greptile Summary
This PR fixes a correctness issue in the gateway hook transform loader cache: previously,
loadTransform()cached bymodulePathonly, causing different named exports from the same module to incorrectly reuse the first-loaded transform function.The change updates the cache key to include both
modulePathandexportName(with a stable default sentinel), and adds a regression test that creates a module with multiple exports (transformA/transformB) and verifies each hook mapping resolves and executes the correct export.Confidence Score: 5/5