Hmbown/CodeWhale · error · RuntimeError

configured Codewhale binary is unavailable or does not repor

Error message

configured Codewhale binary is unavailable or does not report version ${self.config.version}

What it means

When binary_path is configured, setup() executes [binary, '--version'] inside the runtime and requires exit code 0 plus the configured version appearing as a standalone token in the combined output — _has_version uses lookarounds, so '0.9.1' inside 'v0.9.12' does not count. This RuntimeError means the preinstalled facade is missing, not executable, crashed, or reports a release other than config.version.

Source

Thrown at integrations/verifiers-codewhale/codewhale_harness/harness.py:129

                "disabled_tools must use Codewhale catalog identifiers: "
                + ", ".join(repr(tool) for tool in invalid)
            )

    @property
    def binary(self) -> str:
        configured = (self.config.binary_path or "").strip()
        return configured or DEFAULT_BINARY

    async def setup(self, runtime: Runtime) -> None:
        self._validate_config()
        if self.config.binary_path:
            logger.info("codewhale: verifying preinstalled %s", self.binary)
            result = await runtime.run([self.binary, "--version"], {})
            version_text = f"{result.stdout}\n{result.stderr}"
            if result.exit_code != 0 or not _has_version(
                version_text, self.config.version
            ):
                raise RuntimeError(
                    "configured Codewhale binary is unavailable or does not report "
                    f"version {self.config.version}"
                )
            return

        logger.info("codewhale: ensuring Codewhale %s is installed", self.config.version)
        script = _install_script(self.config.version)
        result = await runtime.run(["sh", "-c", script], {})
        if result.exit_code != 0:
            raise RuntimeError(
                "Codewhale install failed: "
                + (result.stderr or result.stdout).strip()[-500:]
            )

    async def launch(
        self,
        ctx: ModelContext,
        trace: Trace,

View on GitHub (pinned to 8880682c63)

Solutions

  1. Run the exact probe yourself: <binary_path> --version, and compare the printed token to config.version
  2. Update config.version to the release the binary actually reports
  3. Point binary_path at the absolute path of the tested executable
  4. Drop binary_path to let setup() download and verify the pinned release instead

Example fix

# before
config = CodewhaleHarnessConfig(version='0.9.1', binary_path='./build/codewhale')  # prints 0.9.0
# after
config = CodewhaleHarnessConfig(version='0.9.0', binary_path='./build/codewhale')
Defensive patterns

Strategy: validation

Validate before calling

import re

def reports_version(output, version):
    return re.search(rf'(?<![0-9A-Za-z.+-]){re.escape(version)}(?![0-9A-Za-z.+-])', output) is not None

probe = await runtime.run([binary_path, '--version'], {})
output = probe.stdout + '\n' + probe.stderr
ok = probe.exit_code == 0 and reports_version(output, config.version)

Try / catch

try:
    await harness.setup(runtime)
except RuntimeError as e:
    if 'unavailable or does not report' in str(e):
        adjust_version_pin_or_binary_path(e)  # re-probe, then fix config
    raise

Prevention

When it happens

Trigger: binary_path points outside the runtime filesystem or to a non-executable; the facade's --version exits non-zero; the installed build reports a different version than the pinned config.version.

Common situations: Local candidate testing where the facade was rebuilt but the config still pins the old release; container images that do not bake the preinstalled path; version drift after bumping config.version without rebuilding the image.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@8880682c63 (2026-08-16). Data as JSON: /api/errors/efe79b510f468c52. Report an issue: GitHub.