@plainconceptsplatform/workflows 1.21.2 → 1.21.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1934,9 +1934,12 @@ fi
|
|
|
1934
1934
|
if worker_installed implement && ! grep -qF 'subagent_type: planner-sub' "$IMPLEMENT_WORKER_MD"; then
|
|
1935
1935
|
LEAD_OK=0; echo "FAIL: the implement prompt must run propose and archive in the planner-sub agent" >&2
|
|
1936
1936
|
fi
|
|
1937
|
-
# agent-harness before 3.
|
|
1937
|
+
# agent-harness before 3.12.1 writes `resource: *`, a YAML alias that does not parse: opencode drops the agent's
|
|
1938
1938
|
# mode and refuses to spawn planner and planner-sub ("cannot run as a subagent"). The CI setup repairs the
|
|
1939
1939
|
# generated files before opencode reads them, and the implement prompt stops at the first spawn error.
|
|
1940
|
+
if ! grep -qF 'resource: ${JSON.stringify(p.resource)}' "${WORKFLOWS_DIR}/shared/opencode-ci.md"; then
|
|
1941
|
+
LEAD_OK=0; echo "FAIL: the CI setup must quote the permission resource in the harness generator, which rewrites the agents at startup" >&2
|
|
1942
|
+
fi
|
|
1940
1943
|
if ! grep -qF 'resource: "*"' "${WORKFLOWS_DIR}/shared/opencode-ci.md"; then
|
|
1941
1944
|
LEAD_OK=0; echo "FAIL: the CI setup must quote the generated agents' permission resource (a bare * is a YAML alias)" >&2
|
|
1942
1945
|
fi
|
|
@@ -251,10 +251,21 @@ pre-agent-steps:
|
|
|
251
251
|
# variants visible from the first turn; the doctor is the audit line.
|
|
252
252
|
run: |
|
|
253
253
|
set -euo pipefail
|
|
254
|
-
|
|
254
|
+
# agent-harness before 3.12.1 generates `resource: *` (see below). Quoting the generated files alone is not
|
|
255
|
+
# enough: the plugin rewrites them when opencode starts, so the generator itself is patched first. A no-op
|
|
256
|
+
# once the harness quotes the value.
|
|
257
|
+
tiers_core=.opencode/plugins/pc-subagent-tiers-core.js
|
|
258
|
+
if [ -f "$tiers_core" ]; then
|
|
259
|
+
sed -i 's/resource: ${p\.resource}`/resource: ${JSON.stringify(p.resource)}`/' "$tiers_core"
|
|
260
|
+
if grep -qF 'resource: ${p.resource}`' "$tiers_core"; then
|
|
261
|
+
echo "::error::Could not quote the permission resource in $tiers_core; opencode would refuse to spawn planner-sub." >&2
|
|
262
|
+
exit 1
|
|
263
|
+
fi
|
|
264
|
+
fi
|
|
265
|
+
if [ -f .opencode/scripts/sync-agents.mjs ] && [ -f "$tiers_core" ]; then
|
|
255
266
|
node .opencode/scripts/sync-agents.mjs --strict
|
|
256
267
|
fi
|
|
257
|
-
# agent-harness before 3.
|
|
268
|
+
# agent-harness before 3.12.1 writes `resource: *` into plan.md, planner.md and planner-sub.md. A bare `*` is
|
|
258
269
|
# a YAML alias, so the frontmatter does not parse, opencode drops the agents' `mode`, treats them as primary
|
|
259
270
|
# and refuses to spawn them ("Agent planner-sub cannot run as a subagent"). These files are generated here on
|
|
260
271
|
# every run and never committed, so quote the value before opencode reads them; a no-op once the harness does.
|