How can the agent know it's `OPENHANDS_SESSION_ID`...
# general
b
How can the agent know it's
OPENHANDS_SESSION_ID
?
c
Is that its own
conversation_id
?
b
yes, the
conversation_id
c
I think when I wanted it, I told the agent to figure it out, inspecting its own running server via API
which is too cumbersome…
out of curiosity, how are you using it?
b
the agent needs to know its name
c
its name?
b
he communicates with other agents, and needs to tell them who is sending the msg
c
aha
b
at the end, every agent has its URL
c
how do you communicate? I had an agent mail MCP for this, and the mail server gave each agent a name, when they registered
b
yeah, but we need its session id
to know where he lives
c
We should add it
b
I think it's best to use env var, and not context
so we can reuse the prompt cache
same applies to other variable data like the DateTime: github.com/OpenHands/software-agent-sdk/issues/3690
👍 1
inspecting its own running server via API
Since now 1 sandbox can host multiple conversations, the session ID must be passed by env var or context by the agent-server, ie. it cannot be read from the filesystem.
c
That's fair, but to note, I just had a prompt like “find in the running agent-canvas your sibling working to a new transpilation of agent-sdk and send it a message” So it looked via REST API, found it, and sent a message 😅
But I’m not suggesting that 😂