Hyeonsang Cho 74f3f53c66
fix(threads): reject an assistant_id that names no agent at thread creation (#7445)
* fix(threads): reject an assistant_id that names no agent at thread creation

POST /api/threads stored assistant_id unchecked. Every state read then built
a run config from it, and build_run_config's ValueError answered 500 on GET
thread, state and history until the thread was deleted.

Validate it at creation with the rule run creation already applies, now
shared as custom_agent_name(), and answer 422. Records written before this
change are read with the lead agent's schema instead of failing.

* docs(changelog): reference #7445 for the thread-creation assistant_id fix

* fix(threads): clear invalid legacy assistant ids in branches

* docs(changelog): note the branch assistant_id behavior for #7445

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-10-25 13:21:47 +08:00
..