abhigyanpatwari/GitNexus · error · SandboxError
pinned GitNexus runtime has an unexpected gitnexus-shared de
Error message
pinned GitNexus runtime has an unexpected gitnexus-shared dependency
What it means
The harness expects gitnexus/node_modules/gitnexus-shared to be a symlink that resolves exactly to the sibling gitnexus-shared/ directory (a workspace-style link). If it is missing, a regular directory, or a symlink to anywhere else, the runtime's dependency wiring is untrusted and the run aborts.
Source
Thrown at eval/workflow_bench/runtime_mounts.py:244
)
entrypoint = mounts[0].source / "cli" / "index.js"
try:
entrypoint_mode = entrypoint.lstat().st_mode
package = json.loads(mounts[1].source.read_text())
except (OSError, json.JSONDecodeError) as exc:
raise SandboxError(f"pinned GitNexus runtime metadata is invalid: {exc}") from exc
if stat.S_ISLNK(entrypoint_mode) or not stat.S_ISREG(entrypoint_mode):
raise SandboxError(f"pinned GitNexus runtime entrypoint must be regular and non-symlink: {entrypoint}")
if package.get("version") != PINNED_GITNEXUS_VERSION:
raise SandboxError(
"pinned GitNexus runtime version drifted: "
f"expected {PINNED_GITNEXUS_VERSION}, got {package.get('version')!r}"
)
linked_shared = mounts[2].source / "gitnexus-shared"
if not linked_shared.is_symlink() or linked_shared.resolve(strict=True) != shared:
raise SandboxError("pinned GitNexus runtime has an unexpected gitnexus-shared dependency")
try:
shared_package = json.loads(mounts[5].source.read_text())
except (OSError, json.JSONDecodeError) as exc:
raise SandboxError(f"pinned GitNexus shared runtime metadata is invalid: {exc}") from exc
if shared_package.get("name") != "gitnexus-shared":
raise SandboxError("pinned GitNexus shared runtime has an unexpected package identity")
return mounts
def validate_ce_plugin_inputs(
arms: Sequence[str],
plugin_dir: Path | None,
plugin_version: str | None,
) -> CePluginConfig | None:
"""Require an explicit directory and exact version iff a CE arm is selected."""
has_ce_arm = any(arm in CE_ARMS for arm in arms)
supplied = plugin_dir is not None or plugin_version is not NoneView on GitHub (pinned to d540b00184)
Solutions
- Reinstall from the workspace root so npm re-creates the link: `rm -rf gitnexus/node_modules && cd gitnexus && npm install`.
- Verify the link: `ls -l gitnexus/node_modules/gitnexus-shared` should show `-> ../../gitnexus-shared`.
- If the workspace root is not configured, add gitnexus-shared to workspaces in the root package.json before reinstalling.
Defensive patterns
Strategy: validation
Validate before calling
from pathlib import Path
def shared_link_ok(runtime: Path, shared: Path) -> bool:
link = runtime / "node_modules" / "gitnexus-shared"
try:
return link.is_symlink() and link.resolve(strict=True) == shared.resolve(strict=True)
except OSError:
return False Try / catch
try:
mounts = trusted_gitnexus_runtime_mounts()
except SandboxError as exc:
if "unexpected gitnexus-shared dependency" in str(exc):
# reinstall from workspace root to re-create the link
...
raise Prevention
- Always install via `npm install` from the workspace root so the link is created correctly.
- Never `npm install gitnexus-shared` inside gitnexus/ directly.
- After install, verify with `ls -l gitnexus/node_modules/gitnexus-shared`.
When it happens
Trigger: Running `npm install gitnexus-shared` inside gitnexus/ produced a copied install rather than the workspace link; node_modules was partially cleaned; the repo was unpacked without restoring the workspace symlink.
Common situations: Switching between workspace-aware npm invocations and standalone installs; CI caching that drops symlinks; extracting a tarball that materialized the link target as a real directory.
Related errors
- phase artifact escapes the workspace: {allowed_artifact}
- phase changed unauthorized workspace path(s): {preview}{suff
- pinned GitNexus runtime metadata is invalid: {exc}
- pinned GitNexus runtime entrypoint must be regular and non-s
- pinned GitNexus runtime version drifted: expected {PINNED_GI
AI-assisted analysis of abhigyanpatwari/GitNexus@d540b00184 (2026-08-12).
Data as JSON: /api/errors/d4557c0db188e1f3.
Report an issue: GitHub.