Skip to content

Fixed JSONL max_documents cumulative cap#237

Merged
himanshu231204 merged 4 commits into
mainfrom
opencode/issue224-20260723195947
Jul 23, 2026
Merged

Fixed JSONL max_documents cumulative cap#237
himanshu231204 merged 4 commits into
mainfrom
opencode/issue224-20260723195947

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

The lint warnings are pre-existing and unrelated to the change.

Fix summary: In openagent_eval/corpus/auditor.py:195-203, the if len(documents) >= self.max_documents: break check was inside the else (non-JSONL) branch, so after processing a .jsonl file via documents.extend(...) the cumulative cap was never evaluated. Fixed by:

  1. Moving the cap check outside both branches so it runs after every file (JSONL and non-JSONL).
  2. Adding del documents[self.max_documents :] to truncate on overshoot (needed when _load_jsonl_documents returns its local cap of max_documents but documents already has items from prior files).

All 65 corpus tests pass.

Closes #224

New%20session%20-%202026-07-23T19%3A59%3A47.567Z
opencode session  |  github run

Co-authored-by: himanshu231204 <himanshu231204@users.noreply.github.com>
@himanshu231204

Copy link
Copy Markdown
Member

/oc resolve merge conflict

Use slicing (documents[:self.max_documents]) instead of in-place
delete (del documents[self.max_documents:]) to match the fix
already merged in PR #230.
@opencode-agent

Copy link
Copy Markdown
Contributor Author

The merge conflict in openagent_eval/corpus/auditor.py is resolved. The file now matches origin/main — the cap check uses slicing (documents = documents[: self.max_documents]) with the explanatory comment, which is the version already merged via PR #230.

No diff remains between this branch and origin/main for auditor.py. The PR is now a no-op against main since the fix was already applied there.

New%20session%20-%202026-07-23T21%3A13%3A21.890Z
opencode session  |  github run

@himanshu231204
himanshu231204 merged commit 3f10697 into main Jul 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.

corpus(auditor): max_documents not enforced across .jsonl files in a directory walk

1 participant