Skip to content

Commit 7c7e93b

Browse files
author
SentienceDEV
committed
fix trace upload issue in exception; ffmpeg fix
1 parent eb95eaf commit 7c7e93b

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

sentience/agent.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,10 @@ def act( # noqa: C901
206206
)
207207

208208
# Track data collected during step execution for step_end emission on failure
209-
_step_snap_with_diff: Optional[Snapshot] = None
210-
_step_pre_url: Optional[str] = None
211-
_step_llm_response: Optional[LLMResponse] = None
212-
_step_result: Optional[AgentActionResult] = None
209+
_step_snap_with_diff: Snapshot | None = None
210+
_step_pre_url: str | None = None
211+
_step_llm_response: LLMResponse | None = None
212+
_step_result: AgentActionResult | None = None
213213
_step_duration_ms: int = 0
214214

215215
for attempt in range(max_retries + 1):
@@ -564,7 +564,9 @@ def act( # noqa: C901
564564
snapshot_digest = f"sha256:{self._compute_hash(f'{_step_pre_url}{_step_snap_with_diff.timestamp}')}"
565565

566566
# Build pre_elements from snap_with_diff (includes diff_status)
567-
snapshot_event_data = TraceEventBuilder.build_snapshot_event(_step_snap_with_diff)
567+
snapshot_event_data = TraceEventBuilder.build_snapshot_event(
568+
_step_snap_with_diff
569+
)
568570
pre_elements = snapshot_event_data.get("elements", [])
569571

570572
# Build LLM data if available
@@ -847,10 +849,10 @@ async def act( # noqa: C901
847849
)
848850

849851
# Track data collected during step execution for step_end emission on failure
850-
_step_snap_with_diff: Optional[Snapshot] = None
851-
_step_pre_url: Optional[str] = None
852-
_step_llm_response: Optional[LLMResponse] = None
853-
_step_result: Optional[AgentActionResult] = None
852+
_step_snap_with_diff: Snapshot | None = None
853+
_step_pre_url: str | None = None
854+
_step_llm_response: LLMResponse | None = None
855+
_step_result: AgentActionResult | None = None
854856
_step_duration_ms: int = 0
855857

856858
for attempt in range(max_retries + 1):
@@ -1204,7 +1206,9 @@ async def act( # noqa: C901
12041206
snapshot_digest = f"sha256:{self._compute_hash(f'{_step_pre_url}{_step_snap_with_diff.timestamp}')}"
12051207

12061208
# Build pre_elements from snap_with_diff (includes diff_status)
1207-
snapshot_event_data = TraceEventBuilder.build_snapshot_event(_step_snap_with_diff)
1209+
snapshot_event_data = TraceEventBuilder.build_snapshot_event(
1210+
_step_snap_with_diff
1211+
)
12081212
pre_elements = snapshot_event_data.get("elements", [])
12091213

12101214
# Build LLM data if available

sentience/agent_runtime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ def assert_done(
583583
True if task is complete (assertion passed), False otherwise
584584
"""
585585
# Convenience wrapper for assert_ with required=True
586-
ok = self.assert_(predicate, label=label, required=True)
586+
ok = self.assertTrue(predicate, label=label, required=True)
587587
if ok:
588588
self._task_done = True
589589
self._task_done_label = label

sentience/failure_artifacts.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,7 @@ def _generate_clip_from_frames(
239239
if result.returncode != 0:
240240
stderr = result.stderr.decode("utf-8", errors="replace")[:500]
241241
stdout = result.stdout.decode("utf-8", errors="replace")[:200]
242-
logger.warning(
243-
f"ffmpeg failed with return code {result.returncode}: {stderr}"
244-
)
242+
logger.warning(f"ffmpeg failed with return code {result.returncode}: {stderr}")
245243
if stdout:
246244
logger.debug(f"ffmpeg stdout: {stdout}")
247245
# Fallback: use glob input (handles non-uniform filenames)

0 commit comments

Comments
 (0)