Skip to content

Add 0050 example coverage: degrade mode and call-level retry#152

Merged
chris-colinsky merged 3 commits into
mainfrom
docs/0050-example-coverage
Jun 11, 2026
Merged

Add 0050 example coverage: degrade mode and call-level retry#152
chris-colinsky merged 3 commits into
mainfrom
docs/0050-example-coverage

Conversation

@chris-colinsky

Copy link
Copy Markdown
Member

Summary

Fold proposal 0050's two new primitives into existing worked examples and their docs, rather than adding standalone demos.

  • fan-out-with-retry gains a degrade failure posture alongside fail_fast and collect. FailureIsolationMiddleware wraps each fan-out instance as the outermost layer (retry stays inner), so an instance whose retries exhaust is caught and degraded to a placeholder result and the batch finishes intact. The demo env knob is renamed COLLECT_MODE to MODE (fail_fast / collect / degrade).
  • chat-with-multimodal gains call-level complete(retry=RetryConfig(...)) on the respond node, retrying just the LLM wire call on transient categories. Its failure-handling rundown grows from three placements to four.

Each example's docs page is updated, and the middleware and LLMs concept pages get backlinks to the new demonstrations.

Notes

Validation

  • ruff format / check, pyright, and pytest tests/test_examples_smoke.py (13/13) pass; mkdocs build is clean.
  • Both examples verified live: fan-out in fail_fast and MODE=degrade (the sentinel degrades to a placeholder, the rest summarize, no error block), and the chat demo across its four turns.

Demonstrate FailureIsolationMiddleware as a third per-instance failure
posture beside fail_fast and collect: wrapped outermost in the instance
middleware (retry stays inner), an instance whose retries exhaust is
caught and degraded to a placeholder so the batch finishes intact.
Rename the demo env knob COLLECT_MODE to MODE
(fail_fast/collect/degrade) and update the example and middleware
concept docs.
Pass complete(retry=RetryConfig(...)) on the respond node to retry the
LLM wire call on transient categories, and grow the example's
failure-handling rundown from three placements to four. Update the
example and LLMs concept docs.
Copilot AI review requested due to automatic review settings June 11, 2026 23:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates existing worked examples and documentation to demonstrate proposal 0050’s two primitives (failure isolation “degrade” posture and call-level retry) without adding new standalone demos.

Changes:

  • Extend fan-out-with-retry with a new MODE=degrade posture using FailureIsolationMiddleware as outermost instance middleware, and rename the env knob from COLLECT_MODE to MODE.
  • Extend chat-with-multimodal to use call-level retry via complete(retry=RetryConfig(...)) and update the failure-handling discussion accordingly.
  • Add docs backlinks from middleware/LLM concept pages to the updated demonstrations.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
examples/fan-out-with-retry/main.py Adds MODE handling and degrade posture via FailureIsolationMiddleware in instance middleware.
examples/chat-with-multimodal/main.py Demonstrates call-level retry on complete(retry=...) and updates explanatory text/output.
docs/examples/fan-out-with-retry.md Updates example docs for MODE (fail_fast / collect / degrade) and degrade behavior.
docs/examples/chat-with-multimodal.md Documents call-level retry usage and expands failure-handling discussion.
docs/concepts/middleware.md Adds backlink to the fan-out degrade composition demonstration.
docs/concepts/llms.md Adds backlink to the chat example demonstrating call-level retry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/fan-out-with-retry/main.py
Raise ValueError on an unknown mode instead of silently falling back
to fail_fast, so a mistyped MODE fails loudly. The docs assert the
three valid values.
@chris-colinsky chris-colinsky merged commit f275136 into main Jun 11, 2026
6 checks passed
@chris-colinsky chris-colinsky deleted the docs/0050-example-coverage branch June 11, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants