exec

package
v1.801.108 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package execsvc exposes the Code Interpreter ("Run Code") surface on the unified cloud-api /v1 plane, per HIP-0106.

hanzo.chat (LibreChat fork) drives its execute_code agent tool against a code-interpreter API whose contract is fixed by the upstream client (@librechat/agents CodeExecutor): it POSTs {lang, code, files?} to `${LIBRECHAT_CODE_BASEURL}/exec` with header `X-API-Key`, and uses the sibling paths /exec/programmatic, /upload, /download/{id}, /files/{sid}. The response is {session_id, stdout, stderr, files:[{name}]}. cloud-api is the single edge that owns api.hanzo.ai/v1, so this subsystem mounts those paths and forwards each request UNCHANGED to a sandboxed executor upstream. No code runs here — this is a reverse proxy identical in shape to clients/o11y, so there is zero request/response drift from the contract.

SANDBOX: the upstream MUST be an isolated executor (Hanzo Runtime / a per-call container sandbox). This binary NEVER shells out; there is no os/exec anywhere in this package. Point CODE_EXEC_UPSTREAM at the sandbox service's in-cluster DNS. The executor is the isolation boundary; cloud only adds auth + the unified surface.

AUTH: the gateway (order 80) bypasses these paths (the credential is an opaque service key on X-API-Key, not a JWT), so this subsystem enforces the key itself with a constant-time compare against CODE_EXEC_API_KEY (KMS-sourced, synced into the pod env). Endpoints are never open: an unset key fails closed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount(app *zip.App, deps cloud.Deps) error

Mount registers the code-interpreter surface on app. The gateway terminates user auth for the chat UI, but code exec is called server-side by the chat node process with the shared service key, so we enforce that key here.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL