Skip to content

Update to version 0.0.4#7

Merged
daniel-gomm merged 9 commits into
mainfrom
dev
Feb 10, 2026
Merged

Update to version 0.0.4#7
daniel-gomm merged 9 commits into
mainfrom
dev

Conversation

@daniel-gomm
Copy link
Copy Markdown
Owner

Update to version 0.0.4

  • Fix a bug where methods were incorrectly invoked in a static manner
  • Add extensive suite of test
  • Add possibility to validate batch-job files before submitting them

Copilot AI review requested due to automatic review settings February 9, 2026 14:20
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR bumps OpenBatch to v0.0.4, fixes incorrect static-style invocation of BatchJobManager.add() inside the collector helpers, and introduces a new batch-file validation feature with accompanying documentation and a large new test suite.

Changes:

  • Add openbatch.validation module with validate_batch_file() / quick_validate() and ValidationResult.
  • Fix collector helpers to use an instance of BatchJobManager instead of calling .add() statically.
  • Add extensive unit/integration tests, plus pytest/coverage configuration and CI workflow updates.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/openbatch/validation.py Adds batch JSONL validation logic and result formatting.
src/openbatch/collector.py Fixes request writing to use a BatchJobManager instance.
src/openbatch/__init__.py Exposes validate_batch_file from the top-level package.
tests/test_validation.py Comprehensive validation behavior tests.
tests/test_manager.py Tests BatchJobManager request writing and templating workflows.
tests/test_collector.py Tests collector convenience API behavior.
tests/test_integration.py End-to-end tests for batch generation workflows and structured output.
tests/test_utils.py Tests for schema/utility helpers used by structured output features.
tests/test_model.py Tests for request/config models and API strategies.
pyproject.toml Version bump + pytest/coverage config + optional test dependencies.
.github/workflows/test.yml Adds CI test matrix and coverage upload.
docs/validation.md / mkdocs.yml / README.md Documents new validation functionality and improves README metadata/badges.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/openbatch/validation.py
Comment on lines +172 to +176
# Update statistics
result.stats["total_requests"] = line_number
result.stats["unique_custom_ids"] = len(custom_ids)
result.stats["endpoints_used"] = list(endpoints)

Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

total_requests (and the max-request limit check) currently uses line_number, which counts empty lines and invalid JSON lines even though empty lines are explicitly "ignored". Track a separate request counter (e.g., non-empty lines and/or successfully parsed request objects) and use that for total_requests and the request-count limit enforcement.

Copilot uses AI. Check for mistakes.
Comment on lines +174 to +176
result.stats["unique_custom_ids"] = len(custom_ids)
result.stats["endpoints_used"] = list(endpoints)

Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

endpoints_used is built from a set, so converting it directly to a list makes the ordering nondeterministic. Sorting the endpoints before storing them would make stats output stable and easier to test/compare.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Comment thread tests/test_utils.py
Comment thread pyproject.toml
Comment thread tests/test_integration.py
Comment thread tests/test_model.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 10, 2026

@daniel-gomm I've opened a new pull request, #8, to work on those changes. Once the pull request is ready, I'll request review from you.

* Initial plan

* Sort endpoints to make stats output deterministic

Co-authored-by: daniel-gomm <63717948+daniel-gomm@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: daniel-gomm <63717948+daniel-gomm@users.noreply.github.com>
@daniel-gomm daniel-gomm merged commit 7774879 into main Feb 10, 2026
5 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.

3 participants