openclaw/src/agents
Azade 3d40e40589 feat(sessions): expose label in sessions.list and support label lookup in sessions_send
- Add `label` field to session entries and expose it in `sessions.list`
- Display label column in the web UI sessions table
- Support `label` parameter in `sessions_send` for lookup by label instead of sessionKey

- `sessions.patch`: Accept and store `label` field
- `sessions.list`: Return `label` in session entries
- `sessions_spawn`: Pass label through to registry and announce flow
- `sessions_send`: Accept optional `label` param, lookup session by label if sessionKey not provided
- `agent` method: Accept `label` and `spawnedBy` params (stored in session entry)

- Add `label` column to sessions table in web UI

- Changed session store writes to merge with existing entry (`{ ...existing, ...new }`)
  to preserve fields like `label` that might be set separately

We attempted to implement label persistence "properly" by passing the label
through the `agent` call and storing it during session initialization. However,
the auto-reply flow has multiple write points that overwrite the session entry,
and making all of them merge-aware proved unreliable.

The working solution patches the label in the `finally` block of
`runSubagentAnnounceFlow`, after all other session writes complete.
This is a workaround but robust - the patch happens at the very end,
just before potential cleanup.

A future refactor could make session writes consistently merge-based,
which would allow the cleaner approach of setting label at spawn time.

```typescript
// Spawn with label
sessions_spawn({ task: "...", label: "my-worker" })

// Later, find by label
sessions_send({ label: "my-worker", message: "continue..." })

// Or use sessions_list to see labels
sessions_list() // includes label field in response
```
2026-01-09 15:32:49 +01:00
..
pi-extensions fix: align tool rename fallout 2026-01-09 05:54:34 +01:00
tools feat(sessions): expose label in sessions.list and support label lookup in sessions_send 2026-01-09 15:32:49 +01:00
agent-paths.test.ts fix(agents): default agent dir to multi-agent path 2026-01-06 21:54:42 +00:00
agent-paths.ts fix(agents): default agent dir to multi-agent path 2026-01-06 21:54:42 +00:00
agent-scope.test.ts feat: wire multi-agent config and routing 2026-01-09 12:48:42 +00:00
agent-scope.ts feat: wire multi-agent config and routing 2026-01-09 12:48:42 +00:00
auth-health.test.ts feat(models): add oauth auth health 2026-01-09 00:34:38 +00:00
auth-health.ts feat: support token auth profiles 2026-01-09 08:13:04 +01:00
auth-profiles.test.ts feat(models): add per-agent auth order overrides 2026-01-09 14:07:45 +00:00
auth-profiles.ts feat(models): add per-agent auth order overrides 2026-01-09 14:07:45 +00:00
bash-process-registry.test.ts refactor: remove bash pty mode 2026-01-03 20:15:10 +00:00
bash-process-registry.ts fix: scope process sessions per agent 2026-01-07 23:35:04 +01:00
bash-tools.test.ts test: stabilize doctor + bash tool tests 2026-01-08 23:44:54 +01:00
bash-tools.ts fix: scope process sessions per agent 2026-01-07 23:35:04 +01:00
claude-cli-runner.test.ts test: stabilize claude cli serialization test 2026-01-09 05:27:50 +00:00
claude-cli-runner.ts feat: wire multi-agent config and routing 2026-01-09 12:48:42 +00:00
clawdbot-gateway-tool.test.ts feat: wire multi-agent config and routing 2026-01-09 12:48:42 +00:00
clawdbot-tools.agents.test.ts feat: wire multi-agent config and routing 2026-01-09 12:48:42 +00:00
clawdbot-tools.camera.test.ts fix(nodes-tool): add run invoke timeout (PR #433, thanks @sircrumpet) 2026-01-08 00:18:06 +00:00
clawdbot-tools.sessions.test.ts feat: multi-agent routing + multi-account providers 2026-01-06 18:33:37 +00:00
clawdbot-tools.subagents.test.ts feat: wire multi-agent config and routing 2026-01-09 12:48:42 +00:00
clawdbot-tools.ts feat: unify message cli and tools 2026-01-09 08:30:24 +01:00
context.ts chore: rename project to clawdbot 2026-01-04 14:38:51 +00:00
defaults.ts feat(agent): enforce provider/model and identity defaults 2025-12-14 04:22:38 +00:00
identity.ts feat: migrate agent config to multi-agent layout 2026-01-09 12:44:29 +00:00
minimax.live.test.ts Onboarding: add MiniMax hosted API key option 2026-01-09 13:39:28 +01:00
model-auth.test.ts fix: normalize z.ai provider ids in auth profiles 2026-01-07 05:31:01 +01:00
model-auth.ts Onboarding: add MiniMax hosted API key option 2026-01-09 13:39:28 +01:00
model-catalog.ts chore: rename project to clawdbot 2026-01-04 14:38:51 +00:00
model-fallback.ts feat: wire multi-agent config and routing 2026-01-09 12:48:42 +00:00
model-scan.test.ts feat: add model scan progress callbacks 2026-01-08 05:20:39 +01:00
model-scan.ts style: apply lint fixes 2026-01-08 04:44:15 +00:00
model-selection.test.ts feat: wire multi-agent config and routing 2026-01-09 12:48:42 +00:00
model-selection.ts feat: wire multi-agent config and routing 2026-01-09 12:48:42 +00:00
models-config.test.ts chore: rename project to clawdbot 2026-01-04 14:38:51 +00:00
models-config.ts feat: multi-agent routing + multi-account providers 2026-01-06 18:33:37 +00:00
pi-embedded-block-chunker.ts fix: preserve markdown fences when chunking 2026-01-06 20:23:41 +01:00
pi-embedded-helpers.test.ts 🤖 codex: strip empty assistant blocks from history (#210) 2026-01-08 21:53:33 +01:00
pi-embedded-helpers.ts 🤖 codex: strip empty assistant blocks from history (#210) 2026-01-08 21:53:33 +01:00
pi-embedded-runner-extraparams.test.ts feat: wire multi-agent config and routing 2026-01-09 12:48:42 +00:00
pi-embedded-runner.test.ts fix: bypass Anthropic OAuth token blocking for tool names 2026-01-09 05:48:54 +01:00
pi-embedded-runner.ts feat: wire multi-agent config and routing 2026-01-09 12:48:42 +00:00
pi-embedded-subscribe.test.ts fix: normalize <think> reasoning blocks 2026-01-09 08:30:05 +00:00
pi-embedded-subscribe.ts fix: repair typing for thinking promotion 2026-01-09 08:37:38 +00:00
pi-embedded-utils.ts feat: add /reasoning reasoning visibility 2026-01-07 06:17:31 +01:00
pi-embedded.ts feat: gate slash commands and add compact 2026-01-06 02:23:55 +01:00
pi-tool-definition-adapter.test.ts fix(tools): keep tool errors concise 2026-01-07 19:08:13 +00:00
pi-tool-definition-adapter.ts fix(tools): keep tool errors concise 2026-01-07 19:08:13 +00:00
pi-tools-agent-config.test.ts feat: wire multi-agent config and routing 2026-01-09 12:48:42 +00:00
pi-tools.test.ts feat: wire multi-agent config and routing 2026-01-09 12:48:42 +00:00
pi-tools.ts feat: wire multi-agent config and routing 2026-01-09 12:48:42 +00:00
sandbox-agent-config.test.ts test: stabilize sandbox/doctor tests 2026-01-09 15:17:20 +01:00
sandbox-create-args.test.ts feat: add sandbox scope default 2026-01-07 02:52:41 +01:00
sandbox-merge.test.ts test: stabilize sandbox/doctor tests 2026-01-09 15:17:20 +01:00
sandbox-paths.ts feat: add per-session agent sandbox 2026-01-03 21:41:58 +01:00
sandbox.ts feat: wire multi-agent config and routing 2026-01-09 12:48:42 +00:00
shell-utils.ts fix: clean agent bash lint 2025-12-25 03:29:36 +01:00
skills-install.ts style: format lint offenders 2026-01-07 00:04:44 +01:00
skills-status.ts style: tidy cli formatting 2026-01-08 08:26:40 +01:00
skills.test.ts feat: sync skills into sandbox workspace 2026-01-09 00:33:09 +01:00
skills.ts feat: sync skills into sandbox workspace 2026-01-09 00:33:09 +01:00
subagent-announce.ts feat(sessions): expose label in sessions.list and support label lookup in sessions_send 2026-01-09 15:32:49 +01:00
subagent-registry.ts feat(sessions): expose label in sessions.list and support label lookup in sessions_send 2026-01-09 15:32:49 +01:00
system-prompt.test.ts fix: update changelog + prompt test 2026-01-08 20:08:27 +01:00
system-prompt.ts feat(system-prompt): add messaging guidance section 2026-01-09 03:00:40 +01:00
timeout.ts feat: wire multi-agent config and routing 2026-01-09 12:48:42 +00:00
tool-display.json feat: unify message cli and tools 2026-01-09 08:30:24 +01:00
tool-display.ts fix(build): import tool-display.json instead of fs.readFileSync (#312) 2026-01-06 10:55:02 -06:00
tool-images.test.ts fix: resolve camera tool handling 2026-01-02 17:44:25 +00:00
tool-images.ts chore: rename project to clawdbot 2026-01-04 14:38:51 +00:00
usage.test.ts fix: restore Anthropic token accounting 2026-01-06 18:52:01 +00:00
usage.ts style(agents): format usage helper 2026-01-06 19:54:50 +01:00
workspace.test.ts feat: update heartbeat defaults 2026-01-06 21:54:42 +00:00
workspace.ts docs: rewrite cron jobs guide and heartbeat notes 2026-01-06 22:28:42 +00:00
zai.live.test.ts chore: apply biome formatting 2026-01-01 17:30:15 +01:00