Skip to content

Feature transactional apis - #174

Merged
rcschrg merged 17 commits into
developmentfrom
feature-transactional-apis
Oct 2, 2026
Merged

rcschrg merged 17 commits into
developmentfrom
feature-transactional-apis

Conversation

@rcschrg

@rcschrg rcschrg commented Jul 7, 2026

Copy link
Copy Markdown
Member

No description provided.

@rcschrg rcschrg changed the title Feature transactional apis Draft: Feature transactional apis Jul 7, 2026
@codecov

codecov Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.91125% with 59 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.53%. Comparing base (862faf2) to head (e894b21).
⚠️ Report is 5 commits behind head on development.

Files with missing lines Patch % Lines
mango/container/mp.py 51.64% 44 Missing ⚠️
mango/util/multiprocessing.py 89.13% 10 Missing ⚠️
mango/agent/role.py 96.25% 3 Missing ⚠️
mango/agent/conversation.py 97.95% 2 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           development     #174      +/-   ##
===============================================
+ Coverage        89.07%   90.53%   +1.46%     
===============================================
  Files               27       32       +5     
  Lines             3533     4175     +642     
===============================================
+ Hits              3147     3780     +633     
- Misses             386      395       +9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rcschrg rcschrg changed the title Draft: Feature transactional apis Feature transactional apis Aug 24, 2026
@rcschrg
rcschrg requested a review from PHRueh August 24, 2026 12:20
Comment thread docs/source/role-api.rst Outdated
Comment thread docs/source/role-api.rst
Comment thread docs/source/role-api.rst Outdated
Comment thread docs/source/role-api.rst Outdated
Comment thread docs/source/role-api.rst
rcschrg and others added 4 commits September 21, 2026 13:23
Covers the error, teardown and empty-answer branches that the feature
tests never reach: conversation idempotence/immutable payloads/late
inbound, the gather collector's filtering rules, the dispatch
decorators' rejection paths and the sync handler bridge, the
topology health queries on agents without a topology, the simulation
world's container facade, the IPC stream framing and ownership
rules, and the two untested scheduler branches.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Docstrings, comments, docs and the readme used em dashes for three
distinct jobs: labelling a term, wrapping a parenthetical, and joining
two clauses. Each is now spelled with the punctuation that says the
same thing without the character: a colon for labels and definitions,
parentheses or commas for asides, a semicolon or a conjunction for
joined clauses. Prose only, so behaviour and RST structure are
unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

logger = logging.getLogger(__name__)

SIMULATION_ADDR = "simulation"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Its just a placeholder string, as the SimulationContainer is part of the Container class hierarchy.

``send_message`` queues messages with a delivery time computed by the
communication simulation; the world delivers them while stepping.
"""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this imply that every simulation is a communcation simulation? Can I only look at communication simulations this way, can i extend the simulation or can i swap the communication simulation ot for a different one? I am not sure how this is supposed to be used
Not every simulation with mango will be interested in message delays and packet loss between agents

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i would make the communication simulation as an instance of a simulation and put it in a folder like simulation/simulation_instances or we can talk about making a new mango library so that we can offer different instances their and the community could add their simulations there as well
because communication is a very relevant topic i think it would be fine to leave it in the mango package

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

When messages are not delivered with a real time protocol like TCP or MQTT, the behavior of such a protocol must be simulated, always. Delays are not always of interest, in that case the default communication simulator can just return some static delays. Different CommunicationSimulation classes are already possible look at the communication.py, where the built-in simulator is a subclass of CommunicationSimulation. This entry point can be used to integrate own communication simulators.

:class:`WorldRecording` / :class:`AgentsRecording` instances accessible
via ``world.data_collections`` and ``world.data_agent_collections``.
"""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I did not see this in the documentation, maybe add a short explanation and example to see when this is used best

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There are docs under Simulation World -> Data recording

world.add_data_collector(_run)


def record_position(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe use this as an example in the documentation and make the function more general like record_key(); shouldn't this function just use the record_agent_having(key: "position") ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There are examples under Simulation World -> Data recording

if container.inbox is not None:
await container.inbox.join()
for scheduled_task, task, _, _ in task_list:
# Do NOT skip this wait when the futures are already resolved. It looks

@PHRueh PHRueh Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add these kinds information to a common mistakes file in documentation?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Its not a mistake users can make, only developers working on this highly specific code, so i think the comment is correct here.

@PHRueh PHRueh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the changes and additions will be very helpful and will close the issues RPC capability
#151 and [Roles] Subscribe to message type convenience method
#41
We already discussed to add the convenience methods to the handle_message of regular non-role agents
All other issues that i see are already featured in other issues (overview over all functions, structure of the documentation)

@PHRueh

PHRueh commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

(Please smaller PRs in the future)

@rcschrg
rcschrg merged commit 72ad67e into development Oct 2, 2026
10 checks passed
@rcschrg
rcschrg deleted the feature-transactional-apis branch October 6, 2026 15:29
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.

RPC capability [Roles] Subscribe to message type convenience method

2 participants