Skip to content

feat(events): add observation primitives and source_event properties - #3524

Open
Lancetnik wants to merge 1 commit into
mainfrom
feat/subagent-eventbus-core
Open

Lancetnik wants to merge 1 commit into
mainfrom
feat/subagent-eventbus-core

Conversation

@Lancetnik

@Lancetnik Lancetnik commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Why are these changes needed?

This PR introduces typed observation/downlink events, BaseEvent.source_event, publication identity on usage records, and delivery-guard support in the stream. It includes the public event-property tests. Existing delegation and usage-rollup behavior remains unchanged here; the routing protocol is activated only in #3526 with all required migrations.

The stack is organized as independently checkable changes: event primitives → scoped variables → complete routing integration → documentation → supporting files. Required tests and compatibility adaptations are included with the code that needs them. CI workflows and required checks are unchanged.

Related issue number

Stack #3525: #3524 (events) → #3523 (variables) → #3526 (routing) → #3527 (documentation) → #3528 (support). No linked issue.

Checks

Independently tested this rebased head on Python 3.13: 7862 passed, 9 skipped, 437 deselected, 2 xfailed. Mypy passed (255 source files).

The local full runs deselect four ACP advertised-address networking cases whose connection timeouts also reproduce on the original baseline. GitHub runs the normal, unmodified workflow matrix. This PR's GitHub CI checks passed, including the complete Ubuntu Python 3.10–3.14, macOS, Windows, and Anthropic 1.x test matrix, coverage aggregation, type checks, lint, docs build, and CodeQL. Repository documentation is in #3527; website integration/build has not been run locally.

AI assistance

Codex assisted with implementation, tests, documentation, and reorganizing the stack around independent changes. The original import/type-check CI failures were reproduced locally. Required migrations now accompany the code that changes their contracts; no workflow or test skips were added to hide failures.

  • I understand the changes in this PR and can explain them in my own words.
  • I have verified that the PR description accurately reflects the actual diff.
  • If AI assistance was used, I reviewed, tested, and validated the generated code/text before submitting.

@github-actions github-actions Bot added area:deps Python dependency updates (pyproject.toml, uv.lock) area:core Agent runtime core: ag2/*.py, ag2/events, ag2/response, ag2/streams area:tools Tool system, builtin tools, subagents (ag2/tools) labels Oct 28, 2026
@Lancetnik Lancetnik mentioned this pull request Oct 28, 2026
5 of 6 tasks
@Lancetnik
Lancetnik added this pull request to stack #3525 October 28, 2026 06:53
@Lancetnik
Lancetnik force-pushed the feat/subagent-eventbus-core branch from 328d855 to 2320d01 Compare October 28, 2026 07:04
@Lancetnik
Lancetnik force-pushed the feat/subagent-eventbus-core branch from 9b3623b to 712b39b Compare October 28, 2026 20:53
@Lancetnik Lancetnik changed the title feat: add subagent event routing and scoped variables feat(events): add observation primitives and source_event properties Oct 28, 2026
@Lancetnik
Lancetnik marked this pull request as ready for review October 28, 2026 21:04
@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ag2/stream.py 20.00% 2 Missing and 2 partials ⚠️
Files with missing lines Coverage Δ
ag2/events/__init__.py 100.00% <100.00%> (ø)
ag2/events/base.py 97.56% <100.00%> (+0.04%) ⬆️
ag2/events/delegation.py 100.00% <100.00%> (ø)
ag2/events/types.py 94.49% <100.00%> (+0.05%) ⬆️
ag2/stream.py 94.80% <20.00%> (-2.52%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core Agent runtime core: ag2/*.py, ag2/events, ag2/response, ag2/streams area:deps Python dependency updates (pyproject.toml, uv.lock) area:tools Tool system, builtin tools, subagents (ag2/tools)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant