-
Notifications
You must be signed in to change notification settings - Fork 23
fix: evals logs as debug #1401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: evals logs as debug #1401
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -226,7 +226,7 @@ def __init__( | |||||||||||||||||||||
| f"eval_set_run_id={context.eval_set_run_id}" | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
| self.execution_id = context.execution_id | ||||||||||||||||||||||
| logger.info(f"EVAL RUNTIME: execution_id set to: {self.execution_id}") | ||||||||||||||||||||||
| logger.debug(f"EVAL RUNTIME: execution_id set to: {self.execution_id}") | ||||||||||||||||||||||
| self.coverage = coverage.Coverage(branch=True) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| self._storage: UiPathRuntimeStorageProtocol | None = None | ||||||||||||||||||||||
|
|
@@ -304,12 +304,12 @@ async def initiate_evaluation( | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| async def execute(self) -> UiPathRuntimeResult: | ||||||||||||||||||||||
| """Execute the evaluation runtime.""" | ||||||||||||||||||||||
| logger.info("=" * 80) | ||||||||||||||||||||||
| logger.info("EVAL RUNTIME: Starting evaluation execution") | ||||||||||||||||||||||
| logger.info(f"EVAL RUNTIME: Execution ID: {self.execution_id}") | ||||||||||||||||||||||
| logger.info(f"EVAL RUNTIME: Job ID: {self.context.job_id}") | ||||||||||||||||||||||
| logger.info(f"EVAL RUNTIME: Resume mode: {self.context.resume}") | ||||||||||||||||||||||
| logger.info("=" * 80) | ||||||||||||||||||||||
| logger.debug("=" * 80) | ||||||||||||||||||||||
| logger.debug("EVAL RUNTIME: Starting evaluation execution") | ||||||||||||||||||||||
| logger.debug(f"EVAL RUNTIME: Execution ID: {self.execution_id}") | ||||||||||||||||||||||
| logger.debug(f"EVAL RUNTIME: Job ID: {self.context.job_id}") | ||||||||||||||||||||||
| logger.debug(f"EVAL RUNTIME: Resume mode: {self.context.resume}") | ||||||||||||||||||||||
| logger.debug("=" * 80) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| with self._mocker_cache(): | ||||||||||||||||||||||
| tracer = self.trace_manager.tracer_provider.get_tracer(__name__) | ||||||||||||||||||||||
|
|
@@ -396,8 +396,8 @@ async def execute(self) -> UiPathRuntimeResult: | |||||||||||||||||||||
| ) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Collect triggers from all evaluation runs (pass-through from inner runtime) | ||||||||||||||||||||||
| logger.info("=" * 80) | ||||||||||||||||||||||
| logger.info( | ||||||||||||||||||||||
| logger.debug("=" * 80) | ||||||||||||||||||||||
| logger.debug( | ||||||||||||||||||||||
| "EVAL RUNTIME: Collecting triggers from all evaluation runs" | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
| all_triggers = [] | ||||||||||||||||||||||
|
|
@@ -413,16 +413,16 @@ async def execute(self) -> UiPathRuntimeResult: | |||||||||||||||||||||
| all_triggers.extend(runtime_result.triggers) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| if all_triggers: | ||||||||||||||||||||||
| logger.info( | ||||||||||||||||||||||
| logger.debug( | ||||||||||||||||||||||
| f"EVAL RUNTIME: ✅ Passing through {len(all_triggers)} trigger(s) to top-level result" | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
| for i, trigger in enumerate(all_triggers, 1): | ||||||||||||||||||||||
| logger.info( | ||||||||||||||||||||||
| logger.debug( | ||||||||||||||||||||||
| f"EVAL RUNTIME: Pass-through trigger {i}: {trigger.model_dump(by_alias=True)}" | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
| else: | ||||||||||||||||||||||
| logger.info("EVAL RUNTIME: No triggers to pass through") | ||||||||||||||||||||||
| logger.info("=" * 80) | ||||||||||||||||||||||
| logger.debug("EVAL RUNTIME: No triggers to pass through") | ||||||||||||||||||||||
| logger.debug("=" * 80) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Determine overall status - propagate status from inner runtime | ||||||||||||||||||||||
| # This is critical for serverless executor to know to save state and suspend job | ||||||||||||||||||||||
|
|
@@ -438,7 +438,7 @@ async def execute(self) -> UiPathRuntimeResult: | |||||||||||||||||||||
| ) | ||||||||||||||||||||||
| if inner_status == UiPathRuntimeStatus.SUSPENDED: | ||||||||||||||||||||||
| overall_status = UiPathRuntimeStatus.SUSPENDED | ||||||||||||||||||||||
| logger.info( | ||||||||||||||||||||||
| logger.debug( | ||||||||||||||||||||||
| "EVAL RUNTIME: Propagating SUSPENDED status from inner runtime" | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
| break # SUSPENDED takes highest priority, stop checking | ||||||||||||||||||||||
|
|
@@ -534,10 +534,10 @@ async def _execute_eval( | |||||||||||||||||||||
| eval_set_run_id=self.context.eval_set_run_id, | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| logger.info( | ||||||||||||||||||||||
| logger.debug( | ||||||||||||||||||||||
| f"DEBUG: Agent execution result status: {agent_execution_output.result.status}" | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
| logger.info( | ||||||||||||||||||||||
| logger.debug( | ||||||||||||||||||||||
| f"DEBUG: Agent execution result trigger: {agent_execution_output.result.trigger}" | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
|
Comment on lines
+537
to
542
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
@@ -583,11 +583,11 @@ async def _execute_eval( | |||||||||||||||||||||
| ): | ||||||||||||||||||||||
| # For suspended executions, we don't run evaluators yet | ||||||||||||||||||||||
| # The serverless executor should save the triggers and resume later | ||||||||||||||||||||||
| logger.info("=" * 80) | ||||||||||||||||||||||
| logger.info( | ||||||||||||||||||||||
| logger.debug("=" * 80) | ||||||||||||||||||||||
| logger.debug( | ||||||||||||||||||||||
| f"🔴 EVAL RUNTIME: DETECTED SUSPENSION for eval '{eval_item.name}' (id: {eval_item.id})" | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
| logger.info("EVAL RUNTIME: Agent returned SUSPENDED status") | ||||||||||||||||||||||
| logger.debug("EVAL RUNTIME: Agent returned SUSPENDED status") | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Extract triggers from result | ||||||||||||||||||||||
| triggers = [] | ||||||||||||||||||||||
|
|
@@ -596,15 +596,15 @@ async def _execute_eval( | |||||||||||||||||||||
| if agent_execution_output.result.triggers: | ||||||||||||||||||||||
| triggers.extend(agent_execution_output.result.triggers) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| logger.info( | ||||||||||||||||||||||
| logger.debug( | ||||||||||||||||||||||
| f"EVAL RUNTIME: Extracted {len(triggers)} trigger(s) from suspended execution" | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
| for i, trigger in enumerate(triggers, 1): | ||||||||||||||||||||||
| logger.info( | ||||||||||||||||||||||
| logger.debug( | ||||||||||||||||||||||
| f"EVAL RUNTIME: Trigger {i}: {trigger.model_dump(by_alias=True)}" | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
|
Comment on lines
+603
to
605
|
||||||||||||||||||||||
| logger.debug( | |
| f"EVAL RUNTIME: Trigger {i}: {trigger.model_dump(by_alias=True)}" | |
| ) | |
| if logger.isEnabledFor(logging.DEBUG): | |
| trigger_dump = trigger.model_dump(by_alias=True) | |
| logger.debug( | |
| "EVAL RUNTIME: Trigger %s: %s", | |
| i, | |
| trigger_dump, | |
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These debug logs call
trigger.model_dump(by_alias=True)inside an f-string. Even when debug logging is disabled, the f-string (andmodel_dump) will still be evaluated, which can add noticeable overhead if there are many triggers. Consider guarding this block withlogger.isEnabledFor(logging.DEBUG)(or similar) so themodel_dumponly happens when debug logs will actually be emitted.