Strict Tenant ID Enforcement (#3871)

* strict tenant id enforcement

* k

* k

* nit

* merge

* nit

* k
This commit is contained in:
pablonyx
2025-02-18 16:52:56 -08:00
committed by GitHub
parent 2013beb9e0
commit 47fd4fa233
68 changed files with 390 additions and 357 deletions

View File

@@ -143,7 +143,7 @@ from onyx.utils.long_term_log import LongTermLogger
from onyx.utils.telemetry import mt_cloud_telemetry
from onyx.utils.timing import log_function_time
from onyx.utils.timing import log_generator_function_time
from shared_configs.contextvars import CURRENT_TENANT_ID_CONTEXTVAR
from shared_configs.contextvars import get_current_tenant_id
logger = setup_logger()
ERROR_TYPE_CANCELLED = "cancelled"
@@ -343,7 +343,7 @@ def stream_chat_message_objects(
3. [always] A set of streamed LLM tokens or an error anywhere along the line if something fails
4. [always] Details on the final AI response message that is created
"""
tenant_id = CURRENT_TENANT_ID_CONTEXTVAR.get()
tenant_id = get_current_tenant_id()
use_existing_user_message = new_msg_req.use_existing_user_message
existing_assistant_message_id = new_msg_req.existing_assistant_message_id