zylon-ai/private-gpt · error · RuntimeError

OPENAPI_SPEC_URL assignment not found in {OPENAPI_TEST_FILE}

Error message

OPENAPI_SPEC_URL assignment not found in {OPENAPI_TEST_FILE}

What it means

Error "OPENAPI_SPEC_URL assignment not found in {OPENAPI_TEST_FILE}" thrown in zylon-ai/private-gpt.

Source

Thrown at scripts/update_claude_specs.py:57

    return spec_url


def current_anthropic_version() -> str:
    source = PYPROJECT_FILE.read_text(encoding="utf-8")
    match = re.search(r'"anthropic>=([\d.]+)"', source)
    return match.group(1) if match else "<not found>"


def update_openapi_spec_url(new_url: str) -> None:
    source = OPENAPI_TEST_FILE.read_text(encoding="utf-8")
    updated, count = re.subn(
        r'^(OPENAPI_SPEC_URL\s*=\s*")[^"]*(")',
        rf"\g<1>{new_url}\g<2>",
        source,
        flags=re.MULTILINE,
    )
    if count == 0:
        raise RuntimeError(
            f"OPENAPI_SPEC_URL assignment not found in {OPENAPI_TEST_FILE}"
        )
    OPENAPI_TEST_FILE.write_text(updated, encoding="utf-8")


def update_anthropic_version(new_version: str) -> None:
    source = PYPROJECT_FILE.read_text(encoding="utf-8")
    updated, count = re.subn(
        r'"anthropic>=[\d.]+"',
        f'"anthropic>={new_version}"',
        source,
    )
    if count == 0:
        raise RuntimeError(f"anthropic dependency not found in {PYPROJECT_FILE}")
    PYPROJECT_FILE.write_text(updated, encoding="utf-8")


def sync_lock_file() -> None:

View on GitHub (pinned to 4a030776a3)

Solutions

  1. Ensure the test file contains an assignment of the form OPENAPI_SPEC_URL = '...' for the script to update.
  2. Check that OPENAPI_TEST_FILE points to the correct test file path.
  3. Add the OPENAPI_SPEC_URL assignment to the test file manually if it was removed or renamed.

When it happens

Trigger: Raised by update_claude_specs.py when the OPENAPI_SPEC_URL assignment cannot be located in the OpenAPI test file.

Common situations: The test file's constant was renamed or reformatted; update the script's search pattern or restore the assignment in the test file.


AI-assisted analysis of zylon-ai/private-gpt@4a030776a3 (2026-08-15). Data as JSON: /api/errors/289610a68ed5271e. Report an issue: GitHub.