Huixin615
f43aa78107
fix(agents): sync agent_name across context/configurable and reject empty soul ( #3549 ) ( #3553 )
...
* fix(agents): sync agent_name across context/configurable and reject empty soul (#3549 )
Two independent issues caused custom agent creation to silently fail:
1. build_run_config only wrote agent_name into one container (configurable
or context), so setup_agent — which reads ToolRuntime.context exclusively
since LangGraph >=1.1.9 — saw agent_name=None and wrote SOUL.md to the
global base_dir instead of users/{user_id}/agents/{name}/. Mirror the
dual-write pattern already used by merge_run_context_overrides and
naming.py so both containers always carry the same value.
2. setup_agent persisted whatever soul string it received, including empty
or whitespace-only content, and still reported success. The frontend
then surfaced an unusable agent and the global default SOUL.md could be
silently overwritten with empty content. Reject empty soul before any
filesystem operation so the model can retry.
Tests:
- test_gateway_services.py: dual-write regressions for both configurable
and context entry paths, explicit-agent-name precedence on both sides,
and a shape-parity test against merge_run_context_overrides.
- test_setup_agent_tool.py: empty/whitespace soul rejection, plus
no-overwrite guarantees for existing global and per-agent SOUL.md.
* Update services.py
2026-06-14 10:40:16 +08:00
..
2026-06-13 06:38:54 +08:00
2026-06-11 17:50:36 +08:00
2026-06-12 17:16:01 +08:00
2026-05-12 23:18:54 +08:00
2026-06-09 21:58:31 +08:00
2026-04-26 15:09:25 +08:00
2026-06-01 15:50:39 +08:00
2026-05-26 23:30:24 +08:00
2026-06-09 21:58:31 +08:00
2026-06-08 12:35:03 +08:00
2026-03-27 20:03:30 +08:00
2026-06-12 15:24:58 +08:00
2026-06-11 17:53:37 +08:00
2026-06-11 17:53:37 +08:00
2026-05-21 14:44:34 +08:00
2026-06-02 22:55:59 +08:00
2026-06-09 15:45:28 +08:00
2026-05-15 22:15:58 +08:00
2026-05-29 23:05:59 +08:00
2026-05-16 09:24:40 +08:00
2026-04-26 11:08:11 +08:00
2026-06-12 15:24:58 +08:00
2026-04-26 11:08:11 +08:00
2026-06-12 15:24:58 +08:00
2026-06-13 22:47:35 +08:00
2026-06-12 09:45:26 +08:00
2026-05-20 16:37:36 +08:00
2026-06-12 15:24:58 +08:00
2026-06-12 15:24:58 +08:00
2026-06-12 15:24:58 +08:00
2026-05-02 15:19:28 +08:00
2026-06-13 22:34:00 +08:00
2026-04-14 10:29:44 +08:00
2026-04-26 11:09:55 +08:00
2026-06-09 11:56:28 +08:00
2026-04-19 22:00:58 +08:00
2026-03-30 07:41:18 +08:00
2026-04-25 19:40:06 +08:00
2026-04-07 18:21:22 +08:00
2026-06-09 11:56:28 +08:00
2026-05-21 16:49:31 +08:00
2026-03-29 21:03:58 +08:00
2026-05-04 09:56:16 +08:00
2026-06-10 23:26:15 +08:00
2026-05-02 15:04:11 +08:00
2026-06-10 21:36:25 +08:00
2026-03-14 22:55:52 +08:00
2026-04-26 11:05:47 +08:00
2026-03-29 15:31:18 +08:00
2026-05-07 16:15:15 +08:00
2026-05-07 16:15:15 +08:00
2026-06-12 15:24:58 +08:00
2026-06-10 23:57:17 +08:00
2026-05-29 17:46:24 +08:00
2026-06-08 07:59:50 +08:00
2026-06-05 15:21:41 +08:00
2026-06-02 22:43:22 +08:00
2026-06-05 15:21:41 +08:00
2026-06-05 15:21:41 +08:00
2026-06-08 23:17:22 +08:00
2026-06-02 22:43:22 +08:00
2026-05-26 23:30:24 +08:00
2026-05-20 10:00:17 +08:00
2026-05-10 22:28:29 +08:00
2026-06-12 17:16:01 +08:00
2026-06-09 15:29:40 +08:00
2026-04-30 11:25:33 +08:00
2026-06-12 15:24:58 +08:00
2026-06-13 23:27:17 +08:00
2026-03-31 22:19:27 +08:00
2026-06-13 22:47:35 +08:00
2026-05-09 19:39:36 +08:00
2026-04-26 11:09:56 +08:00
2026-04-08 17:13:39 +08:00
2026-04-26 11:09:55 +08:00
2026-06-12 15:24:58 +08:00
2026-04-18 22:47:42 +08:00
2026-04-10 17:43:39 +08:00
2026-05-21 21:18:10 +08:00
2026-05-11 17:38:37 +08:00
2026-05-21 21:18:10 +08:00
2026-06-07 11:24:30 +08:00
2026-06-07 11:24:30 +08:00
2026-06-09 15:29:40 +08:00
2026-06-14 10:40:16 +08:00
2026-03-23 18:07:33 +08:00
2026-03-14 22:55:52 +08:00
2026-03-26 14:20:18 +08:00
2026-05-18 22:07:01 +08:00
2026-06-12 15:24:58 +08:00
2026-05-19 22:11:46 +08:00
2026-06-08 23:25:29 +08:00
2026-05-29 09:27:53 +08:00
2026-06-10 16:11:00 +08:00
2026-06-09 11:56:28 +08:00
2026-06-10 23:26:15 +08:00
2026-06-09 23:07:17 +08:00
2026-06-07 17:47:11 +08:00
2026-04-11 16:52:10 +08:00
2026-05-08 10:13:11 +08:00
2026-06-09 23:16:14 +08:00
2026-05-17 08:26:04 +08:00
2026-05-28 15:48:32 +08:00
2026-04-30 22:27:14 +08:00
2026-05-07 16:15:15 +08:00
2026-05-21 14:36:07 +08:00
2026-06-03 18:11:38 +08:00
2026-06-08 12:21:02 +08:00
2026-04-25 09:18:13 +08:00
2026-03-14 22:55:52 +08:00
2026-06-07 21:37:30 +08:00
2026-05-19 22:11:46 +08:00
2026-06-10 23:26:15 +08:00
2026-05-15 10:26:35 +08:00
2026-05-15 10:26:35 +08:00
2026-04-26 11:13:01 +08:00
2026-04-26 15:09:25 +08:00
2026-04-17 12:00:31 +08:00
2026-04-26 11:09:55 +08:00
2026-04-26 15:09:25 +08:00
2026-05-28 07:46:44 +08:00
2026-04-14 15:01:06 +08:00
2026-05-05 23:17:42 +08:00
2026-05-15 22:30:05 +08:00
2026-03-22 20:39:26 +08:00
2026-06-08 22:04:38 +08:00
2026-05-28 08:20:52 +08:00
2026-04-26 11:09:55 +08:00
2026-04-09 16:07:16 +08:00
2026-05-28 18:24:32 +08:00
2026-06-08 22:04:38 +08:00
2026-03-26 15:07:05 +08:00
2026-06-09 18:01:43 +08:00
2026-06-12 15:24:58 +08:00
2026-05-09 09:49:08 +08:00
2026-05-21 16:22:09 +08:00
2026-04-26 11:13:01 +08:00
2026-04-10 20:40:30 +08:00
2026-05-17 15:23:42 +08:00
2026-03-14 22:55:52 +08:00
2026-03-14 22:55:52 +08:00
2026-06-12 15:24:58 +08:00
2026-06-11 17:53:37 +08:00
2026-06-08 17:32:41 +08:00
2026-06-09 21:58:31 +08:00
2026-04-26 15:09:25 +08:00
2026-06-12 22:58:30 +08:00
2026-06-10 08:33:29 +08:00
2026-06-12 16:48:47 +08:00
2026-05-21 14:48:28 +08:00
2026-05-23 00:09:06 +08:00
2026-05-31 22:42:13 +08:00
2026-06-01 15:50:39 +08:00
2026-05-28 08:20:52 +08:00
2026-05-03 23:40:59 +08:00
2026-05-22 21:20:28 +08:00
2026-05-22 21:20:28 +08:00
2026-05-22 21:20:28 +08:00
2026-04-07 17:15:24 +08:00
2026-06-03 22:02:27 +08:00
2026-06-11 17:50:36 +08:00
2026-04-09 17:21:23 +08:00
2026-04-09 17:21:23 +08:00
2026-04-18 08:46:59 +08:00
2026-05-21 20:35:46 +08:00
2026-06-12 10:20:38 +08:00
2026-06-12 09:45:26 +08:00
2026-05-17 08:59:42 +08:00
2026-06-13 08:58:19 +08:00
2026-03-26 14:20:18 +08:00
2026-05-02 16:22:35 +08:00
2026-05-12 23:18:54 +08:00
2026-05-12 23:18:54 +08:00
2026-06-14 10:40:16 +08:00
2026-06-12 15:24:58 +08:00
2026-05-01 13:23:26 +08:00
2026-05-28 15:48:32 +08:00
2026-03-25 16:28:33 +08:00
2026-04-23 14:06:14 +08:00
2026-05-28 15:48:32 +08:00
2026-05-28 15:48:32 +08:00
2026-05-03 23:40:59 +08:00
2026-06-03 21:53:52 +08:00
2026-05-07 08:34:43 +08:00
2026-06-12 15:24:58 +08:00
2026-06-09 23:07:17 +08:00
2026-03-30 16:02:23 +08:00
2026-06-12 15:24:58 +08:00
2026-04-06 14:51:10 +08:00
2026-06-14 10:30:45 +08:00
2026-06-08 23:17:22 +08:00
2026-06-08 23:17:22 +08:00
2026-05-08 10:08:53 +08:00
2026-04-23 23:59:47 +08:00
2026-05-02 06:37:49 +08:00
2026-06-07 22:49:55 +08:00
2026-04-12 16:40:21 +08:00
2026-05-10 22:47:30 +08:00
2026-06-08 15:48:00 +08:00
2026-06-07 17:55:04 +08:00
2026-05-21 07:47:19 +08:00
2026-05-21 21:18:10 +08:00
2026-06-12 15:24:58 +08:00
2026-03-26 17:39:16 +08:00
2026-06-12 15:24:58 +08:00
2026-06-01 15:50:39 +08:00
2026-06-02 22:43:22 +08:00
2026-06-13 22:40:48 +08:00
2026-05-22 21:42:14 +08:00
2026-06-12 15:24:58 +08:00
2026-06-10 23:26:15 +08:00
2026-03-14 22:55:52 +08:00
2026-05-21 16:49:31 +08:00
2026-06-12 22:48:47 +08:00
2026-05-10 22:00:57 +08:00
2026-05-13 23:52:19 +08:00
2026-03-26 14:20:18 +08:00
2026-05-10 23:09:03 +08:00
2026-05-19 22:11:46 +08:00
2026-06-08 23:17:22 +08:00
2026-06-07 22:49:55 +08:00
2026-06-08 12:24:48 +08:00
2026-04-06 15:09:57 +08:00
2026-06-08 23:17:22 +08:00
2026-05-21 16:49:31 +08:00
2026-05-21 16:49:31 +08:00
2026-05-21 16:49:31 +08:00
2026-05-12 23:18:54 +08:00
2026-06-04 07:10:59 +08:00
2026-05-09 18:21:54 +08:00
2026-06-09 23:07:17 +08:00
2026-06-06 15:12:17 +08:00
2026-04-26 15:09:25 +08:00
2026-05-02 15:16:16 +08:00
2026-06-09 15:29:40 +08:00
2026-06-08 22:04:38 +08:00
2026-04-28 11:13:17 +08:00
2026-04-06 15:18:34 +08:00
2026-05-28 07:22:39 +08:00
2026-04-10 20:49:28 +08:00
2026-05-21 16:49:31 +08:00
2026-06-07 17:47:11 +08:00