Skip to content

Commit 643306f

Browse files
updated the logging and resolved the HR scenario issue
1 parent f2eb8e3 commit 643306f

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

src/backend/app.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33

44
from contextlib import asynccontextmanager
55

6+
from common.config.app_config import config
7+
8+
# Configure logging levels FIRST, before any logging calls
9+
logging.basicConfig(level=getattr(logging, config.AZURE_BASIC_LOGGING_LEVEL.upper(), logging.INFO))
10+
611

712
from azure.monitor.opentelemetry import configure_azure_monitor
8-
from common.config.app_config import config
13+
#from common.config.app_config import config
914
from common.models.messages_af import UserLanguage
1015

1116
# FastAPI imports
@@ -61,7 +66,7 @@ async def lifespan(app: FastAPI):
6166
)
6267

6368
# Configure logging levels from environment variables
64-
logging.basicConfig(level=getattr(logging, config.AZURE_BASIC_LOGGING_LEVEL.upper(), logging.INFO))
69+
#logging.basicConfig(level=getattr(logging, config.AZURE_BASIC_LOGGING_LEVEL.upper(), logging.INFO))
6570

6671
# Configure Azure package logging levels
6772
azure_level = getattr(logging, config.AZURE_PACKAGE_LOGGING_LEVEL.upper(), logging.WARNING)
@@ -73,6 +78,8 @@ async def lifespan(app: FastAPI):
7378

7479
logging.getLogger("opentelemetry.sdk").setLevel(logging.ERROR)
7580

81+
logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(logging.WARNING)
82+
7683
# Initialize the FastAPI app
7784
app = FastAPI(lifespan=lifespan)
7885

src/backend/v4/magentic_agents/foundry_agent.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ async def _create_azure_search_enabled_client(self, chatClient=None) -> Optional
227227
project_endpoint=self.project_endpoint,
228228
agent_name=azure_agent.name,
229229
agent_version=azure_agent.version, # Use the specific version we just created
230+
model_deployment_name=self.model_deployment_name,
230231
credential=self.creds,
231232
)
232233
return chat_client
@@ -282,6 +283,7 @@ async def _after_open(self) -> None:
282283
tool_choice="required", # Force usage
283284
temperature=temp,
284285
model_id=self.model_deployment_name,
286+
default_options={"store": False}, # Client-managed conversation to avoid stale tool call IDs across rounds
285287
)
286288
else:
287289
# use MCP path
@@ -297,6 +299,7 @@ async def _after_open(self) -> None:
297299
tool_choice="auto" if tools else "none",
298300
temperature=temp,
299301
model_id=self.model_deployment_name,
302+
default_options={"store": False}, # Client-managed conversation to avoid stale tool call IDs across rounds
300303
)
301304
self.logger.info("Initialized ChatAgent '%s'", self.agent_name)
302305

src/backend/v4/orchestration/orchestration_manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ async def init_orchestration(
146146
name="MagenticManager",
147147
description="Orchestrator that coordinates the team to complete complex tasks efficiently.",
148148
instructions="You coordinate a team to complete complex tasks efficiently.",
149+
default_options={"store": False}, # Client-managed conversation to avoid stale tool call IDs across rounds
149150
)
150151

151152
cls.logger.info(

0 commit comments

Comments
 (0)