Choose an agent with a swipe at Ready (0.2.0)

Bridge: an owner-configured list of agents (HERMEVEN_AGENTS). Each extra
agent is another profile of the same Hermes gateway, reached at
/p/<profile> with that profile's own key. GET /v1/agents lists ids and
names; POST /v1/conversations takes an optional agent_id checked against
the list. A conversation belongs to one agent (migration v3) and its turns
are submitted, polled and stopped at that agent. /v1/device is unchanged so
clients built earlier keep working.

Client: at Ready a swipe moves between agents; the name is shown through
the exchange; each agent keeps its own conversation; a follow-up goes to
the agent that answered. Reopened within the conversation window it opens
on the last agent, otherwise on the default. With one agent, or a bridge
without /v1/agents, nothing changes.

Also: contract section G, server survey and key evidence, the 0.1.2
upload, and the CODY-020 correction. Not reviewed, not deployed, not
uploaded.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Dan
2026-11-21 16:08:11 -08:00
co-authored by Claude Fable 5.2
parent 15714bd848
commit 9394c249ad
20 changed files with 1117 additions and 42 deletions
+22 -1
View File
@@ -18,7 +18,8 @@ Every error has the shape:
| `GET /v1/device` | Pairing status, limits, whether the agent is reachable and STT is configured. | 200 |
| `POST /v1/device/renew` | Rotate the device token. The old token stops working at once. | 200 |
| `DELETE /v1/device` | Revoke this device and close its conversation. | 200 |
| `POST /v1/conversations` | Start a new conversation; closes the device's previous one. | 201 |
| `GET /v1/agents` | The agents this device may talk to, default first: `{agents: [{id, name}]}`. Ids and display names only; no address, profile or key. Added after 0.1.x: an older bridge answers 404 `not_found`, which a client must treat as "one agent". | 200 |
| `POST /v1/conversations` | Start a new conversation. Optional `agent_id` (an id from `/v1/agents`; omitted = the default agent; anything else is 400 `invalid_request`). Closes the device's previous conversation **with that agent** only. | 201 |
| `POST /v1/turns` | Create one turn (text or audio). | 202, or 200 for a duplicate |
| `GET /v1/turns/{request_id}` | Current state and result. | 200 |
| `POST /v1/turns/{request_id}/cancel` | Request cancellation. Idempotent. | 200 |
@@ -26,6 +27,26 @@ Every error has the shape:
There is no SSE endpoint. Streaming through the Even WebView is undocumented and untested, so
polling is the supported path.
## More than one agent
The bridge can be given further agents besides the default one. Each is another profile served by
the same Hermes gateway (`gateway.multiplex_profiles`), reached at `<HERMES_BASE_URL>/p/<profile>`
with that profile's own `API_SERVER_KEY`; Hermes refuses the default profile's key there.
```
HERMEVEN_AGENT_NAME=Pepper # display name of the default agent (default: Agent)
HERMEVEN_AGENTS=wendy,cody # extra agent ids, in display order
HERMEVEN_AGENT_WENDY_API_KEY=... # required for each extra agent
HERMEVEN_AGENT_WENDY_PROFILE=wendy # optional; default: the id
HERMEVEN_AGENT_WENDY_NAME=Wendy # optional; default: the id, capitalised
```
The list is the owner's allow-list. A client names an agent only by id, only when creating a
conversation, and the id is checked against the list; it is never used to build an address. A
turn goes to the agent of its conversation. Each agent has its own conversation and its own
Hermes session, so nothing said to one is sent to another. `/v1/device` is unchanged, and its
`active_conversation_id` and `agent_reachable` describe the default agent.
## Creating a turn
Typed text (`Content-Type: application/json`):
@@ -112,6 +112,23 @@ F4 as revised (build 0.1.2): the countdown runs however the app was opened. It s
leaves while recording, transcribing, waiting for the agent or for an approval, or while
unpaired, and a touch on the phone page still holds it open for two minutes.
### G. Choosing an agent (from Dan's words on 2026-11-21)
A build for trial. Per Dan's standing instruction, his keep/change/remove decisions follow the
device trial; nothing here is pre-accepted beyond what he is quoted as asking for.
| # | Dan said | Criterion |
|---|---|---|
| G1 | "what I want to build next is the ability to chat with all my agents... wendy is a sub-agent of pepper and being able to summon her through the app would be ideal." | The app can talk to more than one agent through the one bridge. |
| G2 | "when pepper opens, and is inthe ready state, what if swiping could change the active agent? So pepper would show, but if we swipe, it would move between different available agents?" | At Ready a swipe moves to the next or previous agent; the app opens on the default agent and shows the current agent's name. |
| G3 | "when no name is stated, then it uses pepper/default." | With no choice made, questions go to the default agent exactly as before. |
| G4 | Asked whether to reopen on Pepper or on the last agent: "could we use the same 15 minute time out (I think that's what it is) that determines if it's a new session, or picks up from the last?" | Reopened within the conversation window (ten minutes; Dan was told it is ten, not fifteen), the app opens on the agent last talked to, in the same conversation; otherwise on the default. |
| G5 | On the agent list coming from the bridge's settings: "Yeah, sure. that's fine." | The list is configured on the bridge; the phone can only pick from it. |
| G6 | "Pepper, wendy and cody. yes. go for it." | The three agents for the first trial. Also Dan's go-ahead for giving the wendy and cody profiles an API key on the server. |
| G7 | (implementer's choices, not requested) | Each agent has its own conversation. A follow-up goes to the agent that answered. On an answer a swipe still turns the page. The agent's name is shown while listening, thinking and on the answer. With only one agent the screens are unchanged. |
Not built: saying a name to route a question. Dan first preferred it, then proposed the swipe.
## Out of scope for this contract
Wake word ("Hey Pepper"), automatic end-of-speech detection, summoning other agents by name,
+35
View File
@@ -257,3 +257,38 @@ message by a few minutes, on the owner's instruction. `evenhub ls` at 23:21 UTC:
0.1.1; 0.1.0 retained, on no channel. The server was not changed.
Build 0.1.2 has **not** been uploaded.
## 23:48 UTC: build 0.1.2 uploaded
Cody, Round 14: SHIP (trial designation SHIP FOR TRIAL) on
`15714bd848a7bf7230bb80d187de85af4b3fa66b`. Dan: "yes, upload 0.1.2". `evenhub upload` (id 155527,
99,892 bytes, SHA-256 `3781f3e8256f0efdba4155fbd5d0926a6726f14ca3ed89bc039d34b48a0f608b`, built from
that commit) and `evenhub promote 0.1.2 --to beta`. Dan has not reported a trial of 0.1.2.
## 23:52 to 23:58 UTC: Hermes profiles surveyed; keys added for wendy and cody
Read-only survey (Dan: "Yes, take a read-only survey"):
| Found | Detail |
|---|---|
| Profiles | default, cody, jeanette, natalie, wendy, all with a running gateway |
| Gateways | `hermes-gateway.service` serves default, cody, natalie and wendy (`gateway.multiplex_profiles: true`); `hermes-gateway-jeanette.service` is separate and not on port 8642 |
| API | Hermes v0.23.1 source: named profiles are served at `/p/<profile>/...` on the same port, each authorised by that profile's own `API_SERVER_KEY`, failing closed without one |
| Unauthenticated probes | `/p/wendy/health`, `/p/cody/health`, `/p/natalie/health`: 200. `/p/jeanette/health`, `/p/nosuch/health`: 404 |
| Keys before | Only the default profile had `API_SERVER_KEY` |
Changes (Dan: "Pepper, wendy and cody. yes. go for it."):
| Step | Result |
|---|---|
| `API_SERVER_KEY` (64 hex, generated on the server, never displayed) appended to `profiles/wendy/.env`; previous file kept as `.env.bak-hermeven-<time>` | File stays `hermes` 600. No gateway restart. |
| Same for `profiles/cody/.env` | Same. |
| Wendy's key at `/p/wendy/v1/runs/<unknown>` | 404: accepted, no such run. Effective without a restart. |
| Wendy's key at the default address; the default key at `/p/wendy`; Cody's key at `/p/wendy` | 401 each |
| One test question to Wendy through `POST /p/wendy/v1/runs` with an idempotency key ("connection test... Do not use any tools.") | 202; an identical resubmit returned the same run; completed in 4 s with a one-sentence answer identifying herself as Wendy. This created one session in Wendy's profile. |
| That run looked up at the default address with the default key | 404 |
| Cody's key at `/p/cody/v1/runs/<unknown>` | 404: accepted. No question was sent to Cody. |
`platforms.api_server.enabled` is `false` in wendy's and natalie's profile settings; the request
above worked regardless. The bridge on the server was **not** changed: it still runs `d90cd89`
with one agent, and the new keys are not yet in its settings.
+7 -1
View File
@@ -641,7 +641,13 @@ No check was omitted.
| Never paired: nothing leaves in 30 minutes, even with a gesture and a `glassesMenu` source | both files |
| Simulator: opened by URL with no gesture, leaves from Ready after the shortened wait; exit confirmed; display empty | eighth simulator scenario |
Negative control: with the old rule restored (leave only after a `glassesMenu` launch source),
Correction (CODY-020, Round 14): the mutation described next is **stricter** than the previous
implementation, which also armed after any gesture. It is
`|| this.launchSource !== 'glassesMenu'` added to the guard in `scheduleIdleExit()`. Cody restored
the exact previous controller from `3e04688` and reported 7 failed, 62 passed of 69; the
implementer did not re-run that.
Negative control (stricter mutation): leave only after a `glassesMenu` launch source,
11 of the 69 tests in the two files fail, including all five new cases above except "never
paired". The CODY-019 control was not re-run; `activityEpoch` and its tests are unchanged and
pass.