SaylorTwift HF Staff commited on
Commit
e5f301b
·
verified ·
1 Parent(s): 81a1081

Patch opencode seam: session id as x-api-key too (Jobs proxy strips Authorization)

Browse files
Files changed (1) hide show
  1. run_job.sh +16 -0
run_job.sh CHANGED
@@ -51,6 +51,22 @@ from trl.experimental.async_grpo.openenv_harness import HarnessRolloutWorker #
51
  print("trl", trl.__version__, "| openenv", openenv.__version__)
52
  EOF
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  echo "=== [start] vLLM policy server (GPU 1) ==="
55
  CUDA_VISIBLE_DEVICES=1 VLLM_SERVER_DEV_MODE=1 \
56
  vllm serve "${MODEL:-LiquidAI/LFM2.5-2.6B}" \
 
51
  print("trl", trl.__version__, "| openenv", openenv.__version__)
52
  EOF
53
 
54
+ echo "=== [patch] opencode seam: also send the capture session as x-api-key ==="
55
+ # The HF Jobs proxy strips Authorization. The capture proxy (sessions.py) also
56
+ # accepts x-api-key / x-goog-api-key, and OpenCode's @ai-sdk/openai-compatible
57
+ # provider supports a custom headers option — so send the session id both ways.
58
+ python3 - <<'EOF'
59
+ import openenv.harbor.seams as seams
60
+
61
+ path = seams.__file__
62
+ src = open(path).read()
63
+ old = '"apiKey": session,'
64
+ new = '"apiKey": session,\n "headers": {"x-api-key": session},'
65
+ assert src.count(old) == 1, f"expected exactly one apiKey seam in {path}"
66
+ open(path, "w").write(src.replace(old, new))
67
+ print("patched", path)
68
+ EOF
69
+
70
  echo "=== [start] vLLM policy server (GPU 1) ==="
71
  CUDA_VISIBLE_DEVICES=1 VLLM_SERVER_DEV_MODE=1 \
72
  vllm serve "${MODEL:-LiquidAI/LFM2.5-2.6B}" \