Refactor/split sdk python agentfield agent into mixins#453
Merged
AbirAbbas merged 9 commits intoAgent-Field:mainfrom Apr 15, 2026
Merged
Conversation
Contributor
Performance
✓ No regressions detected |
Contributor
📊 Coverage gateThresholds from
✅ Gate passedNo surface regressed past the allowed threshold and the aggregate stayed above the floor. |
Contributor
📐 Patch coverage gateThreshold: 80% on lines this PR touches vs
✅ Patch gate passedEvery surface whose lines were touched by this PR has patch coverage at or above the threshold. |
Contributor
|
CI is failing — ruff catches an unused |
AbirAbbas
reviewed
Apr 14, 2026
AbirAbbas
approved these changes
Apr 15, 2026
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
Refactored
sdk/python/agentfield/agent.py(~4500 LOC) by splitting it into multiple concern-based mixins while preserving all existing behavior and public APIs.This change is part of the "god files" refactor epic and improves maintainability, readability, and contributor experience by organizing logically grouped functionality into separate modules.
What was moved where
agent_schema.py→_AgentSchemaMixin_types_to_json_schema_type_to_json_schema_validate_handler_inputagent_discovery.py→_AgentDiscoveryMixin_handle_discovery_build_callback_discovery_payload_apply_discovery_responseagent_serverless.py→_AgentServerlessMixinhandle_serverlessagent_vc.py→_AgentVCMixin_initialize_did_system_populate_execution_context_with_did_agent_vc_default_set_reasoner_vc_override_set_skill_vc_override_effective_component_vc_setting_should_generate_vc_build_agent_metadata_build_vc_metadata_generate_vc_asyncagent_pause.py_PauseManagerclass (moved as-is)Agent Composition
The
Agentclass now composes these via mixins:Testing
./scripts/test-all.shTest Changes
No existing tests were modified.
Added monkeypatch overrides in
test/helper.py:Checklist
CHANGELOG.md(or this change does not warrant a changelog entry).Related Issues
Fixes #411