BigPizzaV3/CodexPlusPlus · error

Unsupported native surface selection

Error message

Unsupported native surface selection

What it means

Codex++ only supports patching the native browser runtime when the cua_repl server enables exactly the "browser" surface (CUA_REPL_ENABLED_SURFACES=browser). Any other surface selection (e.g. multiple surfaces or an unsupported one) means the patched service file would be used in an untested configuration, so the descriptor is rejected during discovery.

Solutions

  1. Set CUA_REPL_ENABLED_SURFACES to exactly "browser" in the descriptor's env
  2. Reinstall the plugin so the default env (CUA_REPL_ENABLED_SURFACES=browser) is restored
  3. If other surfaces are needed, run them from a separate descriptor not managed by Codex++ discovery

Example fix

// before
"CUA_REPL_ENABLED_SURFACES": "browser,editor"
// after
"CUA_REPL_ENABLED_SURFACES": "browser"
Defensive patterns

Strategy: validation

Validate before calling

if env["CUA_REPL_ENABLED_SURFACES"].as_str() != Some("browser") {
    eprintln!("only the 'browser' surface is supported by Codex++ native browser patching");
}

Type guard

fn browser_surface_only(env: &Value) -> bool {
    env["CUA_REPL_ENABLED_SURFACES"].as_str() == Some("browser")
}

Prevention

When it happens

Trigger: selected_key checks env.CUA_REPL_ENABLED_SURFACES in the .mcp.json descriptor and its value is not exactly the string "browser" — for example "browser,editor", "computer-use", or an empty value.

Common situations: Users enabling extra cua_repl surfaces to access other REPL features; plugin templates that list multiple surfaces; partial manual edits of the descriptor env block.

Understand the failure class

Background: "is not a valid" / "Invalid ... value" environment variable errors: how libraries validate env vars and what to do when they reject yours — this error's family across 48 libraries.

Related errors


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19). Data as JSON: /api/errors/accac6a89a9d1379. Report an issue: GitHub.

Appendix: source

Thrown at crates/codex-plus-core/src/native_browser.rs:318

    ensure!(
        env["NODE_REPL_NODE_PATH"].as_str().map(Path::new) == Some(node.as_path()),
        "Conflicting native Node selection"
    );
    let worker = root.join(key).join("bin/node_repl.exe");
    ensure!(
        env["CUA_REPL_NODE_REPL_PATH"].as_str().map(Path::new) == Some(worker.as_path()),
        "Conflicting native worker selection"
    );
    let services: Value = serde_json::from_str(
        env["NODE_REPL_TRUSTED_SERVICES"]
            .as_str()
            .context("Missing native service map")?,
    )?;
    ensure!(
        services["browser"] == "@oai/browser-desktop/service",
        "Original browser service is not selected"
    );
    ensure!(
        env["CUA_REPL_ENABLED_SURFACES"].as_str() == Some("browser"),
        "Unsupported native surface selection"
    );
    let args = server["args"]
        .as_array()
        .context("Missing native entry point")?;
    let entry = root
        .join(key)
        .join("bin/node_modules/@oai/cua-repl/bin/cua-repl.mjs");
    ensure!(
        args.len() == 1 && args[0].as_str().map(Path::new) == Some(entry.as_path()),
        "Unsupported native entry point"
    );
    plain_path(&node)?;
    Ok(key.to_owned())
}

fn discover(paths: &BrowserPaths) -> Result<Option<String>> {

View on GitHub (pinned to b1ed92e5e4)