Skip to content

Improving fjagepy#384

Open
notthetup wants to merge 3 commits intomasterfrom
fjagepy-message-str
Open

Improving fjagepy#384
notthetup wants to merge 3 commits intomasterfrom
fjagepy-message-str

Conversation

@notthetup
Copy link
Collaborator

@notthetup notthetup commented Dec 5, 2025

Improvements to fjagepy coming in mainly from issues/warnings found downstream in https://github.com/org-arl/unetsockets/tree/master/python/unetpy

  • Updated the _msg_rx method in Gateway.py to ignore incoming messages with the exact content {"alive": true}, preventing unnecessary processing of alive messages.

  • Refactored the __str__ and _repr_pretty_ methods in Message.py to provide clearer and more informative string representations of messages, including handling cases with empty content and improving pretty printing.

  • Added an agentTypes field to the JSONMessage class to support lists of agent types in message payloads.

@notthetup notthetup changed the base branch from master to fjagepy-no-self December 5, 2025 08:06
@notthetup notthetup changed the title WIP Improving fjagepy Dec 5, 2025
@notthetup notthetup requested a review from Copilot December 11, 2025 02:03

This comment was marked as resolved.

Base automatically changed from fjagepy-no-self to master December 11, 2025 05:12
@notthetup notthetup requested a review from mchitre December 11, 2025 10:13
@notthetup notthetup self-assigned this Dec 11, 2025
@mchitre
Copy link
Member

mchitre commented Dec 14, 2025

Are we sure we should not respond to alive messages in fjågepy?

Copy link
Member

@mchitre mchitre left a comment

Choose a reason for hiding this comment

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

Are we sure we should not respond to alive messages in fjågepy?

@notthetup
Copy link
Collaborator Author

notthetup commented Jan 2, 2026

Are we sure we should not respond to alive messages in fjågepy?

I guess we missed capturing this in the Gateway spec. Who's the first to send {alive: true}? The master container or the gateway? I am currently under the assumption that it's usually Gateway that sends it and the Master container replies?

All we currently mention is

Must send a {"alive": false} message to the master container before closing.

https://github.com/org-arl/fjage/blob/1a87755eb9688bdfc743631ba2efaec9f4735b20/gateways/Gateways.md#close--void---void

@mchitre
Copy link
Member

mchitre commented Jan 24, 2026

Are we sure we should not respond to alive messages in fjågepy?

I guess we missed capturing this in the Gateway spec. Who's the first to send {alive: true}? The master container or the gateway? I am currently under the assumption that it's usually Gateway that sends it and the Master container replies?

As soon as a slave connected, master says:

{"alive": true}

If the slave does not respond to this within a timeout (15 seconds or so), master drops the connection.

@notthetup
Copy link
Collaborator Author

Most Gateways start by sending a {alive: true} at connection , which seems like enough in current implementations?

@mchitre
Copy link
Member

mchitre commented Jan 24, 2026

Most Gateways start by sending a {alive: true} at connection , which seems like enough in current implementations?

Yes, I believe so. Because this validates the gateway as alive.

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.

2 participants