[AAASM-3415] 🔧 (native): Forward team_id/parent_agent_id on native register#149
Conversation
Move the shared aa-core/aa-proto/aa-sdk-client git-SHA pin to the agent-assembly AAASM-3415 branch tip, which adds team_id/parent_agent_id to AssemblyConfig. Move to the squash-merge commit once PR #1160 lands. refs AAASM-3415 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The PyO3 register surface gains team_id/parent_agent_id kwargs and sets them on AssemblyConfig so the native gRPC Register carries the agent's team-budget scoping and topology lineage (AAASM-3415). refs AAASM-3415 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
register_agent forwards the lineage/team kwargs to the native register, with a TypeError fallback to the legacy signature for an older native build that predates them (AAASM-3415). refs AAASM-3415 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
_register_agent_with_gateway now forwards the init_assembly team_id and parent_agent_id (incl. ambient spawn-context lineage) onto the native register so the gateway gets team scoping + topology on init (AAASM-3415). refs AAASM-3415 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Extend FakeRuntimeClient to capture the lineage kwargs and add an init_assembly forwarding test; refresh the topology integration test docstring now the native path carries lineage again (AAASM-3415). refs AAASM-3415 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Chisanan232
left a comment
There was a problem hiding this comment.
Claude Code — PR review (AAASM-3415, python-sdk)
Verdict: ✅ approve — but merge AFTER agent-assembly #1160 + re-pin. CI Success green; only codecov/patch red (the Rust-shim register lines aren't covered by Python tests — advisory, non-blocking, same as prior shim PRs).
- Native shim
registergainsteam_id/parent_agent_id; Python forwardsinit_assemblyconfig (incl. ambient spawn lineage) with aTypeErrorfallback for older builds. 31 targeted tests pass (1 new). ✅
aa-sdk-client/aa-proto/aa-core to agent-assembly branch-tip 209572bc. After #1160 squash-merges, update the pin to the merge commit and re-push, THEN merge. (I can do this re-pin for you once #1160 is in.)
…ff8e40) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add scenarios for only-team, only-parent, neither set, and verbatim round-trip of unicode/long lineage ids through init_assembly to the native register (AAASM-3415). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a LegacyRuntimeClient fake (register without lineage kwargs) and scenarios for: ambient spawn-context parent auto-fill, explicit config overriding the ambient parent, and the older-native-build TypeError fallback to the legacy positional register (AAASM-3415). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Chisanan232
left a comment
There was a problem hiding this comment.
Claude Code — re-pin + test pass (AAASM-3415, python)
✅ Re-pin clean + coverage strengthened — merge-ready. Re-pinned aa-core/aa-proto/aa-sdk-client → merged fdff8e40 (Cargo.lock regenerated incl. transitive aa-security; aa-* crates share one git rev green); cargo check compiles against merged core.
New scenarios in test/unit/core/test_init_registration.py (+ LegacyRuntimeClient fake) with exact forwarded-value assertions: only-team / only-parent / neither / ambient spawn-parent auto-fill / explicit-config-overrides-ambient / older-build TypeError 4-arg fallback (lineage dropped, no crash) / unicode+long round-trip. 12/12 pass; ruff/mypy/pre-commit clean. CI all required green (incl. codecov/patch).
Nice catch documenting that ambient lineage carries parent_agent_id (not team_id) and asserting the real behavior. Good to merge.



Description
When the Python SDK moved to native gRPC
Register(Epic AAASM-3395 / AAASM-3402), the native register path stopped forwarding the lineage/team fields the old REST register sent.team_iddrives team-budget attribution;parent_agent_iddrives the topology graph. This restores forwarding over the native path:native/aa-ffi-pythonregistergains optionalteam_id/parent_agent_idkwargs and sets them on theaa-sdk-clientAssemblyConfig.register_agent(core) forwards them, with aTypeErrorfallback to the legacy positional signature for an older native build that predates the kwargs._register_agent_with_gatewayforwards theinit_assemblyteam_id/parent_agent_id(including ambient spawn-context lineage) onto the native register.aa-core/aa-proto/aa-sdk-clientgit-SHA pin is bumped to the agent-assembly AAASM-3415 commit that adds theAssemblyConfigfields.No proto change was needed —
proto/agent.protoalready carriesparent_agent_idand the compositeAgentId.team_id.Type of Change
Breaking Changes
New parameters are optional (
Nonedefault) and additive.Related Issues
Part of AAASM-3415 (the agent-assembly PR carries
Closes). See ai-agent-assembly/agent-assembly#1160.Testing
pytest test/unit/core/test_init_registration.py test/unit/core/test_runtime_interceptor.py test/integration/test_topology_registration.py→ 31 passed (newtest_init_assembly_forwards_team_and_parent_on_register).cargo check/cargo clippy --all-targets -- -D warningson the shim clean against the new pin.pre-commit run(black/isort/mypy) passes on changed files.Checklist
Cross-repo pin dependency & follow-up
209572bc…); move it to the squash-merge commit once PR #1160 merges. Functionally equivalent — no proto change, so this PR is not hard-blocked on the merge.aa-ffi-golineage forwarding is a deferred follow-up (go-sdk is being edited concurrently by AAASM-3404; left out here to avoid collision).🤖 Generated with Claude Code