Dispatch independent invocations concurrently. Give every invocation a stable identity, stream results as they arrive, and do not declare the batch complete until each invocation has a result, a failure, or an explicit cancellation record.Streaming concurrent batch loop
Overlap output and independent work.
parallel_invocation_batchRECORD STATUSCandidate · v0.1.0UML class view
The proposed contract drawn as participant roles, received calls, and numbered dependencies.
Object interactions
The same roles and calls as a class collaboration and a numbered message sequence.
Pointcut
Where the mechanism applies. All four dimensions belong to the proposed match, not just its vocabulary.
- Context
- Multiple model, tool, or batch tasks are authorized to run concurrently.
- Trigger
- A batch is dispatched or streamed.
- Structure
- Invocation identity, cancellation control, and result correlation.
- Effect
- Streamed or completed results are merged without losing or duplicating ownership.
Protected contract
The obligation that clients, operators, and auditors should be able to rely on.
- Requires
- The runtime exposes concurrency and a way to await or cancel outstanding work.
- Ensures
- Every accepted invocation is linked to its result or explicit failure.
- Invariant
- The harness does not declare completion while unreconciled work remains.
- Violation
- Partial failure and cancellation produce explicit terminal states and cleanup.
Negative control
Generic concurrency in an unrelated subsystem does not count.
Variation & lifecycle
The hot spot is admitted only where the protected semantics survive.
Permitted variation
Batch size, asyncio or promise scheduler, streaming reducer, and ordering policy.
Test obligation
Test one failure, cancellation, completion order, and concurrent side effects.
Evolution question
Did concurrency expand from tools to agents and preserve correlation?
Prompt + code design
An illustrative prompt and a small design sketch for the proposed contract. Names and APIs are invented; this is not a repository excerpt.
async def run_batch(invocations, runtime):
pending = {inv.id: asyncio.create_task(runtime.invoke(inv)) for inv in invocations}
results = {}
for finished in asyncio.as_completed(pending.values()):
result = await finished
results[result.invocation_id] = result
yield result
missing = set(pending) - set(results)
if missing:
raise BatchIncomplete(sorted(missing))Illustrative design sketch. Correlation by invocation id is the contract; concurrency alone is not. This example is a teaching aid, not implementation evidence or a conformance claim.
Detection & matching
The frozen rule that retrieves this record, the canonical source exemplar, and the control that should stay unmatched.
- Join point
parallel_invocation_batch- Source locator
- Barbaste et al., §6.2, p. 13 (Claude Code, “Streaming Loop with Concurrent Tool Batching”); shortened label
- Lexical cue
(?i)\b(?:concurrent|parallel(?:ism)?|batch(?:ed|ing)?|Promise\.all|asyncio\.gather)\bFrozen expression, v0.1.0. A match is a retrieval cue, not a confirmed implementation.- Aliases
- None
- Canonical exemplar
- OpenHands/software-agent-sdk
openhands-sdk/openhands/sdk/agent/parallel_executor.py:51Support: tests/sdk/agent/test_parallel_tool_span_context.py:1 - Negative control
- Generic concurrency in an unrelated subsystem does not count.
Scope-anchored review. pohe-agent analyze <repo> --pattern P02 anchors the cue to its enclosing declaration and checks a separate operational signature for all four pointcut dimensions. Missing roles and negative-control risks remain visible; a structural match is not E2/E3. Calibration report ↗
Repository files
Up to five public files retrieved by the frozen cue and pinned to the audited commit. A match is a place to inspect, not a confirmed implementation.
openhands-sdk/openhands/sdk/agent/parallel_executor.py:51CANONICAL SOURCE02aaif-goose/goosecrates/goose/src/acp/handoff.rs:113RETRIEVAL CUE03affaan-m/ECCskills/continuous-learning-v2/scripts/instinct-cli.py:409RETRIEVAL CUE04agno-agi/agnolibs/agno/agno/db/singlestore/utils.py:217RETRIEVAL CUE05Aider-AI/aideraider/coders/editblock_coder.py:457RETRIEVAL CUEEvidence & provenance
Each layer answers a different question. Do not substitute retrieval for review.
Source-located exemplar
A concrete source anchor is available for this proposed record. It is one exemplar, not evidence that all repositories—or every contract field—conform.
Review boundary: this candidate and its specification come from an AI-assisted study. Independent human validation remains open.
100.0% of repository families in the frozen panel have at least one current cue, historical cue, or canonical source layer. This is not confirmed prevalence.
Current lexical-cue repositories: 40 / 415c524ad65d81openhands-sdk/openhands/sdk/agent/parallel_executor.py:51tests/sdk/agent/test_parallel_tool_span_context.py:1Parallel batch tool executor with asyncio.gather.
Exploratory retrieval cue Regex / v0.1.0
(?i)\b(?:concurrent|parallel(?:ism)?|batch(?:ed|ing)?|Promise\.all|asyncio\.gather)\bThis expression is a discovery instrument only. A match is a retrieval cue—not a confirmed implementation, pointcut match, or contract proof.