/agent-traffic-control:workflow-schema-agents-empty-loop-under-ratelimitfrom agent-traffic-control
A dynamic Workflow (the Workflow tool / multi-agent orchestration) returns FEWER results than it dispatched, and one or more parallel() agents "failed" — because during a transient server-side rate-limit storm the affected agents called StructuredOutput 50-90× each with EMPTY args (0 fields), failed schema validation every time, then died on a terminal API error. Use when: (1) a workflow fan-out comes back with N-of-M results and logs show "API Error: Server is temporarily limiting requests (not your usage limit) · Rate limited"; (2) agent-*.jsonl shows many StructuredOutput tool_use calls whose input has zero keys; (3) heavy code-tracing agents fail to emit a big required schema while a light agent on the same run succeeded. Covers recovering the COMPLETED agents from journal.jsonl (don't re-run them), re-dispatching the failed ones as FREE-TEXT (no schema), and prevention (concise field values, anti-empty-call directive, free-text for heavy-context agents, a watchdog that greps the empty-SO signature).
Trending skills
7-day visitors to each skill page
Ships in agent-traffic-control. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A Workflow parallel()/pipeline() fan-out where each agent is forced to emit a large
StructuredOutput schema can come back degraded (N-of-M results, not a clean crash) when a
transient server-side rate-limit hits mid-run. The affected agents repeatedly call
StructuredOutput with empty arguments (0 fields → schema-validation fail → retry → empty
again), burn 50-90 attempts, then die on a terminal API error and resolve to null inside
parallel(). The run "completes" but silently drops those agents' work — easy to mistake for "the
analysis found nothing" rather than "the emission failed."
This is distinct from workflow-standalone-schema-agent-crash-and-args-string (a standalone
non-parallel schema agent that cleanly never calls StructuredOutput and crashes the whole run).
Here the agents are inside parallel() (so the run survives), the failure is rate-limit-induced
empty payloads, and it correlates with large accumulated context (deep code-tracing agents
fail; a light agent that finished just before the storm succeeded).
<failures> / logs show
API Error: Server is temporarily limiting requests (not your usage limit) · Rate limited.StructuredOutput
tool_use calls, all with empty input, and a final isApiErrorMessage assistant turn.Run dir: <session>/subagents/workflows/<wf_runid>/. Count empty StructuredOutput calls per agent:
WF=~/.claude/projects/<encoded-dir>/<session-uuid>/subagents/workflows/<wf_runid>
for f in "$WF"/agent-*.jsonl; do
python3 -c "
import json,os
recs=[json.loads(l) for l in open('$f') if l.strip()]
so=sum(1 for o in recs for c in (o.get('message',{}).get('content') or []) if isinstance(c,dict) and c.get('type')=='tool_use' and c.get('name')=='StructuredOutput')
ne=sum(1 for o in recs for c in (o.get('message',{}).get('content') or []) if isinstance(c,dict) and c.get('type')=='tool_use' and c.get('name')=='StructuredOutput' and len((c.get('input') or {}).keys())>0)
print(os.path.basename('$f')[:20],'SO=',so,'nonempty=',ne)"
done
# SO>=15 & nonempty==0 ==> this agent empty-looped (stuck), not 'found nothing'.
journal.jsonl in the run dir has one {"type":"result", "result": {...}} line per agent that
finished. Extract those objects directly (axiom: session history IS retrievable). You only need to
re-run the agents that have NO result line.
python3 -c "
import json
for l in open('$WF/journal.jsonl'):
o=json.loads(l)
if o.get('type')=='result':
json.dump(o['result'], open('/tmp/recovered_<id>.json','w'), indent=2)"
The empty-SO loop is an emission failure, worst for big-schema + large-context agents. Re-run the
failed ones as plain Agent calls (or workflow agents) that return labelled markdown instead of
a forced StructuredOutput, then parse the text yourself. Free-text final messages do not have
the empty-tool-input failure mode. (Verified 2026-06-08: two heavy triage agents that empty-looped
90×/14× under the storm both succeeded immediately as free-text once re-dispatched.)
Feed the recovered results + the fresh free-text results into the next stage (e.g. a synthesis/judge)
via args or inline.
SO>=15 & nonempty==0 and exits early so
you can intervene in minutes instead of waiting for terminal failure.After recovery + free-text re-dispatch, you have M-of-M results (recovered + fresh) and the synthesis stage runs on the full set — not the degraded N-of-M. Confirm no agent jsonl still shows the empty-SO signature.
resumeFromRunId (cached-completed-agent re-launch): use resume when you want to
re-run with the SAME script after editing; use journal-recovery + free-text when you want to change
the emission strategy for the failed agents specifically.workflow-standalone-schema-agent-crash-and-args-string (standalone-agent crash + args-string),
workflow-parallel-fanout-omits-sequential-phases, claude-code-workflow-subagent-tokens-nested-undercount.{}) and there's no
rate-limit, the cause is an oversized/malformed payload, not this empty-loop — recover from the
agent's own transcript and shrink the schema. See workflow-schema-agent-retry-cap-oversized-payload.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub wan-huiyan/agent-traffic-control --plugin agent-traffic-control118 skills in this plugin
/agent-refusal-with-evidence-beats-literal-complianceA dispatched agent that does exactly what you asked can ship a defect you would
have stopped yourself, because it can see something at the worksite that you
could not see when you wrote the brief. Use when: (1) you are writing a brief
that prescribes a specific fix, threshold, wording or value rather than the
outcome you want; (2) an agent reports that it did not do what you asked and
you are deciding whether that is insubordination or judgement; (3) an agent
asserts "this is fine" or "not needed" with no measurement behind it; (4) you
are reviewing overnight output and want to know which decisions were checked
and which were assumed. Two halves, and both are needed: give the agent
explicit permission to satisfy the INTENT of an instruction while refusing its
letter, and REQUIRE the evidence with the refusal — what it built or measured,
what that showed, what it did instead. Evidence is the whole difference between
a refusal you can bank and one you have to re-litigate. Four agents correctly
declined an instruction in a single run; one built the suggested fix, measured
that it turned a silent safe refusal into a permanently red pipeline, and
reverted it unpushed.
/auto-merge-rearms-while-agent-live-kill-then-disarm-verifyDisarming auto-merge on a PR whose agent is still running does not hold it —
the agent re-arms within minutes and the PR merges, because arming is a step in
the agent's brief and disarming is not an instruction to the agent at all. Use
when: (1) you want to STOP a pull request from merging that an agent opened and
armed, for review, for a rethink, or because it is landing into a queue you are
trying to drain; (2) a PR you disarmed merged anyway; (3) you are telling agents
which PRs are on hold and want the hold to be enforced rather than announced;
(4) you are about to run `gh pr merge --disable-auto` and have not decided what
to do about the agent. The order is KILL THE AGENT FIRST, THEN DISARM, THEN
VERIFY the disarm by reading `autoMergeRequest` back — a disarm you did not read
back is not a hold. The stronger form needs no ordering at all: convert the PR
to a draft with `gh pr ready --undo`. A draft cannot merge whatever any agent
does to it, so the hold survives an agent you missed, an agent that restarts,
and an agent you did not know about.
/batch-member-cites-a-path-only-a-non-member-addsYou wrote something correct that the default reader cannot reach: a batch member citing a
path only a NON-member adds, or a rule, ruling or ledger sitting on an unlanded branch.
/batch-merge-subject-is-not-evidence-a-member-landedYou are about to close, delete the branch of, or mark as landed a pull
request because a batch, roll-up or merge-train commit on the target branch
names it in the subject line, and because the member's own commits all
predate that merge by wall clock. Neither of those is evidence. A batch
branch is assembled at some moment BEFORE it merges, so anything the member
pushed after assembly is outside it, and the subject records INTENT at
assembly time rather than CONTENT at merge time. Use before closing a
member, when an ancestry check against a squashed batch says no, or when a
member's branch still shows commits ahead of the target. Compare file
content against the target branch instead, expecting exactly one legitimate
difference: the shared aggregate file every member appends to.
/check-a-stale-branch-is-not-undoing-newer-main-workA branch built on an out-of-date main is about to merge, or has merged, and may undo work
that landed since. Use when a green, conflict-free PR deletes files you never touched,
newer values or a whole redesign vanish after a sibling PR merged, rows of a shared ledger
(tracker, registry, CHANGELOG) disappear or revert, or when `git diff main...HEAD` or a
reviewer says your small PR touches dozens of files you did not change.
/ci-leg-skipping-moves-minutes-it-does-not-remove-themYou are about to propose, price or approve a CI cost saving that works by
making a job or matrix leg SKIP on pull requests — a path filter, a safe
list, a changed-files gate, an exemption list. Check first whether the
pipeline runs a complement or backstop on merge, on push, or nightly:
many do, and then the legs a pull request skipped are exactly the legs some
later run executes, so a branch that goes green once and merges bills the
same total either way and the wall clock does not move at all. Use when
pricing a filter change, when a percentage saving is quoted with no basis,
or when choosing between filtering legs and batching pull requests. The
question that separates money from bookkeeping is whether the change
removes RUNS or merely moves LEGS.