Skip to content

Comments

Add unique index to routine result filenames#197

Merged
dimavrem22 merged 2 commits intomainfrom
routine-result-save-patch
Feb 23, 2026
Merged

Add unique index to routine result filenames#197
dimavrem22 merged 2 commits intomainfrom
routine-result-save-patch

Conversation

@dimavrem22
Copy link
Contributor

Summary

  • Routine results were saved as {timestamp}-routine_result.json with no index, causing silent overwrites when multiple routines executed in the same second (e.g. parallel batches or rapid sequential calls)
  • Added an itertools.count(1) counter on the BlueBoxAgent instance so each saved result gets a globally unique, monotonically increasing index: 26-02-23-234220-routine_result_1.json, 26-02-23-234220-routine_result_2.json, etc.
  • itertools.count is thread-safe in CPython (atomic next()), so no explicit lock is needed for the ThreadPoolExecutor usage
  • Added 5 unit tests covering: single execution, sequential indices, cross-batch continuity, error results, and parallel uniqueness

Routine results were saved as `{timestamp}-routine_result.json` with no
index, causing overwrites when multiple routines executed in the same
second. Added an `itertools.count(1)` counter on the agent instance so
each result gets a globally unique index across all execution batches
(e.g. `26-02-23-234220-routine_result_1.json`).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dimavrem22 dimavrem22 merged commit ef6373c into main Feb 23, 2026
9 checks passed
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.

2 participants