Skip to content

docs(skills): Add AsyncIterator kind and two-plugin pattern to orchestrion#7652

Merged
crysmags merged 4 commits intomasterfrom
fix/orchestrion-asynciterator-docs
Mar 4, 2026
Merged

docs(skills): Add AsyncIterator kind and two-plugin pattern to orchestrion#7652
crysmags merged 4 commits intomasterfrom
fix/orchestrion-asynciterator-docs

Conversation

@crysmags
Copy link
Copy Markdown
Collaborator

@crysmags crysmags commented Mar 3, 2026

Summary

Documents how Orchestrion's AsyncIterator kind works for async generator/iterator methods.

Changes

  • Added AsyncIterator documentation to orchestrion reference skill
  • Explains the two-channel pattern (base + _next)
  • Provides example of two-plugin pattern required for AsyncIterator
  • Documents when to use AsyncIterator vs Async kind

Details

When kind: 'AsyncIterator' is used in orchestrion config, Orchestrion automatically creates TWO channels:

  1. Base channel: tracing:orchestrion:{package}:{channelName}:*
  2. Next channel: tracing:orchestrion:{package}:{channelName}_next:*

Two plugins are required:

  • Main plugin: Creates the span when stream starts
  • Next plugin: Handles each chunk and finishes span when result.done === true

This pattern is needed for methods that return Promise<AsyncIterable>, Promise<IterableReadableStream>, or Promise<AsyncIterableIterator>.

Testing

  • Documentation changes only
  • No code changes required

Co-Authored-By: Claude Sonnet 4.5 [email protected]

…trion

Documents how Orchestrion's AsyncIterator kind works:
- Creates TWO channels: base + _next
- Requires TWO plugins to handle both channels
- Main plugin creates span
- Next plugin finishes span when result.done === true

This pattern is needed for async generator/iterator methods like
Pregel.stream() that return Promise<IterableReadableStream>.

Without this documentation, agents wouldn't know to:
1. Use kind: 'AsyncIterator' in the config
2. Create both plugins
3. Check result.done in asyncEnd

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Mar 3, 2026

Benchmarks

Benchmark execution time: 2026-03-03 23:06:55

Comparing candidate commit d8230ab in PR branch fix/orchestrion-asynciterator-docs with baseline commit 2608ddb in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 230 metrics, 30 unstable metrics.

Copy link
Copy Markdown
Contributor

@wconti27 wconti27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all looks good with content, lets just modularize a bit more since only some integrations will need that context

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

Overall package size

Self size: 4.89 MB
Deduped: 5.74 MB
No deduping: 5.74 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.6 | 81.92 kB | 816.75 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.28%. Comparing base (2608ddb) to head (d8230ab).
⚠️ Report is 11 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7652      +/-   ##
==========================================
+ Coverage   80.27%   80.28%   +0.01%     
==========================================
  Files         734      738       +4     
  Lines       31644    31897     +253     
==========================================
+ Hits        25402    25610     +208     
- Misses       6242     6287      +45     
Flag Coverage Δ
aiguard-macos 38.93% <ø> (-0.12%) ⬇️
aiguard-ubuntu 39.04% <ø> (-0.12%) ⬇️
aiguard-windows 38.78% <ø> (-0.11%) ⬇️
apm-capabilities-tracing-macos 48.79% <ø> (+0.28%) ⬆️
apm-capabilities-tracing-ubuntu 48.87% <ø> (+0.33%) ⬆️
apm-capabilities-tracing-windows 48.61% <ø> (+0.33%) ⬆️
apm-integrations-child-process 38.51% <ø> (-0.11%) ⬇️
apm-integrations-couchbase-18 37.29% <ø> (-0.25%) ⬇️
apm-integrations-couchbase-eol 37.91% <ø> (-0.11%) ⬇️
apm-integrations-oracledb 37.74% <ø> (-0.11%) ⬇️
appsec-express 55.36% <ø> (-0.09%) ⬇️
appsec-fastify 51.67% <ø> (-0.09%) ⬇️
appsec-graphql 51.86% <ø> (-0.09%) ⬇️
appsec-kafka 44.39% <ø> (-0.04%) ⬇️
appsec-ldapjs 44.03% <ø> (-0.10%) ⬇️
appsec-lodash 43.68% <ø> (-0.09%) ⬇️
appsec-macos 58.35% <ø> (-0.10%) ⬇️
appsec-mongodb-core 48.85% <ø> (-0.09%) ⬇️
appsec-mongoose 49.53% <ø> (-0.09%) ⬇️
appsec-mysql 50.89% <ø> (-0.09%) ⬇️
appsec-node-serialize 43.20% <ø> (-0.10%) ⬇️
appsec-passport 47.65% <ø> (-0.10%) ⬇️
appsec-postgres 50.62% <ø> (-0.11%) ⬇️
appsec-sourcing 42.60% <ø> (-0.10%) ⬇️
appsec-template 43.37% <ø> (-0.10%) ⬇️
appsec-ubuntu 58.43% <ø> (-0.10%) ⬇️
appsec-windows 58.21% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-bluebird 32.31% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-body-parser 40.48% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-child_process 37.83% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-cookie-parser 34.31% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-express 34.64% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-express-mongo-sanitize 34.44% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-express-session 40.11% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-fs 31.92% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-generic-pool 29.73% <ø> (-0.02%) ⬇️
instrumentations-instrumentation-http 39.84% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-knex 32.31% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-mongoose 33.45% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-multer 40.23% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-mysql2 38.30% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-passport 44.02% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-passport-http 43.69% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-passport-local 44.23% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-pg 37.73% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-promise 32.24% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-promise-js 32.24% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-q 32.29% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-url 32.21% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-when 32.26% <ø> (-0.11%) ⬇️
llmobs-ai 41.96% <ø> (-0.11%) ⬇️
llmobs-anthropic 40.30% <ø> (-0.11%) ⬇️
llmobs-bedrock 39.25% <ø> (-0.09%) ⬇️
llmobs-google-genai 39.83% <ø> (-0.10%) ⬇️
llmobs-langchain 39.76% <ø> (-0.09%) ⬇️
llmobs-openai 44.14% <ø> (-0.10%) ⬇️
llmobs-vertex-ai 40.09% <ø> (-0.10%) ⬇️
platform-core 31.53% <ø> (ø)
platform-esbuild 34.48% <ø> (ø)
platform-instrumentations-misc 43.94% <ø> (ø)
platform-shimmer 37.63% <ø> (ø)
platform-unit-guardrails 32.95% <ø> (ø)
plugins-azure-event-hubs 25.71% <ø> (ø)
plugins-azure-service-bus 25.07% <ø> (ø)
plugins-bullmq 43.65% <ø> (-0.18%) ⬇️
plugins-cassandra 37.78% <ø> (-0.11%) ⬇️
plugins-cookie 26.77% <ø> (ø)
plugins-cookie-parser 26.56% <ø> (ø)
plugins-crypto 26.79% <ø> (ø)
plugins-dd-trace-api 38.37% <ø> (-0.12%) ⬇️
plugins-express-mongo-sanitize 26.70% <ø> (ø)
plugins-express-session 26.51% <ø> (ø)
plugins-fastify 42.23% <ø> (-0.11%) ⬇️
plugins-fetch 38.33% <ø> (-0.11%) ⬇️
plugins-fs 38.61% <ø> (-0.12%) ⬇️
plugins-generic-pool 25.75% <ø> (ø)
plugins-google-cloud-pubsub 45.37% <ø> (-0.10%) ⬇️
plugins-grpc 40.93% <ø> (-0.11%) ⬇️
plugins-handlebars 26.75% <ø> (ø)
plugins-hapi 40.12% <ø> (-0.11%) ⬇️
plugins-hono 40.38% <ø> (-0.11%) ⬇️
plugins-ioredis 38.42% <ø> (-0.11%) ⬇️
plugins-knex 26.39% <ø> (ø)
plugins-ldapjs 24.24% <ø> (ø)
plugins-light-my-request 26.12% <ø> (ø)
plugins-limitd-client 32.60% <ø> (-0.11%) ⬇️
plugins-lodash 25.84% <ø> (ø)
plugins-mariadb 39.48% <ø> (-0.16%) ⬇️
plugins-memcached 38.17% <ø> (-0.11%) ⬇️
plugins-microgateway-core 39.16% <ø> (-0.11%) ⬇️
plugins-moleculer 40.50% <ø> (-0.11%) ⬇️
plugins-mongodb 39.19% <ø> (-0.11%) ⬇️
plugins-mongodb-core 39.03% <ø> (-0.11%) ⬇️
plugins-mongoose 38.85% <ø> (-0.11%) ⬇️
plugins-multer 26.51% <ø> (ø)
plugins-mysql 39.13% <ø> (-0.14%) ⬇️
plugins-mysql2 39.26% <ø> (-0.11%) ⬇️
plugins-node-serialize 26.81% <ø> (ø)
plugins-opensearch 37.62% <ø> (-0.11%) ⬇️
plugins-passport-http 26.57% <ø> (ø)
plugins-postgres 35.71% <ø> (-0.18%) ⬇️
plugins-process 26.79% <ø> (ø)
plugins-pug 26.77% <ø> (ø)
plugins-redis 38.89% <ø> (-0.11%) ⬇️
plugins-router 42.96% <ø> (-0.11%) ⬇️
plugins-sequelize 25.35% <ø> (ø)
plugins-test-and-upstream-amqp10 38.49% <ø> (-0.11%) ⬇️
plugins-test-and-upstream-amqplib 43.82% <ø> (-0.11%) ⬇️
plugins-test-and-upstream-apollo 39.02% <ø> (-0.10%) ⬇️
plugins-test-and-upstream-avsc 38.70% <ø> (-0.11%) ⬇️
plugins-test-and-upstream-bunyan 33.88% <ø> (-0.11%) ⬇️
plugins-test-and-upstream-connect 40.78% <ø> (-0.11%) ⬇️
plugins-test-and-upstream-graphql 40.13% <ø> (-0.11%) ⬇️
plugins-test-and-upstream-koa 40.36% <ø> (-0.11%) ⬇️
plugins-test-and-upstream-protobufjs 38.93% <ø> (-0.11%) ⬇️
plugins-test-and-upstream-rhea 44.01% <ø> (-0.15%) ⬇️
plugins-undici 39.11% <ø> (-0.10%) ⬇️
plugins-url 26.79% <ø> (ø)
plugins-valkey 38.08% <ø> (-0.11%) ⬇️
plugins-vm 26.79% <ø> (ø)
plugins-winston 34.07% <ø> (-0.11%) ⬇️
plugins-ws 41.87% <ø> (-0.11%) ⬇️
profiling-macos 39.83% <ø> (-0.11%) ⬇️
profiling-ubuntu 39.95% <ø> (-0.11%) ⬇️
profiling-windows 41.16% <ø> (-0.11%) ⬇️
serverless-azure-functions-client 25.43% <ø> (ø)
serverless-azure-functions-eventhubs 25.43% <ø> (ø)
serverless-azure-functions-servicebus 25.43% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

crysmags and others added 3 commits March 3, 2026 15:56
Moved detailed AsyncIterator pattern documentation from orchestrion.md
to a dedicated async-iterator-pattern.md reference file for better
organization and emphasis.

Changes:
1. Created async-iterator-pattern.md with comprehensive AsyncIterator guide
   - When to use AsyncIterator kind
   - Two-channel pattern explanation
   - Complete two-plugin pattern with examples
   - Common mistakes and how to avoid them
   - Full LangGraph example
   - Testing strategies
   - Implementation checklist

2. Updated orchestrion.md with high-level overview and prominent link
   - Replaced 60+ line detailed section with concise summary
   - Added CRITICAL warning that AsyncIterator requires TWO plugins
   - Added REQUIRED READING directive linking to full reference
   - Updated table entry with link to reference

This ensures agents:
- See clear warning that AsyncIterator is special/complex
- Are directed to read the complete reference before implementing
- Have all implementation details in one dedicated document
- Don't miss critical requirements (two plugins, _next suffix, etc.)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
…Graph example

Removed generic plugin examples and kept only the complete LangGraph
implementation as the reference example. This makes the document less
bloated and more focused.

Changes:
- Removed generic Main/Next plugin code examples (60+ lines)
- Removed generic plugin export example
- Kept critical implementation requirements
- Kept common mistakes with ❌ examples
- Kept complete LangGraph example (orchestrion config + full plugin implementation)
- Kept testing section and checklist

The LangGraph example is a real, working implementation that demonstrates
all the critical requirements in context. Agents can learn from one
complete example rather than piecing together generic snippets.

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Keep only mistake headings without code examples. The complete LangGraph
example demonstrates the correct implementation, so showing wrong examples
adds unnecessary bloat.

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Copy link
Copy Markdown
Contributor

@wconti27 wconti27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, looks great! Once langgraph is merged, we can just use file pointers as well!

@crysmags crysmags merged commit 0a08693 into master Mar 4, 2026
788 of 789 checks passed
@crysmags crysmags deleted the fix/orchestrion-asynciterator-docs branch March 4, 2026 01:39
dd-octo-sts bot pushed a commit that referenced this pull request Mar 4, 2026
…trion (#7652)

* docs(skills): Add AsyncIterator kind and two-plugin pattern to orchestrion
@dd-octo-sts dd-octo-sts bot mentioned this pull request Mar 4, 2026
juan-fernandez pushed a commit that referenced this pull request Mar 5, 2026
…trion (#7652)

* docs(skills): Add AsyncIterator kind and two-plugin pattern to orchestrion
crysmags added a commit that referenced this pull request Mar 6, 2026
…trion (#7652)

* docs(skills): Add AsyncIterator kind and two-plugin pattern to orchestrion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants