Hey Team :wave: Been exploring the Agent Server i...
# questions
n
Hey Team 👋 Been exploring the Agent Server implementation, when a agent server is stopped and started again, the existing conversation's llm api key (agent.llm.api_key) which was configured at the time conversation was created gets set to null. Is this expected ? Is there a way to update this llm key again ?
w
CC @straight-sundown-84319 @chilly-france-44439
s
Hi Mahesh! There is indeed a way! The key is this line in the logs when the server starts:
Copy code
[12/19/25 13:24:43] WARNING  ⚠️ OH_SECRET_KEY was not defined. Secrets will not be persisted between restarts.   config.py:148
We value your security, and do not store your LLM keys unencrypted. To fix this error, define an environment variable
OH_SECRET_KEY
e.g.:
Copy code
export OH_SECRET_KEY=notasecret
The agent server will then use this to encrypt your LLM keys when storing and loading them.
n
This works thanks! I now understand how pydantic serialisation/deserialistion was happening.
I also asked about this to the AI Chatbot on the OpenHands SDK homepage, but it wasn't able to answer. I feel it would be worth adding this to the docs. I have created a small PR noting this behaviour in the README of agent server. https://github.com/OpenHands/software-agent-sdk/pull/1465 Would love your feedback. Thanks.