Hermes-Agent Multi-Agent OAuth Auth.json Auto-Renewal Guide

Preface

Hermes-agent uses the free Xiaomi model provided by Nous Portal, which is logged in via OAuth.
When we configure multi-agent and want to use the same OAuth, we encounter the issue of updating the api key
Error code 401 indicating invalid or banned API key or insufficient balance, visit portal.nousresearch.com

There are 2 solutions

1. The default agent hermes maintains auth.json, and the agents under the profile only use auth.json
Detailed description as follows:
Make a symlink of the default agent's auth.json to all agents under the profile
The default agent hermes maintains auth.json, and if it's about to expire, hermes will automatically renew it
The agents under the profile only read the api key inside for use, and don't care about auto-renewal
* To achieve no auto-renewal trigger, you need to modify the hermes code. (Of course, you can let It modify itself)

The drawback is that you need to use the default agent hermes from time to time, so as to trigger the auto-renewal of auth.json.

2. Stagger the auto-renewal triggers for each agent
Make a symlink of the default agent's auth.json to all agents under the profile
The auto-renewal lead time that each agent maintains for auth.json is configurable
* To implement writing the auto-renewal lead time into environment variables, you need to modify the hermes code (Of course, you can let It modify itself)
All agents (including the default agent and the agents under the profile) have different auto-renewal lead times, staggered by a period.
For example:
Default agent leads by 1800 (30 minutes)
agent-watch leads by 1850
agent-design leads by 1900
agent-code leads by 1950
agent-test leads by 2000

========

update

github
https://github.com/crazypeace/hermes-auth-json-extend

========

Continue reading

Comments