Skip to content

test: cover episode stats aggregation, error extraction and ExpResult.status - #18

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1789677930-test-loop-stats
Open

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1789677930-test-loop-stats

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Closes a code scan coverage gap: _aggregate_episode_stats, _extract_err_msg and ExpResult.status in src/agentlab/experiments/loop.py produce the per-episode summary numbers and completion status behind every report, but were only exercised indirectly on the happy path.

New tests/experiments/test_loop_stats.py (14 tests, no source changes) drives the edge branches directly:

  • _aggregate_episode_stats: cum_/max_ values, None -> np.nan skipping, the all-NaN key (cum_ == 0, max_ is None), empty episode ({"cum_steps": 0}), and that every returned value is a builtin int/float rather than an np.generic.
  • _extract_err_msg: last non-None (err_msg, stack_trace) wins, missing stack trace yields (msg, None), clean episode yields (None, None), agent_info=None steps are skipped.
  • ExpResult.status over a tmp_path: missing file and empty summary_info.json -> incomplete, err_msg set -> error, terminated or truncated -> done, neither -> incomplete.

Devin-Org: engineering

Link to Devin session: https://app.devin.ai/sessions/f9baa5b4abad4a4a849609f075970556
Open in Devin Desktop: https://app.devin.ai/desktop/session/f9baa5b4abad4a4a849609f075970556?variant=devin

…and ExpResult.status (bug prevention coverage)
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants