Expected behavior for two agents with same seed #517
Replies: 2 comments
-
This is a good observation. While the seed phrase is meant to be something secure and unique for every agent, we currently do not use good practices for this in our examples and docs. We have an issue for this that we intend to resolve soon: #253. When registering two agents with the same seed phrase, whichever agent registers most recently will always take precedent. This is because these registrations are indistinguishable on the contract side, and an agent always needs the ability to update its registration. So it's difficult to avoid somewhat unpredictable behavior when multiple agents register with the same seed phrase. The reason that both of your agents remain reachable is presumably because they share the same endpoint. That's why it's always better to use unique seed phrases for all agents. |
Beta Was this translation helpful? Give feedback.
-
That is indeed expected behaviour. The seed phrase is supposed to be secret and unique from the users perspective so if two agents use the same seed phrase it implies the following:
Think of it as a phone book where you can request to be registered. If another person registers with your phone number it is not the fault of your phone or the entity that handles the phone registry but rather that no-one else should 'know' your number to register it. The only thing you can do as a user is to try to make your seed phrase as unique as possible (i.e. make it a very long random string) and as @jrriehl just wrote we'll refactor the way that agents handle seed phrases in the near future to have more enforcement. |
Beta Was this translation helpful? Give feedback.
-
If we try the "sigmar" and "slaanesh" example shown here: https://fetch.ai/docs/guides/agents/intermediate/communicating-with-other-agents.
If we use the same seed for both the agents, the sigmar agent sends a "hello there slaanesh" message, but since the seed is the same, it receives the message that it sent instead of the slaanesh agent.
While I understand that seeds should be unique for every agent, I think showing an error message while trying to register another agent with the same seed would be good for error handling.
Currently, both the agents get registered and they stay available for messages, there is no error thrown, which seems like incorrect behavior.
Beta Was this translation helpful? Give feedback.
All reactions