xtekky/gpt4free · critical

no runtime in manifest for platform %q

Error message

no runtime in manifest for platform %q

What it means

runtimeSpecForHost in g4f-go/download.go builds a platform key from runtime.GOOS and arch (with darwin-arm64/darwin-x64 special-casing) and looks it up in the manifest's Platforms map. If no entry matches, it errors with 'no runtime in manifest for platform %q' — the shipped runtime.json simply has no build for your OS/architecture.

Source

Thrown at g4f-go/download.go:66

		}
		return "linux-x64"
	case "windows":
		return "windows-amd64"
	case "darwin":
		if arch == "arm64" {
			return "darwin-arm64"
		}
		return "darwin-x64"
	}
	return runtime.GOOS + "-" + arch
}

// runtimeSpecForHost picks the manifest entry for this OS/arch.
func runtimeSpecForHost(m *RuntimeManifest) (*RuntimeSpec, error) {
	key := runtimeManifestKey()
	spec, ok := m.Platforms[key]
	if !ok {
		return nil, fmt.Errorf("no runtime in manifest for platform %q", key)
	}
	return &spec, nil
}

// partName is the temp file used while a download is in flight.
func partName(binDir string) string {
	return filepath.Join(binDir, ".g4f-runtime", "runtime.download")
}

// installedOkName marks a fully verified runtime extraction.
func installedOkName(binDir string) string {
	return filepath.Join(binDir, ".g4f-runtime", ".runtime-ok")
}

// downloadRuntime fetches the manifest URL for this host into cachePath
// (verifying size + sha256 when pinned) and reports live progress to stderr.
func downloadRuntime(binDir, cachePath string, spec *RuntimeSpec) error {
	if err := os.MkdirAll(filepath.Dir(partName(binDir)), 0o755); err != nil {

View on GitHub (pinned to 973504e177)

Solutions

  1. Print your key (GOOS + '-' + GOARCH) and check it exists under 'platforms' in runtime.json
  2. Update the g4f-go binary/runtime.json to a release that ships your platform
  3. If your platform is genuinely unsupported, install the Python runtime manually and point the tool at it, or build from source
  4. On Apple Silicon, confirm the manifest uses the special key 'darwin-arm64' rather than 'darwin-arm64' variants like 'darwin-aarch64'

Example fix

// before
spec, err := runtimeSpecForHost(m)  // no runtime in manifest for platform "linux-riscv64"

// after
// pre-check and give a clearer message
key := runtimeManifestKey()
if _, ok := m.Platforms[key]; !ok {
    log.Fatalf("unsupported platform %s; supported: %v", key, platformKeys(m))
}
Defensive patterns

Strategy: validation

Validate before calling

key := runtimeManifestKey()
if _, ok := m.Platforms[key]; !ok {
    // fail early with supported-platform list before attempting install
    log.Fatalf("unsupported platform %s; supported: %v", key, platformKeys(m))
}

Type guard

func platformSupported(m *RuntimeManifest, key string) bool {
    _, ok := m.Platforms[key]
    return ok
}

Try / catch

spec, err := runtimeSpecForHost(m)
if err != nil {
    if strings.Contains(err.Error(), "no runtime in manifest") {
        // surface supported platforms or fall back to a system Python
    }
    return err
}

Prevention

When it happens

Trigger: Running the g4f-go launcher on a platform absent from runtime.json's Platforms map — e.g. linux-riscv64, windows-arm64, freebsd-amd64 — or with a stale/trimmed runtime.json embedded with the binary.

Common situations: Running on uncommon architectures (ARM Windows, RISC-V, BSD); using a very old binary whose manifest predates darwin-arm64; a hand-edited or corrupted embedded runtime.json.

Related errors


AI-assisted analysis of xtekky/gpt4free@973504e177 (2026-08-14). Data as JSON: /api/errors/2d693594c411a411. Report an issue: GitHub.