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

@ -295,7 +295,12 @@ class WsGatewayTests(unittest.TestCase):
"type": "req",
"id": "cs1",
"method": "chat.send",
"params": {"sessionKey": "sess-chat", "message": "hi", "idempotencyKey": "idem-chat-1"},
"params": {
"sessionKey": "sess-chat",
"message": "hi",
"idempotencyKey": "idem-chat-1",
"execution_mode": "plan",
},
}
)
ack = None
@ -309,6 +314,7 @@ class WsGatewayTests(unittest.TestCase):
assert ack.get("id") == "cs1"
assert ack.get("ok") is True
assert str((ack.get("payload") or {}).get("status") or "") == "started"
assert str((ack.get("payload") or {}).get("executionMode") or "") == "plan"
run_id = str((ack.get("payload") or {}).get("runId") or "")
assert run_id.strip() != ""