mirror of
https://github.com/msitarzewski/agency-agents.git
synced 2026-11-18 18:03:47 +00:00
fix(qwen): document the 0.25.1 floor and reserve Qwen's launch placeholders (#1143)
Qwen Code through 0.25.0 treats every ${name} in a SubAgent prompt as a value
to fill, and throws "Missing context values for the following keys" when it
has none. Sixteen agents show ${name} in their code examples, so those
releases can't launch them (#1081). 0.25.1 (2026-10-11) leaves any name it
doesn't fill as written, so the agents keep their examples. No escape for
${...} is safe across bash, JavaScript and the other 14 tools anyway.
- Document "Qwen Code 0.25.1 or later" in integrations/qwen/README.md and
in the README's Qwen section.
- Qwen does fill ${task_prompt}, ${hook_context} and
${external_inputs_override}. lint-agents.sh now rejects those three in
agent bodies, so no agent text is replaced at launch. No current agent uses
them, and the whole roster still lints clean.
- test-lint-qwen-placeholders.sh covers the three reserved names and four
look-alikes that must pass. It fails against the previous linter, and CI
runs it whenever the linter changes.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
bd956db032
commit
652b2692f8
@@ -108,3 +108,7 @@ jobs:
|
||||
- name: Reject folded frontmatter fixtures
|
||||
if: steps.rules.outputs.changed == 'true'
|
||||
run: bash scripts/test-folded-frontmatter.sh
|
||||
|
||||
- name: Reject Qwen launch placeholders
|
||||
if: steps.rules.outputs.changed == 'true'
|
||||
run: bash scripts/test-lint-qwen-placeholders.sh
|
||||
|
||||
@@ -1003,6 +1003,8 @@ See [integrations/openclaw/README.md](integrations/openclaw/README.md) for detai
|
||||
|
||||
SubAgents are installed to `.qwen/agents/` in your project root (project-scoped).
|
||||
|
||||
> Requires Qwen Code 0.25.1 or later. Earlier releases can't launch agents whose code examples contain `${…}` placeholders ([#1081](https://github.com/msitarzewski/agency-agents/issues/1081)).
|
||||
|
||||
```bash
|
||||
# Convert and install (run from your project root)
|
||||
cd /your/project
|
||||
|
||||
@@ -5,6 +5,19 @@ Qwen Code uses project-scoped `.md` SubAgent files in `.qwen/agents/`.
|
||||
The generated files come from `scripts/convert.sh --tool qwen`, which writes one
|
||||
SubAgent Markdown file per agency agent into `integrations/qwen/agents/`.
|
||||
|
||||
## Requirements
|
||||
|
||||
Qwen Code **0.25.1 or later**. Earlier releases treat every `${name}` in a
|
||||
SubAgent's prompt as a value to fill and refuse to launch the agent when they
|
||||
have none ("Missing context values for the following keys: …"). Several agents
|
||||
show `${name}` in their code examples, so on those releases they can't be
|
||||
launched. From 0.25.1, Qwen leaves any `${name}` it doesn't fill as written
|
||||
([#1081](https://github.com/msitarzewski/agency-agents/issues/1081)).
|
||||
|
||||
Qwen does fill three names: `${task_prompt}`, `${hook_context}` and
|
||||
`${external_inputs_override}`. `scripts/lint-agents.sh` rejects them in agent
|
||||
bodies, so no agent text is replaced at launch.
|
||||
|
||||
## Generate
|
||||
|
||||
From the repository root:
|
||||
|
||||
@@ -169,6 +169,16 @@ lint_file() {
|
||||
warnings=$((warnings + 1))
|
||||
fi
|
||||
|
||||
# 4b. Qwen Code substitutes ${task_prompt}, ${hook_context} and
|
||||
# ${external_inputs_override} into a SubAgent's prompt at launch. From 0.25.1
|
||||
# it leaves every other ${name} as written (older releases refuse any name
|
||||
# they can't fill, #1081). One of these three in a body would be silently
|
||||
# replaced, so the names are reserved.
|
||||
if grep -qE '\$\{(task_prompt|hook_context|external_inputs_override)\}' <<<"$body"; then
|
||||
echo "ERROR $file: uses a placeholder Qwen Code fills at launch (\${task_prompt}, \${hook_context} or \${external_inputs_override}) — rename it"
|
||||
errors=$((errors + 1))
|
||||
fi
|
||||
|
||||
local soul_headers=0
|
||||
local agents_headers=0
|
||||
local fence_marker="" fence_len=0 fence_indent=0 fence_line=0
|
||||
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
# Qwen Code fills three ${name} placeholders into a SubAgent's prompt at launch
|
||||
# (#1081). The linter must reject those three in an agent body and keep
|
||||
# accepting every other ${name}, which Qwen 0.25.1+ leaves as written.
|
||||
set -euo pipefail
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
scratch="$(mktemp -d)"
|
||||
trap 'rm -rf "$scratch"' EXIT
|
||||
write_agent() {
|
||||
printf '%s\n' '---' 'name: Example Agent' 'description: Checks placeholder handling' 'color: blue' '---' \
|
||||
'## Identity' '## Core Mission' '## Critical Rules' '```bash' "echo \"$1\"" '```' > "$scratch/agent.md"
|
||||
}
|
||||
for key in task_prompt hook_context external_inputs_override; do
|
||||
write_agent "\${$key}"
|
||||
if bash "$SCRIPT_DIR/lint-agents.sh" "$scratch/agent.md" > "$scratch/result.log" 2>&1; then
|
||||
echo "FAIL: linter accepted the Qwen launch placeholder \${$key}" >&2; exit 1
|
||||
fi
|
||||
grep -q 'placeholder Qwen Code fills at launch' "$scratch/result.log"
|
||||
done
|
||||
for text in '${name}' '${BACKUP_DIR}' '${task_prompt_suffix}' '$task_prompt'; do
|
||||
write_agent "$text"
|
||||
bash "$SCRIPT_DIR/lint-agents.sh" "$scratch/agent.md" > "$scratch/result.log" 2>&1 \
|
||||
|| { cat "$scratch/result.log" >&2; echo "FAIL: linter rejected ordinary text $text" >&2; exit 1; }
|
||||
done
|
||||
echo 'PASS: Qwen launch placeholders are rejected while other ${name} placeholders pass'
|
||||
Reference in New Issue
Block a user