Skip to content

Commit 892ff0e

Browse files
committed
Send the new agent's id as agent in agent_create
1 parent 07f0833 commit 892ff0e

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎crates/daemon/src/lib.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ fn handle(hub: &Arc<Hub>, client: u64, text: &str) {
191191
let text = |key: &str| op[key].as_str().unwrap_or_default();
192192
hub.agents
193193
.create(
194-
text("id"),
194+
text("agent"),
195195
text("name"),
196196
&PathBuf::from(text("cwd")),
197197
text("role"),

‎crates/daemon/tests/daemon.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ fn session_switching_commands_are_refused() {
313313
fn create_agent(client: &mut Client, id: &str, role: &str) -> PathBuf {
314314
let dir = temp_dir(&format!("agent-{id}"));
315315
client.send(json!({
316-
"op": "agent_create", "id": id, "name": id, "cwd": dir, "role": role,
316+
"op": "agent_create", "agent": id, "name": id, "cwd": dir, "role": role,
317317
}));
318318
client.until(|frame| frame["type"] == "agent_created" && frame["agent"]["id"] == id);
319319
dir

‎docs/daemon-protocol.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ every connected client.
7070
| `watch` / `unwatch` | `session` | `watching` with `watching: true/false`; `watch` also sends this client a snapshot of the session: its state events (`startup`, `model_status`, `command_list`, `approval_mode`, `mcp_servers`), a `transcript` of the conversation so far and `attended` |
7171
| `actions_list` | — | `actions`: undecided deferred actions across all sessions |
7272
| `agent_list` | — | `agents` |
73-
| `agent_create` | `id`, `name`, `cwd`, `role` | `agent_created`; every client also receives the new `agents` list |
73+
| `agent_create` | `agent` (the new agent's id), `name`, `cwd`, `role` | `agent_created`; every client also receives the new `agents` list |
7474
| `message_send` | `agent`, `body`, optional `session`, `reply_to`, `dedupe_key` | `message_accepted` with `message` and `duplicate` |
7575
| `timer_list` | — | `timers`: active timers of all agents |
7676

0 commit comments

Comments
 (0)