mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-29 12:59:13 +01:00
ci(runner): retire descriptor launch probe
This commit is contained in:
1 parent
f1b81ef925
commit
8737e5a98a
1 file changed
-57
@@ -347,63 +347,6 @@ jobs:
|
||||
if: matrix.environmentId == 'local' && (matrix.profileId == 'runner-opencode' || startsWith(matrix.profileId, 'runner-acpx-'))
|
||||
run: pnpm --filter @paperclipai/paperclip-runner build:typescript
|
||||
|
||||
- name: Diagnose descriptor-safe ACPX bundle
|
||||
if: matrix.environmentId == 'local' && startsWith(matrix.profileId, 'runner-acpx-')
|
||||
run: |
|
||||
python3 <<'PY'
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
def snapshot(path):
|
||||
descriptor = os.memfd_create("paperclip-verified-launch")
|
||||
with open(path, "rb") as source:
|
||||
while chunk := source.read(64 * 1024):
|
||||
os.write(descriptor, chunk)
|
||||
os.lseek(descriptor, 0, os.SEEK_SET)
|
||||
os.fchmod(descriptor, 0o500)
|
||||
return descriptor
|
||||
|
||||
node_descriptor = snapshot(shutil.which("node"))
|
||||
sidecar_descriptor = snapshot(
|
||||
"packages/paperclip-runner/dist/cli/acpx-runtime-sidecar.cjs"
|
||||
)
|
||||
environment = os.environ.copy()
|
||||
environment["PAPERCLIP_ACPX_PROVIDER_PACKAGE_ROOT"] = os.path.abspath(
|
||||
"packages/paperclip-runner"
|
||||
)
|
||||
request = {
|
||||
"protocolVersion": 2,
|
||||
"id": 1,
|
||||
"command": "initialize",
|
||||
"params": {"agent": "codex", "model": "gpt-5.6-sol"},
|
||||
}
|
||||
loader = r'''const fs=require("node:fs");const Module=require("node:module");const filename=process.argv[1];const source=fs.readFileSync(filename,"utf8").replace(/^#![^\r\n]*(?:\r?\n|$)/,"");const artifact=new Module(filename);artifact.filename=filename;artifact.paths=[];artifact._compile(source,filename);'''
|
||||
result = subprocess.run(
|
||||
[
|
||||
f"/proc/self/fd/{node_descriptor}",
|
||||
"--eval",
|
||||
loader,
|
||||
f"/proc/self/fd/{sidecar_descriptor}",
|
||||
],
|
||||
input=json.dumps(request) + "\n",
|
||||
text=True,
|
||||
capture_output=True,
|
||||
timeout=15,
|
||||
pass_fds=(node_descriptor, sidecar_descriptor),
|
||||
env=environment,
|
||||
)
|
||||
sys.stdout.write(result.stdout)
|
||||
sys.stderr.write(result.stderr)
|
||||
if result.returncode != 0:
|
||||
raise SystemExit(result.returncode)
|
||||
response = json.loads(result.stdout.strip().splitlines()[0])
|
||||
if response.get("ok") is not True:
|
||||
raise SystemExit("descriptor-safe ACPX initialize failed")
|
||||
PY
|
||||
|
||||
- name: Qualify local provider Node interpreter
|
||||
if: matrix.environmentId == 'local' && (matrix.profileId == 'runner-opencode' || startsWith(matrix.profileId, 'runner-acpx-'))
|
||||
run: |
|
||||
|
||||
Reference in new issue
Block a user