Fix seam patch: target _opencode block by unique indent (3 apiKey seams exist)
Browse files- run_job.sh +7 -3
run_job.sh
CHANGED
|
@@ -60,9 +60,13 @@ import openenv.harbor.seams as seams
|
|
| 60 |
|
| 61 |
path = seams.__file__
|
| 62 |
src = open(path).read()
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
open(path, "w").write(src.replace(old, new))
|
| 67 |
print("patched", path)
|
| 68 |
EOF
|
|
|
|
| 60 |
|
| 61 |
path = seams.__file__
|
| 62 |
src = open(path).read()
|
| 63 |
+
# Target only the _opencode seam: its apiKey/timeout pair at 24-space indent is
|
| 64 |
+
# unique (other harnesses share the strings at different indents).
|
| 65 |
+
old = '"apiKey": session,\n "timeout": 600_000,'
|
| 66 |
+
new = ('"apiKey": session,\n'
|
| 67 |
+
' "headers": {"x-api-key": session},\n'
|
| 68 |
+
' "timeout": 600_000,')
|
| 69 |
+
assert src.count(old) == 1, f"opencode seam not found in {path}"
|
| 70 |
open(path, "w").write(src.replace(old, new))
|
| 71 |
print("patched", path)
|
| 72 |
EOF
|