abhigyanpatwari/GitNexus · error · ValueError

task {task['id']} oracle exceeds the total byte limit

Error message

task {task['id']} oracle exceeds the total byte limit

What it means

Raised by capture_task_oracle when the running total of captured oracle file payloads exceeds MAX_ORACLE_TOTAL_BYTES (2 MiB). Even if each individual file passes the 512 KiB per-file limit, the sum across all 1–8 files must stay under 2 MiB so the oracle manifest and digest stay bounded and deterministic.

Source

Thrown at eval/workflow_bench/oracle_assets.py:195

        os.close(descriptor)


def capture_task_oracle(task: dict[str, Any], *, root: Path = ORACLE_ROOT) -> TaskOracleSnapshot:
    """Capture and digest one task's hidden oracle before a model session."""

    validate_oracle_declaration(task)
    oracle_root = _real_oracle_root(root)
    oracle = task["oracle"]
    command = str(oracle["command"])
    snapshots: list[OracleFileSnapshot] = []
    total = 0
    for declaration in oracle["files"]:
        source = _bounded_relative_path(declaration["source"], label="oracle source")
        target = _bounded_relative_path(declaration["target"], label="oracle target").as_posix()
        payload = _read_oracle_file(oracle_root, source)
        total += len(payload)
        if total > MAX_ORACLE_TOTAL_BYTES:
            raise ValueError(f"task {task['id']} oracle exceeds the total byte limit")
        snapshots.append(
            OracleFileSnapshot(
                target=target,
                payload=payload,
                sha256=hashlib.sha256(payload).hexdigest(),
            )
        )
    snapshots.sort(key=lambda item: item.target)
    command_digest = hashlib.sha256(command.encode()).hexdigest()
    manifest_frames = [
        frame
        for item in snapshots
        for frame in (item.target.encode(), item.sha256.encode(), str(len(item.payload)).encode())
    ]
    manifest_digest = _hash_frames(*manifest_frames)
    digest_frames = [command.encode()]
    for item in snapshots:
        digest_frames.extend((item.target.encode(), item.payload))

View on GitHub (pinned to d540b00184)

Solutions

  1. Reduce the combined size of all oracle files to ≤ 2 MiB.
  2. Drop or trim the largest files; compress or downsample fixture data.
  3. Split the task into multiple tasks each with a smaller oracle, if the benchmark semantics allow.
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path
from eval.workflow_bench.oracle_assets import MAX_ORACLE_TOTAL_BYTES

def assert_total_size(root, files) -> None:
    total = sum((root / Path(d['source']).parts).__fspath__ and Path(root).joinpath(*Path(d['source']).parts).stat().st_size for d in files)
    if total > MAX_ORACLE_TOTAL_BYTES:
        raise ValueError(f"oracle total {total} > {MAX_ORACLE_TOTAL_BYTES}")

Type guard

def total_within_limit(root, files) -> bool:
    from pathlib import Path
    from eval.workflow_bench.oracle_assets import MAX_ORACLE_TOTAL_BYTES
    try:
        total = sum(Path(root).joinpath(*Path(d['source']).parts).stat().st_size for d in files)
    except OSError:
        return False
    return total <= MAX_ORACLE_TOTAL_BYTES

Try / catch

try:
    snap = capture_task_oracle(task, root=root)
except ValueError as exc:
    if "exceeds the total byte limit" in str(exc):
        raise SystemExit("Trim combined oracle files to <= 2 MiB") from exc
    raise

Prevention

When it happens

Trigger: A task whose combined oracle file sizes exceed 2,097,152 bytes; e.g. four 600 KiB files individually pass the per-file check but sum past the total cap.

Common situations: Large expected-output fixtures (big JSON, snapshots, binaries); accumulating many near-cap files; growing an oracle over time without re-checking the total.

Related errors


AI-assisted analysis of abhigyanpatwari/GitNexus@d540b00184 (2026-08-12). Data as JSON: /api/errors/c6f2359251ed4c8a. Report an issue: GitHub.