Skip to content

Preserve staticmethod when AutoTracingPlugin rebinds class members - #6820

Open
Hashim1999164 wants to merge 1 commit into
google:mainfrom
Hashim1999164:autotracing-keep-staticmethod
Open

Preserve staticmethod when AutoTracingPlugin rebinds class members#6820
Hashim1999164 wants to merge 1 commit into
google:mainfrom
Hashim1999164:autotracing-keep-staticmethod

Conversation

@Hashim1999164

@Hashim1999164 Hashim1999164 commented Aug 19, 2026

Copy link
Copy Markdown

Summary

AutoTracingPlugin rebound class members from inspect.getmembers, which unwraps a staticmethod to a plain function. setattr then stored that function, so instance access bound self as the first argument and calls such as C().static(a=1) raised TypeError.

_rebind now checks the class dict and rewraps staticmethod (and classmethod) before setattr.

Closes #6819

Testing Plan

pytest tests/unittests/plugins/test_auto_tracing_plugin.py::test_staticmethod_does_not_bind_instance
pytest tests/unittests/plugins/test_auto_tracing_plugin.py::test_emits_span

5 passed locally.

Manual E2E: N/A. This is descriptor rebinding only; no agent UI or runner flow change.

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.

AutoTracingPlugin._rebind drops the staticmethod descriptor, breaking wrapped classes

2 participants