feat: plan agent v2, global chat mode, and user-mode v2 flag sync

- Add runtime/plan_agent_v2 package and shims; gateway/direct_loop/WS wiring

- Admin chat: interaction mode and specialist only in user menu; session API stores memory_mode and execution_mode only

- POST /admin/api/chat/user-mode mirrors plan_agent_version to AIA_EXPERT_PLAN_AGENT_V2_ENABLED (v2 to 1, v1 to 0)

- Composer cleanup (hidden mode select, no reasoning toggle in meta bar); tests and _local/system.env.example

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-05-02 18:41:45 +08:00
parent ae44cbcad5
commit 37522f492a
49 changed files with 4146 additions and 238 deletions

View file

@ -84,6 +84,9 @@ def _chat_send_handler(opts: dict[str, Any]) -> None:
run_id = run_id.strip() if isinstance(run_id, str) and run_id.strip() else None
if run_id is None:
run_id = f"chat-{session_key.strip()}"
execution_mode = str(params.get("execution_mode") or "agent").strip().lower() or "agent"
if execution_mode not in {"agent", "plan"}:
execution_mode = "agent"
normalized_transport: dict[str, Any] = {}
if isinstance(params, dict):
channel = params.get("channel")
@ -117,6 +120,7 @@ def _chat_send_handler(opts: dict[str, Any]) -> None:
"runId": run_id,
"sessionKey": session_key.strip(),
"message": message.strip(),
"executionMode": execution_mode,
**normalized_transport,
},
)