Skip to content

[AAASM-3415] 🔧 (native): Forward team_id/parent_agent_id on native register#149

Merged
Chisanan232 merged 8 commits into
masterfrom
v0.0.1/AAASM-3415/lineage_register_py
Jun 19, 2026
Merged

[AAASM-3415] 🔧 (native): Forward team_id/parent_agent_id on native register#149
Chisanan232 merged 8 commits into
masterfrom
v0.0.1/AAASM-3415/lineage_register_py

Conversation

@Chisanan232

Copy link
Copy Markdown
Contributor

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_id drives team-budget attribution; parent_agent_id drives the topology graph. This restores forwarding over the native path:

  • native/aa-ffi-python register gains optional team_id / parent_agent_id kwargs and sets them on the aa-sdk-client AssemblyConfig.
  • register_agent (core) forwards them, with a TypeError fallback to the legacy positional signature for an older native build that predates the kwargs.
  • _register_agent_with_gateway forwards the init_assembly team_id / parent_agent_id (including ambient spawn-context lineage) onto the native register.
  • The shared aa-core / aa-proto / aa-sdk-client git-SHA pin is bumped to the agent-assembly AAASM-3415 commit that adds the AssemblyConfig fields.

No proto change was needed — proto/agent.proto already carries parent_agent_id and the composite AgentId.team_id.

Type of Change

  • 🔧 Bug fix

Breaking Changes

  • No

New parameters are optional (None default) and additive.

Related Issues

  • Related JIRA ticket: AAASM-3415

Part of AAASM-3415 (the agent-assembly PR carries Closes). See ai-agent-assembly/agent-assembly#1160.

Testing

  • Unit tests added/updated

pytest test/unit/core/test_init_registration.py test/unit/core/test_runtime_interceptor.py test/integration/test_topology_registration.py → 31 passed (new test_init_assembly_forwards_team_and_parent_on_register). cargo check / cargo clippy --all-targets -- -D warnings on the shim clean against the new pin. pre-commit run (black/isort/mypy) passes on changed files.

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • All tests passing

Cross-repo pin dependency & follow-up

  • The git-SHA pin currently points at agent-assembly's AAASM-3415 branch tip (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.
  • go-sdk / aa-ffi-go lineage 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

Chisanan232 and others added 5 commits June 19, 2026 16:21
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

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Chisanan232 Chisanan232 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 register gains team_id/parent_agent_id; Python forwards init_assembly config (incl. ambient spawn lineage) with a TypeError fallback for older builds. 31 targeted tests pass (1 new). ✅

⚠️ Pin dependency: currently pins 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.)

Chisanan232 and others added 3 commits June 19, 2026 22:36
…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>
@sonarqubecloud

Copy link
Copy Markdown

@Chisanan232 Chisanan232 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Chisanan232 Chisanan232 merged commit f319049 into master Jun 19, 2026
25 checks passed
@Chisanan232 Chisanan232 deleted the v0.0.1/AAASM-3415/lineage_register_py branch June 19, 2026 14:52
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.

1 participant