Refactor/split sdk python agentfield agent into mixins#453
Refactor/split sdk python agentfield agent into mixins#453Luffy2208 wants to merge 9 commits intoAgent-Field:mainfrom
Conversation
Performance
✓ No regressions detected |
📊 Coverage gateThresholds from
✅ Gate passedNo surface regressed past the allowed threshold and the aggregate stayed above the floor. |
📐 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. |
|
CI is failing — ruff catches an unused |
sdk/python/agentfield/agent_vc.py
Outdated
| @@ -0,0 +1,155 @@ | |||
| import asyncio | |||
There was a problem hiding this comment.
Unused import — this is what's failing CI.
There was a problem hiding this comment.
Oh i see , did remove it in next commit and will keep in mind from next time
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