fetchai / agentverse

Public repository for Agentverse
Apache License 2.0
1 stars 4 forks source link

Can't send message to hosted agent neither from script nor from DeltaV/AI engine #12

Closed zmezei closed 4 days ago

zmezei commented 1 week ago

Prerequisites

Category

Bug in Agentverse

Expected Behavior

Being able to send message to a hosted agent from an agent script or from DeltaV/AI engine.

Observed Behavior

Not being able to send message to a hosted agent from an agent script or from DeltaV/AI engine.

To Reproduce

I tried it multiple times, for example I have a running hosted agent with address agent1qdmtwdg0qnv50mf2s3ntppal5339ms57wnya0xk6ttvt72tq269c6ll82rw.

image

It doesn't show any error in logs:

image

but when I try to send message from DeltaV or from a local script it says that it can't resolve endpoint: local script:

agent = Agent(
    name="machines_adapter",
    port=8431,
    endpoint=["http://127.0.0.1:8432/submit"],
    seed=AGENT_SEED,
)

if __name__ == "__main__":
    @agent.on_interval(period=10)
    async def start_machines_adapter(ctx: Context):
        ctx.logger.info(f"Sending message to agent agent1qdmtwdg0qnv50mf2s3ntppal5339ms57wnya0xk6ttvt72tq269c6ll82rw")
        msg_status = await ctx.send("agent1qdmtwdg0qnv50mf2s3ntppal5339ms57wnya0xk6ttvt72tq269c6ll82rw", PingRequest())
        ctx.logger.info(f"msg_status: {msg_status}")

    print(f"Agent address: {agent.address}")
    agent.run()

log of the running agent:

ERROR:    [machines_adapter]: Unable to resolve destination endpoint
INFO:     [machines_adapter]: msg_status: MsgStatus(status=<DeliveryStatus.FAILED: 'failed'>, detail='Unable to resolve destination endpoint', destination='agent1qdmtwdg0qnv50mf2s3ntppal5339ms57wnya0xk6ttvt72tq269c6ll82rw', endpoint='')

DeltaV:

image

As you can see the agent address is the same everywhere.

Environment Details (Optional)

No response

Failure Logs (Optional)

No response

Additional Information (Optional)

No response

lrahmani commented 1 week ago

Issue is due to uagents and delta-v using almanac contract to resolve agents addresses. Hosted agents register first to almanac api and then send the registration request to the contract in a best effort fashion. I increased system resources to expedite contract registration requests and we will update uagents to always resolve addresses from almanac api first

jainsangam805 commented 6 days ago

All hosted active/running agents on AV, are showing offline on DV Almanac status is also active but found no endpoints from contract

qati commented 4 days ago

uagents 0.13 fixes the issue. Ai engine uagents upgrade rolled out to prod now