fix(core): Preserve AI proxy property references - #22474
Conversation
1445eaf to
e002cf1
Compare
e002cf1 to
8d957e5
Compare
8d957e5 to
681a0f6
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6f3a3a2. Configure here.
|
👋 @nicohrubec — Please review this PR when you get a chance! |
4 similar comments
|
👋 @nicohrubec — Please review this PR when you get a chance! |
|
👋 @nicohrubec — Please review this PR when you get a chance! |
|
👋 @nicohrubec — Please review this PR when you get a chance! |
|
👋 @nicohrubec — Please review this PR when you get a chance! |

AI integration deep proxies now reuse nested proxies and wrapped methods while the underlying property is unchanged. This makes repeated property access referentially stable for OpenAI and Google GenAI clients, while still refreshing a cached entry when an SDK property is replaced.
Anthropic is unchanged because the current
developimplementation instruments its methods in place and no longer uses this deep-proxy path.Root cause
Each
gettrap created a new nested proxy, instrumented wrapper, or bound function on every access. Caching functions alone would not cover repeated nested access because the intermediate proxies were also recreated.Focused regression coverage checks stable nested objects, instrumented methods, proxy-result methods, and non-instrumented bound methods.
Fixes #22355