fix(smolmachines): fix CA provisioning and git-http startup on Linux
lint / lint (push) Failing after 2m2s
test / unit (pull_request) Failing after 56s
test / integration (pull_request) Successful in 21s
test / coverage (pull_request) Failing after 53s

Two fixes for the Linux smolmachines backend:

- provision_ca: add mkdir -p before cp_in so the
  /usr/local/share/ca-certificates/ directory exists in the smolvm
  guest even when smolvm pack omits it (empty dir on Linux).
- git_http_backend: the fallback import in the except ImportError
  block tried `from git_gate import ...`, but git_gate.py is not
  deployed to the sidecar container and has its own package-relative
  imports; use the literal value 15 directly instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-08 22:01:30 -04:00
parent 8f31741c9f
commit afd943c4f9
+4
View File
@@ -227,6 +227,10 @@ class AgentProvider(ABC):
from .backend.util import AGENT_CA_PATH, log_ca_fingerprint, select_ca_cert
from .log import die
cert_host_path, label = select_ca_cert(plan.egress_plan)
# Ensure the target directory exists. smolvm's pack step may not
# preserve the empty /usr/local/share/ca-certificates/ directory
# on Linux; mkdir -p is idempotent and safe for all backends.
bottle.exec("mkdir -p /usr/local/share/ca-certificates", user="root")
bottle.cp_in(str(cert_host_path), AGENT_CA_PATH)
r = bottle.exec(
f"chmod 644 {AGENT_CA_PATH} && update-ca-certificates",