refactor(proxy): split the shared callback option conflict check and sync dashboard API types

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
mrinal 2026-10-02 23:00:31 +00:00
parent aebf9d5398
commit cc6896a1a7
2 changed files with 17 additions and 6 deletions

View file

@ -193,20 +193,30 @@ def cross_entry_family_error(
)
def _conflicting_option_error(var: str, incoming: str, stored_vars_by_entry: Sequence[Mapping[str, str]]) -> str | None:
return next(
(
f"{var} is already set to {stored!r} by another callback entry. "
f"Every entry shares one value: remove that entry or send the same value."
for entry in stored_vars_by_entry
if (stored := entry.get(var)) not in (None, incoming)
),
None,
)
def conflicting_shared_option_error(
callback_vars: Mapping[str, str] | None,
stored_vars_by_entry: Sequence[Mapping[str, str]],
) -> str | None:
if not callback_vars:
return None
incoming_by_var: Final = {var: callback_vars[var] for var in _SHARED_OPTION_VARS if var in callback_vars}
return next(
(
f"{var} is already set to {stored!r} by another callback entry. "
f"Every entry shares one value: remove that entry or send the same value."
for var in _SHARED_OPTION_VARS
if (incoming := callback_vars.get(var)) is not None
for entry in stored_vars_by_entry
if (stored := entry.get(var)) not in (None, incoming)
error
for var, incoming in incoming_by_var.items()
if (error := _conflicting_option_error(var, incoming, stored_vars_by_entry)) is not None
),
None,
)

View file

@ -17402,6 +17402,7 @@ export interface paths {
* - langfuse_host: The host for the Langfuse callback
* - langfuse_environment: The tracing environment for the Langfuse callback (lowercase; falls back to LANGFUSE_TRACING_ENVIRONMENT)
* - langfuse_span_scope: For langfuse_otel, "full" (default) sends the whole request trace, "llm_only" sends only the model-call spans
* - capture_message_content: For the OTel v2 callbacks (langfuse_otel, arize, weave_otel, newrelic), "no_content" strips prompt and response content from this team's exported spans, "span_only" keeps whatever the global capture policy collects. Omitted behaves like "span_only". It only narrows: a team gets content only when the proxy's global OTel v2 capture is enabled
* - gcs_bucket_name: The name of the GCS bucket
* - gcs_path_service_account: The path to the GCS service account
* - langsmith_api_key: The API key for the Langsmith callback