dao-ai 0.1.16__py3-none-any.whl → 0.1.18__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
dao_ai/cli.py CHANGED
@@ -64,6 +64,7 @@ def detect_cloud_provider(profile: Optional[str] = None) -> Optional[str]:
64
64
  """
65
65
  try:
66
66
  import os
67
+
67
68
  from databricks.sdk import WorkspaceClient
68
69
 
69
70
  # Check for environment variables that might override profile
@@ -520,14 +521,19 @@ def handle_chat_command(options: Namespace) -> None:
520
521
  )
521
522
  continue
522
523
 
524
+ # Normalize user_id for memory namespace compatibility (replace . with _)
525
+ # This matches the normalization in models.py _convert_to_context
526
+ if configurable.get("user_id"):
527
+ configurable["user_id"] = configurable["user_id"].replace(".", "_")
528
+
523
529
  # Create Context object from configurable dict
524
530
  from dao_ai.state import Context
525
531
 
526
532
  context = Context(**configurable)
527
533
 
528
- # Prepare config with thread_id for checkpointer
529
- # Note: thread_id is needed in config for checkpointer/memory
530
- config = {"configurable": {"thread_id": options.thread_id}}
534
+ # Prepare config with all context fields for checkpointer/memory
535
+ # Note: langmem tools require user_id in config.configurable for namespace resolution
536
+ config = {"configurable": context.model_dump()}
531
537
 
532
538
  # Invoke the graph and handle interrupts (HITL)
533
539
  # Wrap in async function to maintain connection pool throughout
@@ -1208,7 +1214,9 @@ def run_databricks_command(
1208
1214
  f"Using CLI-specified deployment target: {resolved_deployment_target}"
1209
1215
  )
1210
1216
  elif app_config and app_config.app and app_config.app.deployment_target:
1211
- resolved_deployment_target = app_config.app.deployment_target.value
1217
+ # deployment_target is DeploymentTarget enum (str subclass) or string
1218
+ # str() works for both since DeploymentTarget inherits from str
1219
+ resolved_deployment_target = str(app_config.app.deployment_target)
1212
1220
  logger.debug(
1213
1221
  f"Using config file deployment target: {resolved_deployment_target}"
1214
1222
  )